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

Re: [Xen-devel] [PATCH] libxl: add option for discard support to xl disk configuration



On Thu, 2014-01-30 at 11:56 +0100, Olaf Hering wrote:
> On Wed, Jan 29, Ian Campbell wrote:
> 
> > On Tue, 2014-01-28 at 19:24 +0100, Olaf Hering wrote:
> > > +    ("discard_enable", integer),
> > I have a feeling this should be a libxl_defbool, to allow for the
> > possibility of "libxl does what is best/lets the backend decide".
> > 
> > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > > index 2845ca4..3633a7d 100644
> > > --- a/tools/libxl/libxl.c
> > > +++ b/tools/libxl/libxl.c
> > > @@ -2196,6 +2196,8 @@ static void device_disk_add(libxl__egc *egc, 
> > > uint32_t domid,
> > >          flexarray_append(back, disk->readwrite ? "w" : "r");
> > >          flexarray_append(back, "device-type");
> > >          flexarray_append(back, disk->is_cdrom ? "cdrom" : "disk");
> > > +        flexarray_append(back, "discard_enable");
> > > +        flexarray_append(back, libxl__sprintf(gc, "%d", 
> > > (disk->discard_enable) ? 1 : 0));
> > And if this were a defbool then you'd want to use libxl_defbool_is_default: 
> > i.e.
> >     if (!libxl_defbool_is_default(disk->discard_enable))
> >             flexarray_append(back, ..., libxl_defbool_val(...) ? "1" : "0"))
> > 
> > (note the lack of libxl_sprintf here too).
> 
> Did you have something like this in mind? Its all it takes.

Looks about right, yes (modulo the over long line)

Thanks.
Ian.



_______________________________________________
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®.