[PATCH v2] qemuDomainSaveInternal: fix memoryleak of virDomainDef

2020-07-28 Thread Chuan Zheng
From: Zheng Chuan virDomainDefPtr 'def' is forgot to free after qemuDomainDefFormatLive(), fix it. Signed-off-by: Zheng Chuan --- src/qemu/qemu_driver.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[PATCH] qemuDomainSaveInternal: fix memoryleak of virDomainDef

2020-07-28 Thread Chuan Zheng
From: Zheng Chuan virDomainDefPtr 'def' is forgot to free after qemuDomainDefFormatLive(), fix it. Signed-off-by: Zheng Chuan --- src/qemu/qemu_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 53980d4..b145318 100644 ---

[PATCH] qemuProcessReconnect: fix possible use after free for xmlopt

2020-07-28 Thread Chuan Zheng
From: Zheng Chuan In a case that libvirtd is killed when it has just started, the qemu_driver->xmlopt is freed in the main thread while qemuProcessReconnect still visits it, which resulting in null pointer accesses. Fix that by adding refcount of qemu_driver->xmlopt at the begining of

[PATCH] migration: fix xml file residual during vm crash with migration

2020-07-27 Thread Chuan Zheng
From: Zheng Chuan when migration is cancelled (such as kill -9 vmpid in Src, etc), it could do virDomainSaveStatus() to save xml file after qemuProcessStop(), which results in xml residulal. Fix it by that do not do virDomainSaveStatus() if vm is not active. Signed-off-by: Zheng Chuan ---