diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/fsdev/qemu-fsdev.c | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/fsdev/qemu-fsdev.c')
-rw-r--r-- | qemu/fsdev/qemu-fsdev.c | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/qemu/fsdev/qemu-fsdev.c b/qemu/fsdev/qemu-fsdev.c deleted file mode 100644 index bf7f0b07f..000000000 --- a/qemu/fsdev/qemu-fsdev.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Virtio 9p - * - * Copyright IBM, Corp. 2010 - * - * Authors: - * Gautham R Shenoy <ego@in.ibm.com> - * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. - * - */ -#include "qemu/osdep.h" -#include "qemu-fsdev.h" -#include "qemu/queue.h" -#include "qemu-common.h" -#include "qemu/config-file.h" -#include "qemu/error-report.h" - -static QTAILQ_HEAD(FsDriverEntry_head, FsDriverListEntry) fsdriver_entries = - QTAILQ_HEAD_INITIALIZER(fsdriver_entries); - -static FsDriverTable FsDrivers[] = { - { .name = "local", .ops = &local_ops}, -#ifdef CONFIG_OPEN_BY_HANDLE - { .name = "handle", .ops = &handle_ops}, -#endif - { .name = "synth", .ops = &synth_ops}, - { .name = "proxy", .ops = &proxy_ops}, -}; - -int qemu_fsdev_add(QemuOpts *opts) -{ - int i; - struct FsDriverListEntry *fsle; - const char *fsdev_id = qemu_opts_id(opts); - const char *fsdriver = qemu_opt_get(opts, "fsdriver"); - const char *writeout = qemu_opt_get(opts, "writeout"); - bool ro = qemu_opt_get_bool(opts, "readonly", 0); - - if (!fsdev_id) { - error_report("fsdev: No id specified"); - return -1; - } - - if (fsdriver) { - for (i = 0; i < ARRAY_SIZE(FsDrivers); i++) { - if (strcmp(FsDrivers[i].name, fsdriver) == 0) { - break; - } - } - - if (i == ARRAY_SIZE(FsDrivers)) { - error_report("fsdev: fsdriver %s not found", fsdriver); - return -1; - } - } else { - error_report("fsdev: No fsdriver specified"); - return -1; - } - - fsle = g_malloc0(sizeof(*fsle)); - fsle->fse.fsdev_id = g_strdup(fsdev_id); - fsle->fse.ops = FsDrivers[i].ops; - if (writeout) { - if (!strcmp(writeout, "immediate")) { - fsle->fse.export_flags |= V9FS_IMMEDIATE_WRITEOUT; - } - } - if (ro) { - fsle->fse.export_flags |= V9FS_RDONLY; - } else { - fsle->fse.export_flags &= ~V9FS_RDONLY; - } - - if (fsle->fse.ops->parse_opts) { - if (fsle->fse.ops->parse_opts(opts, &fsle->fse)) { - g_free(fsle->fse.fsdev_id); - g_free(fsle); - return -1; - } - } - - QTAILQ_INSERT_TAIL(&fsdriver_entries, fsle, next); - return 0; -} - -FsDriverEntry *get_fsdev_fsentry(char *id) -{ - if (id) { - struct FsDriverListEntry *fsle; - - QTAILQ_FOREACH(fsle, &fsdriver_entries, next) { - if (strcmp(fsle->fse.fsdev_id, id) == 0) { - return &fsle->fse; - } - } - } - return NULL; -} |