=Comment: #0================================================= SANTWANA SAMANTRAY <santwana.samantray.com> - virsh save of the kvm guest hangs in Fedora12 rawhide. After this, virsh doesn't respond properly, and even restarting libvirtd doesn't help. Attachment: dmesg and strace of virsh save [root@mx3550 ~]# strace -o virsh_save -f virsh save rhel6 /home/latest_save -------HANGS HERE----------- uname -a :Linux mx3550.in.ibm.com 2.6.31.5-96.fc12.x86_64 #1 SMP Fri Oct 23 19:30:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux Below are the versions installed: [root@mx3550 ~]# rpm -qa|grep libvirt libvirt-client-0.7.1-13.fc12.x86_64 libvirt-debuginfo-0.7.1-13.fc12.x86_64 libvirt-devel-0.7.1-13.fc12.x86_64 libvirt-python-0.7.1-13.fc12.x86_64 libvirt-0.7.1-13.fc12.x86_64 [root@mx3550 ~]# rpm -qa|grep kvm qemu-kvm-0.11.0-9.fc12.x86_64 =Comment: #1================================================= ANOOP C. VIJAYAN <anoop.vijayan.com> - The save hangs because the qemu process is not able to write to the file which libvirtd created. This happens because qemu-kvm runs with uid of qemu user whereas libvirtd runs as a root user. Moreover libvirtd creates the save file with only owner (root) read & write permissions. [root@mx3550 ~]# tail /var/log/libvirt/qemu/rhel6.log LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/bin/qemu-kvm -S -M pc-0.11 -m 500 -smp 1 -name rhel6 -uuid 47b90387-e42a-d493-f037-0425f580cb9d -monitor unix:/var/lib/libvirt/qemu/rhel6.monitor,server,nowait -boot c -drive file=/var/lib/libvirt/images/rhel6.raw,if=ide,index=0,boot=on,format=raw -drive file=,if=ide,media=cdrom,index=2 -net nic,macaddr=52:54:00:39:3f:5c,vlan=0,name=nic.0 -net tap,fd=17,vlan=0,name=tap.0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 -vga cirrus char device redirected to /dev/pts/1 sh: /home/newguest: Permission denied <======= [root@mx3550 ~]# ls -l /home/newguest -rw------- 1 root root 1468 2009-11-03 15:59 /home/newguest [root@mx3550 ~]# ps -eaf|grep qemu qemu 4616 1 71 15:56 ? 00:00:28 /usr/bin/qemu-kvm -S -M pc-0.11 -m 500 -smp 1 -name rhel6 -uuid 47b90387-e42a-d493-f037-0425f580cb9d -monitor unix:/var/lib/libvirt/qemu/rhel6.monitor,server,nowait -boot c -drive file=/var/lib/libvirt/images/rhel6.raw,if=ide,index=0,boot=on,format=raw -drive file=,if=ide,media=cdrom,index=2 -net nic,macaddr=52:54:00:39:3f:5c,vlan=0,name=nic.0 -net tap,fd=17,vlan=0,name=tap.0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 -vga cirrus [root@mx3550 ~]# ps -eaf|grep libvirtd root 3800 1 0 15:32 ? 00:00:02 libvirtd --daemon file: libvirt-0.7.1/src/qemu_driver.c 3803 static int qemudDomainSave(virDomainPtr dom, 3804 const char *path) 3805 { ------cut----------- 3874 /* Write header to file, followed by XML */ 3875 if ((fd = open(path, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR)) < 0) { 3876 qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, 3877 _("failed to create '%s'"), path);
Created attachment 367283 [details] dmesg and strace of virsh save
Created attachment 367606 [details] fix_virsh_save.patch ------- Comment on attachment From anoop.vijayan.com 2009-11-05 07:47 EDT------- Attaching a patch which gives write permission for the qemu user on the save file. Santwana, please test it and update with the results.
------- Comment From santwana.samantray.com 2009-11-06 06:51 EDT------- Hello Anoop, I verified the issue, after the patch was applied. This patch solves the write permission for the qemu user while saving the guest, and the guest saves properly. The issue is now resolved. Thanks for the patch. Santwana
I have seen this problem, too. Are there any plans for when this patch will be included in the RPMs for Fedora 12? Thanks.
Created attachment 369012 [details] Fix save & restore with unprivileged guests, and SELinux When running qemu:///system instance, libvirtd runs as root, but QEMU may optionally be configured to run non-root. When then saving a guest to a state file, the file is initially created as root, and thus QEMU cannot write to it. It is also missing labelling required to allow access via SELinux. This patch fixes those issues. http://www.redhat.com/archives/libvir-list/2009-November/msg00376.html
*** Bug 529363 has been marked as a duplicate of this bug. ***
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle. Changing version to '12'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Sounds like we also need: http://www.redhat.com/archives/libvir-list/2009-November/msg00640.html
libvirt-0.7.1-16.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/libvirt-0.7.1-16.fc12
libvirt-0.7.1-16.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update libvirt'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/libvirt-0.7.1-16.fc12
libvirt-0.7.1-16.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
Created attachment 451893 [details] strace o/p ------- Comment (attachment only) From dipraksh.ibm.com 2010-10-06 09:20 EDT-------