[libvirt] [PATCH] qemu: raise an error when trying to use readonly ide disks

Giuseppe Scrivano gscrivan at redhat.com
Tue Jul 1 07:40:00 UTC 2014


Martin Kletzander <mkletzan at redhat.com> writes:

> If the user updates from QEMU without DRIVE_READONLY to newer one,
> that supports that flag, than XML with readonly IDE HDD will stop
> working even though it worked before the update *as requested*.  That
> readonly flag does not reflect how the disk is exposed in the guest;
> as you said IDE does not have any readonly concept, that is only how
> the device reacts to writes.
>
> Changing the behaviour to:
>
> if (disk->readonly &&
>    virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_READONLY) &&
>    !(disk->bus == VIR_DOMAIN_DISK_BUS_IDE &&
>      disk->device == VIR_DOMAIN_DISK_DEVICE_DISK))
>    virBufferAddLit(&opt, ",readonly=on");
>
>
> would keep the backward compatibility.  This behaviour makes more
> sense to me.

this behaves in a quite different way that my proposed patch but if
<readonly/> affects also the SELinux label and we allow the process to
run anyway by skipping readonly=on for IDE disks, wouldn't qemu fail in
weird ways when trying to write to the file?

Regards,
Giuseppe




More information about the libvir-list mailing list