[libvirt] [PATCH v2 02/12] qemuDomainDiskChangeSupported: Deny changing reservations
John Ferlan
jferlan at redhat.com
Fri Mar 2 01:58:40 UTC 2018
On 02/21/2018 01:11 PM, Michal Privoznik wrote:
> Couple of reasons for that:
>
> a) there's no monitor command to change path where the pr-helper
> connects to, or
> b) there's no monitor command to introduce a new pr-helper for a
> disk that already exists.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> src/libvirt_private.syms | 1 +
> src/qemu/qemu_domain.c | 8 ++++++++
> src/util/virstoragefile.c | 18 ++++++++++++++++++
> src/util/virstoragefile.h | 2 ++
> 4 files changed, 29 insertions(+)
>
[...]
> index 8b4efc82d..de8974d66 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -7480,6 +7480,14 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
> CHECK_EQ(src->readonly, "readonly", true);
> CHECK_EQ(src->shared, "shared", true);
>
> + if (!virStoragePRDefIsEqual(disk->src->pr,
> + orig_disk->src->pr)) {
> + virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
> + _("cannot modify field '%s' of the disk"),
> + "reservations");
Formatting problems above - the " should line up I think... also
"diskreservations" will look odd.
John
> + return false;
> + }
> +
> #undef CHECK_EQ
>
> return true;
More information about the libvir-list
mailing list