Re: PATCH: Support network interface model in Xen and QEMU driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel P. Berrange wrote:
> This patch finishes off the work from Rich / Soren to support network
> interface model in both Xen and QEMU drivers, and adds test cases for
> the new syntax

I still think our consensus from when I posted this patch last year
(<nic model=...>) makes more sense ... but getting any form of this
patch upstream sounds good to me.

> -            if (snprintf(nic, sizeof(nic), "nic,macaddr=%02x:%02x:%02x:%02x:%02x:%02x,vlan=%d",
> +            if (net->model[0] != '\0') {
> +                if (snprintf (model, sizeof (model), ",model=%s", net->model)
> +                    >= sizeof (model))
> +                    goto error;
> +            } else
> +                model[0] = '\0';
> +
> +            if (snprintf(nic, sizeof(nic),
> +                         "nic,macaddr=%02x:%02x:%02x:%02x:%02x:%02x,vlan=%d%s",
>                           net->mac[0], net->mac[1],
>                           net->mac[2], net->mac[3],
>                           net->mac[4], net->mac[5],
> -                         vlan) >= sizeof(nic))
> +                         vlan, model) >= sizeof(nic))

You could simplify this and not require the temporary buffer if you do
it this way:
  http://www.mail-archive.com/libvir-list@xxxxxxxxxx/msg03557.html

-jim

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]