summaryrefslogtreecommitdiff
path: root/fsdev/qemu-fsdev.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-10-13 13:21:00 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-10-15 15:30:27 +0530
commitb97400caef60ccfb0bc81c59f8bd824c43a0d6c8 (patch)
tree22bf03bd2f95f8e01dc4312cd94c176cbc7ea0c3 /fsdev/qemu-fsdev.c
parentfbcbf101aa8c6f069f777960ee0b26a11fe3386f (diff)
downloadqemu-b97400caef60ccfb0bc81c59f8bd824c43a0d6c8.tar.gz
hw/9pfs: Use export flag for indicating security model
This helps to remove some of the structure members Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fsdev/qemu-fsdev.c')
-rw-r--r--fsdev/qemu-fsdev.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index fcec494cf6..ce920d665a 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -72,14 +72,29 @@ int qemu_fsdev_add(QemuOpts *opts)
fsle->fse.fsdev_id = g_strdup(fsdev_id);
fsle->fse.path = g_strdup(path);
- fsle->fse.security_model = g_strdup(sec_model);
fsle->fse.ops = FsDrivers[i].ops;
fsle->fse.export_flags = 0;
if (writeout) {
if (!strcmp(writeout, "immediate")) {
- fsle->fse.export_flags = V9FS_IMMEDIATE_WRITEOUT;
+ fsle->fse.export_flags |= V9FS_IMMEDIATE_WRITEOUT;
}
}
+
+ if (!strcmp(sec_model, "passthrough")) {
+ fsle->fse.export_flags |= V9FS_SM_PASSTHROUGH;
+ } else if (!strcmp(sec_model, "mapped")) {
+ fsle->fse.export_flags |= V9FS_SM_MAPPED;
+ } else if (!strcmp(sec_model, "none")) {
+ fsle->fse.export_flags |= V9FS_SM_NONE;
+ } else {
+ fprintf(stderr, "Default to security_model=none. You may want"
+ " enable advanced security model using "
+ "security option:\n\t security_model=passthrough\n\t "
+ "security_model=mapped\n");
+
+ fsle->fse.export_flags |= V9FS_SM_NONE;
+ }
+
QTAILQ_INSERT_TAIL(&fsdriver_entries, fsle, next);
return 0;
}