From: Erik Skultety Date: Wed, 21 Jan 2015 16:49:24 +0000 (+0100) Subject: qemu: Remove dead code in qemuDomainAssignPCIAddresses revert patch X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2fbfb3ac41a0963df86ffb6a8d78804295a04167;p=libvirt.git qemu: Remove dead code in qemuDomainAssignPCIAddresses revert patch As it turned out, fix of dead code 419a22 changed the affected condition from "never true" to "always true", so better fix would be to change the return code of virDomainMaybeAddController from 0 to 1 if a new bridge has been added, thus distinguishing case when we didn't need to add any controller and case we successfully added one. The return code is changed in the next commit --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1ebfdd133d..9a2dcecd35 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1510,7 +1510,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, i, bus->model)) < 0) goto cleanup; /* If we added a new bridge, we will need one more address */ - if (rv == 0 && + if (rv > 0 && virDomainPCIAddressReserveNextSlot(addrs, &info, flags) < 0) goto cleanup; }