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

Re: [Xen-devel] [PATCH] libxl: make libxl_cdrom_insert async

Somehow missed this comment ...

> > -int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk 
> > *disk)
> > +int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk 
> > *disk,
> > +                       const libxl_asyncop_how *ao_how)
> >  {
> ...
> > +    if (!disk->pdev_path) {
> > +        disk->pdev_path = strdup("");
> Don't you mean libxl__strdup ?  And presumably you should free the
> previous pdev_path ?

Previous pdev_path is NULL so there is no need to free it.

I didn't actually change this line, diff just thinks I did for some
reason, but I may as well make it a NOGC libxl__strdup while I'm here to
get the error handling.

> (TBH this massaging of the caller's libxl_device_disk is a bit
> unfriendly but I don't think getting rid of that is critical at this
> stage.  We can constify it later, in 4.3.)

It's quite a common pattern, the setdefaults function often does this
sort of thing. Actually, probably this should actually be in
libxl__device_disk_setdefault(), but lets not go there for 4.2.


Xen-devel mailing list



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