mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
qemu: Add coverity[negative_returns] tag
This avoids "Event negative_returns: A negative constant "-1" is passed as an argument to a parameter that cannot be negative.". The called function uses -1 to determine whether it needs to traverse all the hostdevs.
This commit is contained in:
committed by
Michal Privoznik
parent
28cd3dc40b
commit
6c2e4c3856
@@ -2539,6 +2539,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
|
|||||||
detach = vm->def->nets[detachidx];
|
detach = vm->def->nets[detachidx];
|
||||||
|
|
||||||
if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
|
if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
|
||||||
|
/* coverity[negative_returns] */
|
||||||
ret = qemuDomainDetachThisHostDevice(driver, vm,
|
ret = qemuDomainDetachThisHostDevice(driver, vm,
|
||||||
virDomainNetGetActualHostdev(detach),
|
virDomainNetGetActualHostdev(detach),
|
||||||
-1);
|
-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user