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 <liao.pingfang@zte.com.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Liao Pingfang 2020-05-29 23:52:24 +08:00 committed by Michal Privoznik
parent f6c79ca2af
commit ab55a8a087

View 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;