[Libvir] PATCH: Support network interface model in Xen and QEMU driver

Daniel P. Berrange berrange at redhat.com
Wed Apr 30 12:33:33 UTC 2008


On Wed, Apr 30, 2008 at 12:29:18AM -0400, Jim Paris wrote:
> 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@redhat.com/msg03557.html


I committed the patch with this simplification included

Regards,
Dan
-- 
|: 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