From: Liao Pingfang Date: Fri, 29 May 2020 15:52:24 +0000 (+0800) Subject: qemu: hotplug: Fix the condition check for net->downscript X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ab55a8a0871207de5fe194f55cbbcecae7a3cfe9;p=libvirt.git qemu: hotplug: Fix the condition check for net->downscript According to the context, here we are checking net->downscript's validity, Signed-off-by: Liao Pingfang Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d1a2be1f7a..a5d57702eb 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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;