[libvirt] [PATCH 1/5] qemu: Remove dead code in qemuDomainAssignPCIAddresses revert patch

Erik Skultety eskultet at redhat.com
Wed Jan 21 16:49:24 UTC 2015


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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c041ee7..cdf02a6 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;
             }
-- 
1.9.3




More information about the libvir-list mailing list