[libvirt] [PATCH] nwfilter: enable hex number inputs in filter XML

Stefan Berger stefanb at us.ibm.com
Mon Apr 26 17:22:22 UTC 2010


Eric Blake <eblake at redhat.com> wrote on 04/26/2010 01:00:45 PM:


> 
> On 04/26/2010 10:44 AM, Stefan Berger wrote:
> > With this patch I want to enable hex number inputs in the filter XML. 
A
> > number that was entered as hex is also printed as hex unless a string
> > representing the meaning can be found.
> > 
> > I am also extending the schema and adding a test case. A problem with
> > the DSCP value is fixed on the way as well.
> 
> ACK.
> 
> > +               format = "%d";
> > +
> > +               switch (item->datatype) {
> > 
> > +               case DATATYPE_UINT8_HEX:
> > +                   format = "0x%x";
> >                 case DATATYPE_IPMASK:
> >                 case DATATYPE_IPV6MASK:
> >                     // display all masks in CIDR format
> >                 case DATATYPE_UINT8:
> >                     storage_ptr = &item->u.u8;
> > -                   virBufferVSprintf(buf, "%d", *(uint8_t 
*)storage_ptr);
> > +                   virBufferVSprintf(buf, format, *(uint8_t 
*)storage_ptr);
> 
> Gcc didn't warn about the use of a non-literal format argument here?  At

No, not a word from gcc (4.4.3 20100409). 

  Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100426/37a8d702/attachment-0001.htm>


More information about the libvir-list mailing list