Re: [libvirt] [PATCH] 1/3 add support for netcf XML import and export

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

 



On Wed, Jul 15, 2009 at 05:40:30PM +0200, Daniel Veillard wrote:
> On Wed, Jul 15, 2009 at 11:22:43AM +0100, Daniel P. Berrange wrote:
> > On Wed, Jul 15, 2009 at 11:15:25AM +0200, Daniel Veillard wrote:
> > > +static int
> > > +virInterfaceDefParseBasicAttrs(virConnectPtr conn, virInterfaceDefPtr def,
> > > +                               xmlXPathContextPtr ctxt) {
> > > +    char *tmp;
> > > +    unsigned long mtu;
> > > +    int ret;
> > > +
> > > +    tmp = virXPathString(conn, "string(./@name)", ctxt);
> > > +    if (tmp == NULL) {
> > > +        virInterfaceReportError(conn, VIR_ERR_XML_ERROR,
> > > +                              "%s",  _("interface has no name"));
> > > +        return(-1);
> > > +    }
> > > +    def->name = tmp;
> > > +
> > > +    ret = virXPathULong(conn, "string(./mtu/@size)", ctxt, &mtu);
> > > +    if ((ret == -2) || ((ret == 0) && (mtu > 100000))) {
> > > +        virInterfaceReportError(conn, VIR_ERR_XML_ERROR,
> > > +                         "%s", _("interface mtu value is improper"));
> > > +    } else if (ret == 0) {
> > > +        def->mtu = (unsigned int) mtu;
> > > +    }
> > > +    return(0);
> > > +}
> > 
> > I think you need to return '-1' in that second error case.
> > 
> 
>   Ah, right ! Fixed.

  Okay I commited the 3 patches (with some help from Jim, git can be
surprizing for newbies !) , we can still change the enum handling,
at least it's there to test,

  thanks,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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