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

Daniel Veillard veillard at redhat.com
Wed Jul 15 20:10:34 UTC 2009


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 at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list