d76c62
From eb3af538c22a06297d7f423210cbebcdd008e0c1 Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <eb3af538c22a06297d7f423210cbebcdd008e0c1@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Wed, 19 Feb 2020 15:10:18 +0100
d76c62
Subject: [PATCH] qemu: block: forbid creation of storage sources with <slice>
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
Specifically creating such images via libvirt during blockjobs would
d76c62
be much more hassle than it's worth. Just forbid them for now.
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
(cherry picked from commit 8c4303768846834893687db68ec265ce35aab5df)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1791788
d76c62
Message-Id: <756f5928f4ba944fdec54f60724194a046276a01.1582120424.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 src/qemu/qemu_block.c | 6 ++++++
d76c62
 1 file changed, 6 insertions(+)
d76c62
d76c62
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
d76c62
index b408d4c81f..1147f4d3af 100644
d76c62
--- a/src/qemu/qemu_block.c
d76c62
+++ b/src/qemu/qemu_block.c
d76c62
@@ -2529,6 +2529,12 @@ qemuBlockStorageSourceCreate(virDomainObjPtr vm,
d76c62
     int ret = -1;
d76c62
     int rc;
d76c62
 
d76c62
+    if (src->sliceStorage) {
d76c62
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
d76c62
+                       _("creation of images with slice type='storage' is not supported"));
d76c62
+        return -1;
d76c62
+    }
d76c62
+
d76c62
     if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0)
d76c62
         goto cleanup;
d76c62
 
d76c62
-- 
d76c62
2.25.0
d76c62