From: John Ferlan Date: Tue, 17 Dec 2019 15:43:24 +0000 (-0500) Subject: virsh: Adjust logic checks in virshUpdateDiskXML X-Git-Tag: v6.0.0-rc1~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce7af78e3907c7462aa88d58facdc4ce7e0acd8d;p=thirdparty%2Flibvirt.git virsh: Adjust logic checks in virshUpdateDiskXML Make it clearer that what we're trying to do is find @source and @target_node so that the unattentive or code analysis utility doesn't believe 'source' and 'target' could be found in the same node element. Signed-off-by: John Ferlan Reviewed-by: Michal Privoznik --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 56137bdd74..9d4cdd26dd 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -12476,10 +12476,9 @@ virshUpdateDiskXML(xmlNodePtr disk_node, if (tmp->type != XML_ELEMENT_NODE) continue; - if (virXMLNodeNameEqual(tmp, "source")) + if (!source && virXMLNodeNameEqual(tmp, "source")) source = tmp; - - if (virXMLNodeNameEqual(tmp, "target")) + else if (!target_node && virXMLNodeNameEqual(tmp, "target")) target_node = tmp; /*