From: Peter Krempa Date: Wed, 5 Feb 2020 13:51:12 +0000 (+0100) Subject: qemuDomainValidateStorageSource: Reject unsupported slices X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a6eeda986e458e6746268069b1f610c27e89d6e2;p=libvirt.git qemuDomainValidateStorageSource: Reject unsupported slices We support explicit storage slices only when using blockdev. Storage slices expressed via the backing store string are left to qemu to open correctly. Reject storage slices configured via the XML for non-blockdev usage. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 14e8c38c7b..69f15d2078 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6862,6 +6862,18 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src, return -1; } + if (src->sliceStorage) { + /* In pre-blockdev era we can't configure the slice so we can allow them + * only for detected backing store entries as they are populated + * from a place that qemu would be able to read */ + if (!src->detected && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("storage slice is not supported by this QEMU binary")); + return -1; + } + } + return 0; }