[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCHv7 9/9] blockjob: relabel entire existing chain



When using block copy to pivot over to a new chain, and the user
passes --reuse-ext, it could be that the user has already transferred
the entire backing chain, and that the external file being reused
has a backing chain that needs SELinux labeling.

https://bugzilla.redhat.com/show_bug.cgi?id=856247

* src/qemu/qemu_driver.c (qemuDomainBlockCopy): Don't bypass
labeling when reusing external file.
---

This patch is new compared to the v6 posting.

I'm actually planning on squashing this into patch 8/9 before pushing,
but posting for separate review makes it easier to track how this is
being backported to RHEL 6.3.

 src/qemu/qemu_driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b9014c3..246969e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13060,7 +13060,11 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *path,
     origsrc = disk->src;
     disk->src = (char *) dest;
     origdriver = disk->driverType;
-    disk->driverType = (char *) "raw"; /* Don't want to probe backing files */
+    if (!(flags & VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)) {
+        /* Don't want to probe backing files unless the chain is
+         * coming from the external use */
+        disk->driverType = (char *) "raw";
+    }

     if (virDomainLockDiskAttach(driver->lockManager, vm, disk) < 0)
         goto endjob;
-- 
1.7.11.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]