>From 1a2ba0c1b58142a06602722c6bb0995ef6e8b347 Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: Fri, 20 May 2011 13:56:46 +0100 Subject: [PATCH] qemudDomainMemoryPeek: chown temporary file to qemu.qemu. Otherwise qemu is unable to write to it, with the error: libvir: QEMU error : internal error unable to execute QEMU command 'memsave': Could not open '/var/cache/libvirt/qemu/qemu.mem.RRNvLv' --- src/qemu/qemu_driver.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 44acc6a..08d2549 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5536,6 +5536,14 @@ qemudDomainMemoryPeek (virDomainPtr dom, goto endjob; } + if (qemu_driver->privileged && + chown(tmp, qemu_driver->user, qemu_driver->group) < 0) { + virReportSystemError(errno, + _("unable to set ownership on %s to %d:%d"), + tmp, qemu_driver->user, qemu_driver->group); + goto endjob; + } + priv = vm->privateData; qemuDomainObjEnterMonitor(vm); if (flags == VIR_MEMORY_VIRTUAL) { -- 1.7.5.1