Bug 525305 - Save doesn't work when kvm guests runs unprivileged
Summary: Save doesn't work when kvm guests runs unprivileged
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2009-09-23 20:41 UTC by Daniel
Modified: 2010-03-16 17:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-11-26 15:16:03 UTC

Attachments (Terms of Use)

Description Daniel 2009-09-23 20:41:53 UTC
Description of problem:

As explained here: http://www.mail-archive.com/libvir-list@redhat.com/msg16458.html

We have the option to run qemu/kvm guests unprivileged since libvirt 0.7.0.
Everything seems to work fine except the save functionality (virsh save domain /tmp/domain.state)

In fact, there's no error when we try to save a guest, just the saved state file is almost empty and of course, unusable.

The reason seems to be that libvirt first
create the destination file to write the header and the XML definition.
The file is owned by root with 600 permission. Then, we ask qemu to
append the dump of the memory (via the migrate exec: call) to this file.
This part doesn't work because the qemu user cannot write to this file.
So we endup with a file which only contains the header and the XML, and
the guest is stoped :/

Version-Release number of selected component (if applicable):
libvirt 0.7.0 and 0.7.1
qemu-kvm 0.10.6

How reproducible:

Steps to Reproduce:
1. Configure /etc/libvirt/qemu.conf to run qemu guests under qemu account
2. Restart libvirt and start a domain (verify the the process is running as the qemu user or whatever you have configured)
3. Try to save this guest (with virsh save domain /tmp/domain.state for example)
4. look at the size of the saved file :/ You can try to restore it, but you already know how it'll end ;)
Actual results:
The state of the guest is not written to the file

Expected results:
The save function should work the same way it does when we run qemu as root

Additional info

Comment 1 Daniel Berrangé 2009-11-11 12:32:40 UTC
Fix posted upstream


Comment 2 Daniel Berrangé 2009-11-26 15:16:03 UTC
Fixed in 0.7.4 release

Note You need to log in before you can comment on or make changes to this bug.