]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: hotplug: Fix the condition check for net->downscript
authorLiao Pingfang <liao.pingfang@zte.com.cn>
Fri, 29 May 2020 15:52:24 +0000 (23:52 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Jun 2020 15:50:11 +0000 (17:50 +0200)
According to the context, here we are checking net->downscript's validity,

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_hotplug.c

index d1a2be1f7a20d2dfe2dc5c18f052b4f356060c1c..a5d57702ebf475f10590f07e8c82345929718e18 100644 (file)
@@ -4673,8 +4673,8 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
         else
             VIR_WARN("Unable to release network device '%s'", NULLSTR(net->ifname));
     } else if (net->type == VIR_DOMAIN_NET_TYPE_ETHERNET) {
-        if (net->script)
-           virNetDevRunEthernetScript(net->ifname, net->downscript);
+        if (net->downscript)
+            virNetDevRunEthernetScript(net->ifname, net->downscript);
     }
     virDomainNetDefFree(net);
     return 0;