From: Richard Jones Date: Fri, 7 Aug 2009 08:31:35 +0000 (+0100) Subject: Allow network interface to be configured. X-Git-Tag: 1.0.67~59 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=b5b87cdb764dc757295316878a7fd6e2ff01bec4;hp=39e4f1dad208124640f0f795518390ba680a9704 Allow network interface to be configured. Add ./configure --with-net-if=(virtio|ne2k_pci) option. This lets you workaround the following virtio_net bug: https://bugzilla.redhat.com/show_bug.cgi?id=516022 --- diff --git a/configure.ac b/configure.ac index f6f1735..cf0591d 100644 --- a/configure.ac +++ b/configure.ac @@ -138,6 +138,17 @@ AC_ARG_WITH([drive-if], [with_drive_if=ide]) AC_DEFINE_UNQUOTED([DRIVE_IF],["$with_drive_if"],[Default drive interface.]) +dnl Set interface used by the network. Normally you should +dnl leave this at the default (virtio) but you can use the +dnl alternative (ne2k_pci) because of bugs in virtio networking +dnl eg. https://bugzilla.redhat.com/show_bug.cgi?id=516022 +AC_ARG_WITH([net-if], + [AS_HELP_STRING([--with-net-if], + [set default net driver (virtio|ne2k_pci) @<:@default=virtio@:>@])], + [], + [with_net_if=virtio]) +AC_DEFINE_UNQUOTED([NET_IF],["$with_net_if"],[Default network interface.]) + dnl Check for febootstrap etc. AC_CHECK_PROG([FEBOOTSTRAP], [febootstrap],[febootstrap],[no]) diff --git a/src/guestfs.c b/src/guestfs.c index de63275..186c570 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -1103,7 +1103,7 @@ guestfs_launch (guestfs_h *g) } #endif add_cmdline (g, "-net"); - add_cmdline (g, "nic,model=virtio,vlan=0"); /* model=ne2k_pci also works */ + add_cmdline (g, "nic,model=" NET_IF ",vlan=0"); /* These options recommended by KVM developers to improve reliability. */ if (qemu_supports (g, "-no-hpet"))