提交 8b2fd3b1 编写于 作者: P Peter Krempa

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.
上级 32d6c738
......@@ -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) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册