From: John Ferlan Date: Tue, 22 Jan 2013 14:41:01 +0000 (-0500) Subject: qemu: Add coverity[negative_returns] tag X-Git-Tag: v1.0.2-rc1~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c2e4c3856c8ed48c378bf1bf357cab46271a47a;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 19172e1255..8103183386 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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);