From 2fbfb3ac41a0963df86ffb6a8d78804295a04167 Mon Sep 17 00:00:00 2001 From: Erik Skultety Date: Wed, 21 Jan 2015 17:49:24 +0100 Subject: [PATCH] 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 --- 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 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; }