From: Michal Privoznik Date: Wed, 29 Jun 2011 08:17:51 +0000 (+0200) Subject: screenshot: Set access rights to temporary file X-Git-Tag: v0.9.3-rc2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c72aecc5fcac98d61f8a94ff2ae1f40a149a5c4a;p=thirdparty%2Flibvirt.git screenshot: Set access rights to temporary file Although we create a temporary file, it is owned by root:root and have rights 0600. In case qemu does not run under root, it is unable to write to that file and thus we transfer 0B sized file. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8b65c2646f..562ec4205c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2729,6 +2729,8 @@ qemuDomainScreenshot(virDomainPtr dom, goto endjob; } + virSecurityManagerSetSavedStateLabel(qemu_driver->securityManager, vm, tmp); + qemuDomainObjEnterMonitor(vm); if (qemuMonitorScreendump(priv->mon, tmp) < 0) { qemuDomainObjExitMonitor(vm);