From 2c74c2cb4bedddbfa67628fbd5f9273b4e0e9903 Mon Sep 17 00:00:00 2001 From: "M. Mohan Kumar" Date: Tue, 25 Oct 2011 12:10:39 +0530 Subject: hw/9pfs: Read-only support for 9p export A new fsdev parameter "readonly" is introduced to control accessing 9p export. "readonly" can be used to specify the access type. By default "rw" access is given to 9p export. Signed-off-by: M. Mohan Kumar Signed-off-by: Aneesh Kumar K.V --- qemu-options.hx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'qemu-options.hx') diff --git a/qemu-options.hx b/qemu-options.hx index 5d2a776..1baa381 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -528,12 +528,12 @@ DEFHEADING(File system options:) DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev, "-fsdev fsdriver,id=id,path=path,[security_model={mapped|passthrough|none}]\n" - " [,writeout=immediate]\n", + " [,writeout=immediate][,readonly]\n", QEMU_ARCH_ALL) STEXI -@item -fsdev @var{fsdriver},id=@var{id},path=@var{path},[security_model=@var{security_model}][,writeout=@var{writeout}] +@item -fsdev @var{fsdriver},id=@var{id},path=@var{path},[security_model=@var{security_model}][,writeout=@var{writeout}][,readonly] @findex -fsdev Define a new file system device. Valid options are: @table @option @@ -563,6 +563,9 @@ This is an optional argument. The only supported value is "immediate". This means that host page cache will be used to read and write data but write notification will be sent to the guest only when the data has been reported as written by the storage subsystem. +@item readonly +Enables exporting 9p share as a readonly mount for guests. By default +read-write access is given. @end table -fsdev option is used along with -device driver "virtio-9p-pci". @@ -583,12 +586,12 @@ DEFHEADING(Virtual File system pass-through options:) DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs, "-virtfs local,path=path,mount_tag=tag,security_model=[mapped|passthrough|none]\n" - " [,writeout=immediate]\n", + " [,writeout=immediate][,readonly]\n", QEMU_ARCH_ALL) STEXI -@item -virtfs @var{fsdriver},path=@var{path},mount_tag=@var{mount_tag},security_model=@var{security_model}[,writeout=@var{writeout}] +@item -virtfs @var{fsdriver},path=@var{path},mount_tag=@var{mount_tag},security_model=@var{security_model}[,writeout=@var{writeout}][,readonly] @findex -virtfs The general form of a Virtual File system pass-through options are: @@ -619,6 +622,9 @@ This is an optional argument. The only supported value is "immediate". This means that host page cache will be used to read and write data but write notification will be sent to the guest only when the data has been reported as written by the storage subsystem. +@item readonly +Enables exporting 9p share as a readonly mount for guests. By default +read-write access is given. @end table ETEXI -- cgit v1.1 From 9db221ae73a18e0bd2b1ee6c7dc1904ed06fb464 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Tue, 25 Oct 2011 12:10:40 +0530 Subject: hw/9pfs: Add synthetic file system support using 9p This patch create a synthetic file system with mount tag v_synth when -virtfs_synth command line option is specified in qemu. The synthetic file system can be mounted in guest using 9p using the below command line mount -t 9p -oversion=9p2000.L,trans=virtio v_synth Synthetic file system enabled different qemu subsystem to register callbacks for read and write events from guest. The subsystem can create directories and files in the synthetic file system as show in ex below qemu_v9fs_synth_mkdir(NULL, 0777, "test2", &node); qemu_v9fs_synth_add_file(node, 0777, "testfile", my_test_read, NULL, NULL); Signed-off-by: Aneesh Kumar K.V --- qemu-options.hx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qemu-options.hx') diff --git a/qemu-options.hx b/qemu-options.hx index 1baa381..8df6165 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -628,6 +628,15 @@ read-write access is given. @end table ETEXI +DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth, + "-virtfs_synth Create synthetic file system image\n", + QEMU_ARCH_ALL) +STEXI +@item -virtfs_synth +@findex -virtfs_synth +Create synthetic file system image +ETEXI + DEFHEADING() DEF("name", HAS_ARG, QEMU_OPTION_name, -- cgit v1.1