#include "emul_state.h"
#include <libgen.h>
-#include "sysemu/sysemu.h"
#include "emulator_common.h"
#if defined(CONFIG_LINUX)
extern bool hax_allowed;
#endif
+#include "sysemu/sysemu.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
+#include "net/net.h"
#include "emulator_options.h"
#include "skin/maruskin_server.h"
void set_emul_tap_enable(bool enable)
{
- LOG_INFO("%s: %s", __func__, enable ? "true" : "false");
+ LOG_INFO("%s: %s\n", __func__, enable ? "true" : "false");
_emul_info.tap_enable = enable;
}
+bool is_netclient_tap_attached(void)
+{
+ NetClientState *ncs[MAX_QUEUE_NUM];
+ int queues, i;
+
+ queues = qemu_find_net_clients_except(NULL, ncs,
+ NET_CLIENT_OPTIONS_KIND_NIC,
+ MAX_QUEUE_NUM);
+ for (i = 0; i < queues; ++i) {
+ if (ncs[i]->info->type == NET_CLIENT_OPTIONS_KIND_TAP &&
+ (ncs[i]->peer->info->type == NET_CLIENT_OPTIONS_KIND_NIC ||
+ // for legacy -net option.
+ ncs[i]->peer->info->type == NET_CLIENT_OPTIONS_KIND_HUBPORT)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
void set_emul_guest_ip(char *ip)
{
strncpy(_emul_info.guest_ip, ip, strlen(ip));
bool get_sdb_connection(void);
const char* get_drive_image_file(void);
const char* get_http_proxy_addr(void);
+bool is_netclient_tap_attached(void);
/* multi-touch */
MultiTouchState *get_emul_multi_touch_state(void);