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

Pau Garcia i Quiles pgquiles at elpauer.org
Tue Apr 8 14:18:38 UTC 2008

Quoting "Richard W.M. Jones" <rjones at redhat.com>:

> 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.

I've found how to get the list of supported models:

pgquiles at pravetz:~$ kvm -net nic,model=? -hda ''
Warning: vlan 0 is not connected to host network
qemu: Supported ISA NICs: ne2k_isa
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet  
rtl8139 e1000 virtio

> 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

Pau Garcia i Quiles
(Due to my workload, I may need 10 days to answer)

More information about the libvir-list mailing list