[PATCH 1/2] qemu: block: Don't lookup node names if they are already known

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

 



Move the check that skips node name detection if they are already
present earlier so that the hash table lookup is skipped.
---
 src/qemu/qemu_block.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 3437302dd..a3da80f88 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -272,13 +272,13 @@ qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk,
     qemuBlockNodeNameBackingChainDataPtr entry = NULL;
     virStorageSourcePtr src = disk->src;

-    if (!(entry = virHashLookup(disktable, disk->info.alias)))
-        return 0;
-
     /* don't attempt the detection if the top level already has node names */
     if (src->nodeformat || src->nodestorage)
         return 0;

+    if (!(entry = virHashLookup(disktable, disk->info.alias)))
+        return 0;
+
     while (src && entry) {
         if (src->nodeformat || src->nodestorage) {
             if (STRNEQ_NULLABLE(src->nodeformat, entry->nodeformat) ||
-- 
2.14.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux