[libvirt] [PATCH] screenshot: Set access rights to temporary file

Daniel P. Berrange berrange at redhat.com
Wed Jun 29 09:39:38 UTC 2011


On Wed, Jun 29, 2011 at 10:23:38AM +0200, Michal Privoznik wrote:
> 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.

Hmm, why didn't QEMU return an error in the monitor in that case ?
Sounds like a BZ needs to be filed against QEMU

> ---
>  src/qemu/qemu_driver.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 8b65c26..562ec42 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);

ACK

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list