[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] qemu: Fix a regression of attaching device



qemuDomainModifyDeviceFlags: Changing "ret" to "0", but don't
reset it to "-1" on failure, it's not good idea to change the value
of "ret" in the codes to do some condition checking. This patch
fix it.
---
 src/qemu/qemu_driver.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0a6b48e..ae11c68 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4892,10 +4892,10 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
                             _("unknown domain modify action %d"), action);
             break;
         }
-    } else
-        ret = 0;
+    }
 
-    if (!ret && (flags & VIR_DOMAIN_AFFECT_LIVE)) {
+    if (!(flags & VIR_DOMAIN_AFFECT_CONFIG) &&
+        (flags & VIR_DOMAIN_AFFECT_LIVE)) {
         /* If dev exists it was created to modify the domain config. Free it. */
         virDomainDeviceDefFree(dev);
         dev = virDomainDeviceDefParse(driver->caps, vm->def, xml,
-- 
1.7.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]