]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Remove dead code in qemuDomainAssignPCIAddresses revert patch
authorErik Skultety <eskultet@redhat.com>
Wed, 21 Jan 2015 16:49:24 +0000 (17:49 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 23 Jan 2015 10:03:45 +0000 (11:03 +0100)
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

src/qemu/qemu_command.c

index 1ebfdd133dd9f9a6001cdffbdbc02ecafe81a592..9a2dcecd35eb3d3ca02f6e4f16f9898bce2c3537 100644 (file)
@@ -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;
             }