From: Peter Krempa Date: Mon, 25 Sep 2017 09:39:55 +0000 (+0200) Subject: qemu: block: Don't lookup node names if they are already known X-Git-Tag: v3.8.0-rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b2fd3b148a3ad48f4a7c60b71e93687b9e30cef;p=thirdparty%2Flibvirt.git qemu: block: Don't lookup node names if they are already known Move the check that skips node name detection if they are already present earlier so that the hash table lookup is skipped. --- diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 3437302dd1..a3da80f888 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) ||