*/
g->cmdline[0] = g->qemu;
+ if (qemu_supports (g, "-nodefconfig"))
+ add_cmdline (g, "-nodefconfig");
+
/* qemu sometimes needs this option to enable hardware
* virtualization, but some versions of 'qemu-kvm' will use KVM
* regardless (even where this option appears in the help text).
add_cmdline (g, "-device");
add_cmdline (g, "virtserialport,chardev=channel0,name=org.libguestfs.channel.0");
+ /* Enable user networking. */
+ if (g->enable_network) {
+ add_cmdline (g, "-netdev");
+ add_cmdline (g, "user,id=usernet");
+ add_cmdline (g, "-device");
+ add_cmdline (g, NET_IF ",netdev=usernet");
+ }
+
#define LINUX_CMDLINE \
"panic=1 " /* force kernel to panic if daemon exits */ \
"console=ttyS0 " /* serial console */ \