mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00: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:
parent
28cd3dc40b
commit
6c2e4c3856
@ -2539,6 +2539,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
|
||||
detach = vm->def->nets[detachidx];
|
||||
|
||||
if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
|
||||
/* coverity[negative_returns] */
|
||||
ret = qemuDomainDetachThisHostDevice(driver, vm,
|
||||
virDomainNetGetActualHostdev(detach),
|
||||
-1);
|
||||
|
Loading…
Reference in New Issue
Block a user