virtio-9p: Create a syntactic shortcut for the file-system pass-thru

Currently the commandline to create a virtual-filesystem pass-through between
the guest and the host is as follows:
#qemu -fsdev fstype,id=ID,path=path/to/share \
      -device virtio-9p-pci,fsdev=ID,mount_tag=tag \

This patch provides a syntactic short-cut to achieve the same as follows:
#qemu -virtfs fstype,path=path/to/share,mount_tag=tag

This will be internally expanded as:
#qemu -fsdev fstype,id=tag,path=path/to/share, \
      -device virtio-9p-pci,fsdev=tag,mount_tag=tag \

Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Gautham R Shenoy 2010-04-29 17:45:03 +05:30 committed by Anthony Liguori
parent 9c5e9d8970
commit 3d54abc7b7
4 changed files with 114 additions and 0 deletions

View file

@ -169,6 +169,28 @@ QemuOptsList qemu_fsdev_opts = {
};
#endif
#ifdef CONFIG_LINUX
QemuOptsList qemu_virtfs_opts = {
.name = "virtfs",
.implied_opt_name = "fstype",
.head = QTAILQ_HEAD_INITIALIZER(qemu_virtfs_opts.head),
.desc = {
{
.name = "fstype",
.type = QEMU_OPT_STRING,
}, {
.name = "path",
.type = QEMU_OPT_STRING,
}, {
.name = "mount_tag",
.type = QEMU_OPT_STRING,
},
{ /*End of list */ }
},
};
#endif
QemuOptsList qemu_device_opts = {
.name = "device",
.implied_opt_name = "driver",