1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-27 18:03:50 +03:00

qemu: Resolve Coverity NEGATIVE_RETURNS

In qemuProcessInitPCIAddresses() if qemuMonitorGetAllPCIAddresses()
returns a negative (or zero) value, then no need to call the
qemuProcessDetectPCIAddresses().

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2014-09-04 16:50:15 -04:00
parent 8ffab1010a
commit 35a50ea8c7

View File

@ -2725,7 +2725,7 @@ qemuProcessInitPCIAddresses(virQEMUDriverPtr driver,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int naddrs;
int ret;
int ret = -1;
qemuMonitorPCIAddress *addrs = NULL;
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
@ -2734,7 +2734,8 @@ qemuProcessInitPCIAddresses(virQEMUDriverPtr driver,
&addrs);
qemuDomainObjExitMonitor(driver, vm);
ret = qemuProcessDetectPCIAddresses(vm, addrs, naddrs);
if (naddrs > 0)
ret = qemuProcessDetectPCIAddresses(vm, addrs, naddrs);
VIR_FREE(addrs);