[libvirt] [PATCH] qemu: format serial, geometry and error policy on frontend disk device

Daniel P. Berrangé berrange at redhat.com
Mon Jun 25 10:37:07 UTC 2018


On Mon, Jun 25, 2018 at 12:29:48PM +0200, Peter Krempa wrote:
> On Mon, Jun 25, 2018 at 10:50:32 +0100, Daniel Berrange wrote:
> > Currently we format the serial, geometry and error policy on the -drive
> > backend argument.
> > 
> > QEMU added the ability to set serial and geometry on the frontend in
> > the 1.2 release, and ability to set error policy in the 2.7 release.
> > usb-storage is an oddity, however, as it lacks error policy support
> > right now.
> > 
> > Setting any of these on -drive has been deprecated and support for this
> > will be removed very soon.
> > 
> > Note that some disk buses (sd) still don't support -device. Although
> > QEMU allowed these properties to be set on -drive for if=sd, they
> > have been ignored so we don't loose anything by removing this.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>

> > @@ -2125,6 +2141,11 @@ qemuBuildDriveDevStr(const virDomainDef *def,
> >      if (qemuBuildDriveDevCacheStr(disk, &opt, qemuCaps) < 0)
> >          goto error;
> >  
> > +    qemuBuildDiskFrontendAttributes(disk, &opt);
> > +    if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISK_ERROR) &&
> > +        disk->bus != VIR_DOMAIN_DISK_BUS_USB)
> 
> Why is USB special here? Switching to -blockdev will require doing this
> also for the USB disk, so I'd rather have a single case here.

We have no choice - QEMU didn't add it....

$ for i in virtio-blk ide-hd scsi-hd usb-storage ; do ./x86_64-softmmu/qemu-system-x86_64 -device $i,? 2>&1  | grep werror ; done
virtio-blk-pci.werror=BlockdevOnError (Error handling policy, report/ignore/enospc/stop/auto)
ide-hd.werror=BlockdevOnError (Error handling policy, report/ignore/enospc/stop/auto)
scsi-hd.werror=BlockdevOnError (Error handling policy, report/ignore/enospc/stop/auto)



Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list