[libvirt] [PATCH] qemu: driver: Unset log file watcher after restoring a VM save file

qemuProcessStart does not unset the infrastructure that retrieves errors from the qemu log file in case of migration. As this wasn't handled properly in qemuDomainSaveImageStartVM we kept the logging context/fd open for the lifetime of the VM rather than closing it after it's not needed. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325080 --- src/qemu/qemu_driver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 10d3e3d..4f09630 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6509,6 +6509,11 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, if (!restored) goto cleanup; + /* qemuProcessStart doesn't unsed the qemu error reporting infrastructure + * in case of migration (which is used in this case) so we need to reset it + * so that the handle to virtlogd is not held open unnecessarily */ + qemuMonitorSetDomainLog(qemuDomainGetMonitor(vm), NULL, NULL, NULL); + event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_RESTORED); -- 2.8.3

On 06/03/2016 11:30 AM, Peter Krempa wrote:
qemuProcessStart does not unset the infrastructure that retrieves errors from the qemu log file in case of migration. As this wasn't handled properly in qemuDomainSaveImageStartVM we kept the logging context/fd open for the lifetime of the VM rather than closing it after it's not needed.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325080 --- src/qemu/qemu_driver.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 10d3e3d..4f09630 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6509,6 +6509,11 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, if (!restored) goto cleanup;
+ /* qemuProcessStart doesn't unsed the qemu error reporting infrastructure
unset ACK - John
+ * in case of migration (which is used in this case) so we need to reset it + * so that the handle to virtlogd is not held open unnecessarily */ + qemuMonitorSetDomainLog(qemuDomainGetMonitor(vm), NULL, NULL, NULL); + event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_RESTORED);

On Tue, Jun 07, 2016 at 17:27:42 -0400, John Ferlan wrote:
On 06/03/2016 11:30 AM, Peter Krempa wrote:
qemuProcessStart does not unset the infrastructure that retrieves errors from the qemu log file in case of migration. As this wasn't handled properly in qemuDomainSaveImageStartVM we kept the logging context/fd open for the lifetime of the VM rather than closing it after it's not needed.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325080 --- src/qemu/qemu_driver.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 10d3e3d..4f09630 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6509,6 +6509,11 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, if (!restored) goto cleanup;
+ /* qemuProcessStart doesn't unsed the qemu error reporting infrastructure
unset
ACK -
Fixed && pushed. Thanks
participants (2)
-
John Ferlan
-
Peter Krempa