diff options
author | Gautham R Shenoy <ego@in.ibm.com> | 2010-04-29 17:44:43 +0530 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-05-03 12:17:37 -0500 |
commit | 74db920c32cea5b52a91b81f2bfd467fc070e942 (patch) | |
tree | 5d24e75c376c281478fe4643e090e99eb044401d /vl.c | |
parent | a1c5975270f2335e1d7129c084a6e562d7b99bdd (diff) | |
download | hqemu-74db920c32cea5b52a91b81f2bfd467fc070e942.zip hqemu-74db920c32cea5b52a91b81f2bfd467fc070e942.tar.gz |
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 <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>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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) { |