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

Re: [Xen-devel] [PATCH 2/3] libxl_types.idl: use empty Struct for invalid domain type



On Thu, Apr 10, 2014 at 04:07:04PM +0100, Ian Campbell wrote:
> On Thu, 2014-04-10 at 16:04 +0100, Wei Liu wrote:
> > On Thu, Apr 10, 2014 at 03:50:02PM +0100, Ian Campbell wrote:
> > > > > 
> > > > > And if it did could we not detect the use of None with an explicit 
> > > > > check
> > > > 
> > > > gentypes does that already. The result is not generating anything.
> > > 
> > > So make it generate something? That's just a map_open/map_close isn't
> > > it?
> > > 
> > 
> > So if a keyed-union field is of type None:
> 
> Looks plausible, but I've not diffed the generated code.
> 
    case LIBXL_DOMAIN_TYPE_INVALID:
+       yajl_gen_map_open(hand);
+       if (s != yajl_gen_status_ok)
+           goto out;
+       yajl_gen_map_close(hand);
+       if (s != yajl_gen_status_ok)
+           goto out;
        break;

> 

I would rather stick with a map to be consistent with other keys. This
can simplify later code generation for parser.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.