Permalink
Browse files

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  <mountpint>

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 <aneesh.kumar@linux.vnet.ibm.com>
  • Loading branch information...
kvaneesh committed Oct 25, 2011
1 parent cc720dd commit 9db221ae73a18e0bd2b1ee6c7dc1904ed06fb464
Showing with 660 additions and 0 deletions.
  1. +1 −0 Makefile.objs
  2. +1 −0 fsdev/qemu-fsdev.c
  3. +1 −0 fsdev/qemu-fsdev.h
  4. +574 −0 hw/9pfs/virtio-9p-synth.c
  5. +50 −0 hw/9pfs/virtio-9p-synth.h
  6. +6 −0 hw/9pfs/virtio-9p.h
  7. +9 −0 qemu-options.hx
  8. +18 −0 vl.c
View
@@ -310,6 +310,7 @@ hw-obj-$(CONFIG_SOUND) += $(sound-obj-y)
9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-xattr-user.o virtio-9p-posix-acl.o
9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-coth.o cofs.o codir.o cofile.o
9pfs-nested-$(CONFIG_VIRTFS) += coxattr.o virtio-9p-handle.o
+9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-synth.o
hw-obj-$(CONFIG_REALLY_VIRTFS) += $(addprefix 9pfs/, $(9pfs-nested-y))
$(addprefix 9pfs/, $(9pfs-nested-y)): QEMU_CFLAGS+=$(GLIB_CFLAGS)
View
@@ -24,6 +24,7 @@ static QTAILQ_HEAD(FsDriverEntry_head, FsDriverListEntry) fsdriver_entries =
static FsDriverTable FsDrivers[] = {
{ .name = "local", .ops = &local_ops},
{ .name = "handle", .ops = &handle_ops},
+ { .name = "synth", .ops = &synth_ops},
};
int qemu_fsdev_add(QemuOpts *opts)
View
@@ -53,4 +53,5 @@ int qemu_fsdev_add(QemuOpts *opts);
FsDriverEntry *get_fsdev_fsentry(char *id);
extern FileOperations local_ops;
extern FileOperations handle_ops;
+extern FileOperations synth_ops;
#endif
Oops, something went wrong.

0 comments on commit 9db221a

Please sign in to comment.