[Libvir] [PATCH] Allow selection of the NIC model in QEMU/KVM

Daniel P. Berrange berrange at redhat.com
Tue Apr 8 13:57:15 UTC 2008

On Tue, Apr 08, 2008 at 02:17:56PM +0100, Richard W.M. Jones wrote:
> This patch allows selection of the NIC model for QEMU/KVM domains.
> The selection is done by adding a <model/> element to the XML, as in
> this example:
>     <interface type='user'>
>       <mac address='00:16:3e:33:b8:d3'/>
>       <model type='ne2k_pci'/>
>     </interface>
> The model type string is only checked to make sure it's a short
> alpha-numeric + underscore, since it seems impractical to extract the
> actual list of supported models.
> If you choose a supported model then QEMU starts up with this extra
> -nic parameter:
>   /usr/bin/qemu-kvm -M pc -m 500 -smp 1 -monitor pty \
>     -boot c -hda /var/lib/xen/images/rhel51x32kvm.img \
>     -net nic,macaddr=00:16:3e:33:b8:d3,vlan=0,model=ne2k_pci -net user,vlan=0 \
>     -usb -vnc
> If you choose a non-existant model then you get the error:
>   libvir: QEMU error : internal error QEMU quit during monitor startup

This patch seems incomplete - there's no code to include the <model> tag
when dumping the XML.

We should also implement the same for Xen driver really, since that has the
choice of ne2k/rtl8139/e1000 too

|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

More information about the libvir-list mailing list