[libvirt] [PATCH v5.1 04/11] qemu: Record the default NIC model in the domain XML

Eric Blake eblake at redhat.com
Thu Apr 4 17:12:09 UTC 2013


On 04/04/2013 06:10 AM, Peter Krempa wrote:
> This patch implements the devices post parse cllback and uses it to fill

s/cllback/callback/

> the default qemu network card model into the XML if none is specified.
> 
> Libvirt assumes that the network card model for qemu is the "rtl8139".
> Record this in the XML using the new callback to avoid user
> confusion.
> ---

> 
> +static int
> +qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
> +                             virDomainDefPtr def ATTRIBUTE_UNUSED,
> +                             virCapsPtr caps ATTRIBUTE_UNUSED,
> +                             void *opaque ATTRIBUTE_UNUSED)
> +{
> +    if (dev->type == VIR_DOMAIN_DEVICE_NET &&
> +        dev->data.net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV) {
> +        if (!dev->data.net->model &&
> +            !(dev->data.net->model = strdup("rtl8139")))

Possible merge conflict with VIR_STRDUP patches, but we'll cross that
bridge when we get there.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130404/cefbd4bc/attachment-0001.sig>


More information about the libvir-list mailing list