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.
This commit is contained in:
Michal Privoznik 2011-06-29 10:17:51 +02:00
parent 8cce5436dd
commit c72aecc5fc

View File

@ -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);