相关疑难解决方法(0)

使用 libvirt/qemu 对直通 (9p) 文件系统进行读/写访问?

我最近开始尝试在最新版本的 KVM/QEMU/libvirt 中支持直通文件系统。使文件系统可用于读取访问“刚刚奏效”,但我对写入访问应该如何工作感到有些困惑。在客户机中挂载文件系统后:

# mount -t 9p -o trans=virtio /fs/data /mnt
Run Code Online (Sandbox Code Playgroud)

如果现有文件具有 mode ,我可以修改o+w

# cd /mnt/work
# ls -l foo
-rw-rw-rw-. 1 root root 17 Dec 20 11:16 foo
# cat foo
this is line one
# echo this is line two >> foo
# cat foo
this is line one
this is line two
Run Code Online (Sandbox Code Playgroud)

但是无论目录权限如何,我都无法创建新文件或目录:

# ls -ld /mnt/work
drwxrwxrwx. 2 root root 4096 Dec 20 11:16 /mnt/work
# cd /mnt/work
# …
Run Code Online (Sandbox Code Playgroud)

virtualization filesystems libvirt qemu 9p

17
推荐指数
1
解决办法
1万
查看次数

标签 统计

9p ×1

filesystems ×1

libvirt ×1

qemu ×1

virtualization ×1