fcntl(fd, F_SETFL, O_NONBLOCK);
return fd;
}
+#elif defined(CONFIG_STUBDOM)
+#include <netfront.h>
+static int tap_open(char *ifname, int ifname_size)
+{
+ char nodename[64];
+ static int num = 1; // 0 is for our own TCP/IP networking
+ snprintf(nodename, sizeof(nodename), "device/vif/%d", num++);
+ return netfront_tap_open(nodename);
+}
+
+#undef DEFAULT_NETWORK_SCRIPT
+#define DEFAULT_NETWORK_SCRIPT ""
+#undef DEFAULT_NETWORK_DOWN_SCRIPT
+#define DEFAULT_NETWORK_DOWN_SCRIPT ""
#endif
static int launch_script(const char *setup_script, const char *ifname,
const char *setup_script, const char *down_script,
const char *script_arg)
{
-#ifdef CONFIG_STUBDOM
- errno = ENOSYS;
- return -1;
-#else
TAPState *s;
int fd;
char ifname[128];
else
s->script_arg[0] = '\0';
return 0;
-#endif
}
#endif /* !_WIN32 */
struct qemu_alarm_timer;
-#ifdef CONFIG_STUBDOM
-#include <netfront.h>
-static int tap_open(char *ifname, int ifname_size)
-{
- char nodename[64];
- static int num = 1; // 0 is for our own TCP/IP networking
- snprintf(nodename, sizeof(nodename), "device/vif/%d", num++);
- return netfront_tap_open(nodename);
-}
-
-#undef DEFAULT_NETWORK_SCRIPT
-#define DEFAULT_NETWORK_SCRIPT ""
-#undef DEFAULT_NETWORK_DOWN_SCRIPT
-#define DEFAULT_NETWORK_DOWN_SCRIPT ""
-#endif
-
#ifdef CONFIG_PASSTHROUGH
void do_pci_del(char *devname)
{