From 74db920c32cea5b52a91b81f2bfd467fc070e942 Mon Sep 17 00:00:00 2001 From: Gautham R Shenoy Date: Thu, 29 Apr 2010 17:44:43 +0530 Subject: virtio-9p: Create a commandline option -fsdev This patch creates a new command line option named -fsdev to hold any file system specific information. The option will currently hold the following attributes: -fsdev fstype id=id,path=path_to_share where fstype: Type of the file system. id: Identifier used to refer to this fsdev path: The path on the host that is identified by this fsdev. [aneesh.kumar@linux.vnet.ibm.com: Abstraction using FsContext] Signed-off-by: Gautham R Shenoy Signed-off-by: Aneesh Kumar K.V Signed-off-by: Anthony Liguori --- vl.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 53ea698..37f46b6 100644 --- a/vl.c +++ b/vl.c @@ -149,6 +149,9 @@ int main(int argc, char **argv) #include "qemu-option.h" #include "qemu-config.h" #include "qemu-objects.h" +#ifdef CONFIG_LINUX +#include "fsdev/qemu-fsdev.h" +#endif #include "disas.h" @@ -2310,6 +2313,16 @@ static int chardev_init_func(QemuOpts *opts, void *opaque) return 0; } +#ifdef CONFIG_LINUX +static int fsdev_init_func(QemuOpts *opts, void *opaque) +{ + int ret; + ret = qemu_fsdev_add(opts); + + return ret; +} +#endif + static int mon_init_func(QemuOpts *opts, void *opaque) { CharDriverState *chr; @@ -3081,6 +3094,15 @@ int main(int argc, char **argv, char **envp) exit(1); } break; +#ifdef CONFIG_LINUX + case QEMU_OPTION_fsdev: + opts = qemu_opts_parse(&qemu_fsdev_opts, optarg, 1); + if (!opts) { + fprintf(stderr, "parse error: %s\n", optarg); + exit(1); + } + break; +#endif case QEMU_OPTION_serial: add_device_config(DEV_SERIAL, optarg); default_serial = 0; @@ -3437,6 +3459,11 @@ int main(int argc, char **argv, char **envp) if (qemu_opts_foreach(&qemu_chardev_opts, chardev_init_func, NULL, 1) != 0) exit(1); +#ifdef CONFIG_LINUX + if (qemu_opts_foreach(&qemu_fsdev_opts, fsdev_init_func, NULL, 1) != 0) { + exit(1); + } +#endif #ifndef _WIN32 if (daemonize) { -- cgit v1.1