render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
404507
From 3dcba116fd4e0a6df50b905b021151b30ef55714 Mon Sep 17 00:00:00 2001
404507
Message-Id: <3dcba116fd4e0a6df50b905b021151b30ef55714@dist-git>
404507
From: Peter Krempa <pkrempa@redhat.com>
404507
Date: Fri, 1 Dec 2017 15:57:01 +0100
404507
Subject: [PATCH] qemu: domain: Refactor control flow in
404507
 qemuDomainDetermineDiskChain
404507
404507
Split out clearing of the backing chain prior to other code since it
404507
will be required later and optimize few layers of nested conditions and
404507
loops.
404507
404507
(cherry picked from commit b19710b9b6039728620a8d557a322ef139529226)
404507
404507
 Conflicts:
404507
	src/qemu/qemu_domain.c:
404507
        a92c4f7537577f1443ddd6fef4e0dfcb054e5f08 was not backported thus
404507
        the code skipping to the end of the backing chain is missing
404507
404507
        This patch only moves the block that clears the backing store
404507
        earlier so that the rest of the patches will apply
404507
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1509110
404507
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
404507
---
404507
 src/qemu/qemu_domain.c | 11 +++++------
404507
 1 file changed, 5 insertions(+), 6 deletions(-)
404507
404507
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
404507
index 1b5f439621..13d120040b 100644
404507
--- a/src/qemu/qemu_domain.c
404507
+++ b/src/qemu/qemu_domain.c
404507
@@ -6355,12 +6355,11 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
404507
     if (virStorageSourceIsEmpty(disk->src))
404507
         goto cleanup;
404507
 
404507
-    if (virStorageSourceHasBacking(disk->src)) {
404507
-        if (force_probe)
404507
-            virStorageSourceBackingStoreClear(disk->src);
404507
-        else
404507
-            goto cleanup;
404507
-    }
404507
+    if (force_probe)
404507
+        virStorageSourceBackingStoreClear(disk->src);
404507
+
404507
+    if (virStorageSourceHasBacking(disk->src))
404507
+        goto cleanup;
404507
 
404507
     qemuDomainGetImageIds(cfg, vm, disk->src, &uid, &gid;;
404507
 
404507
-- 
404507
2.15.1
404507