diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8091fb3d45..91be16c504 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1509,9 +1509,9 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, i, bus->model)) < 0) goto cleanup; /* If we added a new bridge, we will need one more address */ - if (rv > 0 && virDomainPCIAddressReserveNextSlot(addrs, &info, - flags) < 0) - goto cleanup; + if (rv == 0 && + virDomainPCIAddressReserveNextSlot(addrs, &info, flags) < 0) + goto cleanup; } nbuses = addrs->nbuses; virDomainPCIAddressSetFree(addrs);