[libvirt] [PATCH] qemu: don't goto cleanup when qemuDomainRemoveDevice failed at function qemuProcessUpdateDevices

xinhua.Cao posted 1 patch 6 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20171116092242.8504-1-caoxinhua@huawei.com
src/qemu/qemu_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] qemu: don't goto cleanup when qemuDomainRemoveDevice failed at function qemuProcessUpdateDevices
Posted by xinhua.Cao 6 years, 5 months ago
Function qemuProcessUpdateDevices was called at qemuProcessReconnect
when we detach net device lively and killed libvirtd service at middle.
qemu detached the device but libvirtd don't save it at runDir. when
libvirtd restart, libvirtd will detach net device but qemu will return
fail because device was not found. then libvirtd qemuProcessReconnect
failed and goto error. libvirtd kill qemu. To avoid qemu is killed by
libvirtd, qemuDomainRemoveDevice will not return failed.
---
 src/qemu/qemu_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 6d242b1..9f9393b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3234,7 +3234,7 @@ qemuProcessUpdateDevices(virQEMUDriverPtr driver,
             if (!virStringListHasString(qemuDevices, *tmp) &&
                 virDomainDefFindDevice(vm->def, *tmp, &dev, false) == 0 &&
                 qemuDomainRemoveDevice(driver, vm, &dev) < 0) {
-                goto cleanup;
+                VIR_WARN("failed to remove device %s at reconnect process", *tmp);
             }
             tmp++;
         }
-- 
2.8.3


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list