There is actually a file in /lib which can help achieve this. I used these commands:

# cp /lib/udev/rules.d/60-qemu-kvm.rules /etc/udev/rules.d/
# udevadm test $(udevadm info -q path -n /dev/kvm)

There is also a section in the postinst which references a nonexistent rules file, which be a failed attempt to do the same.




However after fixing that there is more to the story:

araminta:/var/lib/libvirt/images# ls -l
total 60717828
-rw-rw---- 1 root kvm 17196646400 Feb  6 21:25 deodand.img
-rw-rw---- 1 root kvm 17196646400 Feb  6 21:16 heceptor.img
-rw-rw---- 1 root kvm 16777216000 Feb  6 21:17 lancilark.img
-rw-rw---- 1 root kvm  4194304000 Feb  6 21:17 leucomorph.img
-rw-rw---- 1 root kvm  1902250765 Feb  1 20:32 sandestin-backup.img.gz
-rw-rw---- 1 root kvm  4194304000 Feb  6 21:17 sandestin.img
-rw-rw---- 1 root kvm 20971520000 Aug 28 12:49 shulk.img
-rw-rw---- 1 root kvm 16777216000 Feb  6 21:13 tsais.img
araminta:/var/lib/libvirt/images# /etc/init.d/libvirt-bin restart
Restarting libvirt management daemon: /usr/sbin/libvirtd.
araminta:/var/lib/libvirt/images# tail /var/log/libvirt/qemu/deodand.log
[...]
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name deodand -uuid bff8ab0a-6c05-4b8b-946b-8b452018b8e3 -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/deodand.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive file=/var/lib/libvirt/images/deodand.img,if=none,id=drive-ide0-0-0,boot=on,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=/var/www/software/linux/ubuntu-10.04-alternate-amd64.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -device virtio-net-pci,vlan=0,id=net0,mac=54:52:00:42:60:3c,bus=pci.0,addr=0x3 -net tap,fd=40,vlan=0,name=hostnet0 -usb -vnc 0.0.0.0:0 -k en-gb -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 qemu: could not open disk image /var/lib/libvirt/images/deodand.img: Permission denied
araminta:/var/lib/libvirt/images# ls -l
total 60717828
-rw-rw---- 1 root root 17196646400 Feb  6 21:25 deodand.img
-rw-rw---- 1 root root 17196646400 Feb  6 21:16 heceptor.img
-rw-rw---- 1 root root 16777216000 Feb  6 21:17 lancilark.img
-rw-rw---- 1 root root  4194304000 Feb  6 21:17 leucomorph.img
-rw-rw---- 1 root kvm   1902250765 Feb  1 20:32 sandestin-backup.img.gz
-rw-rw---- 1 root root  4194304000 Feb  6 21:17 sandestin.img
-rw-rw---- 1 root kvm  20971520000 Aug 28 12:49 shulk.img
-rw-rw---- 1 root root 16777216000 Feb  6 21:13 tsais.img

i.e. something is chgrping the image files back to root.

That's probably a separate bug.

ttfn/rjk



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to