[libvirt] [PATCH] libxl: add discard support to libxl_device_disk

Daniel P. Berrange berrange at redhat.com
Mon Jul 7 14:05:59 UTC 2014


On Mon, Jul 07, 2014 at 04:00:44PM +0200, Olaf Hering wrote:
> On Fri, May 30, Jim Fehlig wrote:
> 
> > Olaf Hering wrote:
> > > +    if (discard == VIR_DOMAIN_DISK_DISCARD_DEFAULT)
> > > +        return;
> > > +    virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> > > +                   _("This version of libxenlight does not support "
> > > +                     "discard= option passing"));
> > An error would be reported here, but the overall libxlMakeDisk operation
> > would succeed right?  Shouldn't it fail if the user requests discard but
> > it is not supported?
> 
> How would libvirt know if the underlying backing store supports discard?
> It would need to maintain a list of supported targets.
> If it remains just some sort of warning a given .xml file can be shared
> among different libvirt versions. After all, discard is not operation
> critical.

IIUC, this is not about the underlying storage, but about whether the
hypervisor API supports the discard setting. The libvirt policy is to
always raise VIR_ERR_CONFIG_UNSUPPORTED and return failure to the app
if they request a setting that the hypervisor does not support. Whether
discard is critical or not really depends on your POV, so it is better
not to make such assumptions on behalf of the mgmt app.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list