On 11/12/2015 12:19 PM, Daniel P. Berrange wrote:
Convert the places which create/open log files to use the new
qemuDomainLogContextPtr object instead.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_domain.c | 100 +++++-------------------------------------------
src/qemu/qemu_domain.h | 2 -
src/qemu/qemu_process.c | 78 +++++++++++++++++--------------------
3 files changed, 46 insertions(+), 134 deletions(-)
[...]
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
[...]
@@ -4854,7 +4850,7 @@ int qemuProcessStart(virConnectPtr conn,
cleanup:
virCommandFree(cmd);
- VIR_FORCE_CLOSE(logfile);
+ qemuDomainLogContextFree(logCtxt);
virObjectUnref(cfg);
virObjectUnref(caps);
VIR_FREE(nicindexes);
@@ -4868,6 +4864,9 @@ int qemuProcessStart(virConnectPtr conn,
* pretend we never started it */
if (priv->mon)
qemuMonitorSetDomainLog(priv->mon, -1, -1);
+ /* Must close log now to allow ProcessSto to re-open it */
ProcessStop (almost not worth mentioning ;-))
+ qemuDomainLogContextFree(logCtxt);
+ logCtxt = NULL;
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, stop_flags);
goto cleanup;
[...]
ACK
John