Hi there.
My question is regarding virtfs/9p/v9fs [1], not sure what's the
appropiate name :)
Basically I have a KVM + libvirt server sharing a directory with a
guest in mapped mode.
It works fine, but the only issue is with the file permissions of the
files created by the guest inside the host:
-They are 0700 for dirs and 0400 for files
-The files belongs to the same user that runs the "qemu-system-x86_64"
process, which is "libvirt-qemu"
Questions:
1. There's a way to change the umask of this user (I'm almost sure
that I already tried this and it didn't worked) or to change any
setting to force the permissions to be wider?
2. It's acceptable to run the "qemu-system-x86_64" as root, and
switch
to "passthrough" mode?
Below some details of my environment.
==== Host ===
$ uname -r
3.12-1-amd64
$ cat /etc/issue
Debian GNU/Linux jessie/sid \n \l
$ sudo dpkg -l | grep libvirt
ii libvirt-bin 1.2.0-2
amd64 programs for the libvirt library
ii libvirt0 1.2.0-2
amd64 library for interfacing with different virtualization
systems
ii python-libvirt 1.2.0-2
amd64 libvirt Python bindings
$ ps ax | grep vm_name
23307 ? Sl 0:40 qemu-system-x86_64 -enable-kvm -name
vm_name -S -machine pc-1.1,accel=kvm,usb=off -cpu
core2duo,+lahf_lm,+pdcm,+xtpr,+cx16,+tm2,+est,+smx,+vmx,+ds_cpl,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds
-m 1024 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid
2387f160-ffa2-3463-1aa3-771594779df3 -nographic -no-user-config
-nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm_name.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
-no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-drive
file=/dev/vg/lv_vm_name,if=none,id=drive-virtio-disk0,format=raw,cache=none
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-fsdev local,security_model=mapped,id=fsdev-fs0,path=/srv/share
-device
virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=virtfs_share,bus=pci.0,addr=0x3
-netdev tap,fd=28,id=hostnet0,vhost=on,vhostfd=29 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:68:90:d8,bus=pci.0,addr=0x4
-chardev pty,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7
Guest XML snippet:
<filesystem type='mount' accessmode='mapped'>
<source dir='/srv/share/>
<target dir='virtfs_share'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x03'
function='0x0'/>
</filesystem>
Thanks.
Javier
[1]
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/filesystems/9p.txt