summaryrefslogtreecommitdiff
path: root/fsdev/qemu-fsdev.c
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2010-06-14 13:34:40 -0700
committerAnthony Liguori <aliguori@us.ibm.com>2010-06-22 15:15:30 -0500
commit9ce56db6f0de81fd81972029073ff8008830bc02 (patch)
treeb5dea604c05c2f06080ffbc9cc96385a337b093b /fsdev/qemu-fsdev.c
parentfac4f111476740f5bda988b320aa9037d6672a56 (diff)
downloadqemu-9ce56db6f0de81fd81972029073ff8008830bc02.tar.gz
qemu-9ce56db6f0de81fd81972029073ff8008830bc02.tar.bz2
qemu-9ce56db6f0de81fd81972029073ff8008830bc02.zip
virtio-9p: Introduces an option to specify the security model.
The new option is: -fsdev fstype,id=myid,path=/share_path/,security_model=[mapped|passthrough] -virtfs fstype,path=/share_path/,security_model=[mapped|passthrough],mnt_tag=tag In the case of mapped security model, files are created with QEMU user credentials and the client-user's credentials are saved in extended attributes. Whereas in the case of passthrough security model, files on the filesystem are directly created with client-user's credentials. Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'fsdev/qemu-fsdev.c')
-rw-r--r--fsdev/qemu-fsdev.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index 813e1f77a4..ad69b0ea4e 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -34,7 +34,7 @@ int qemu_fsdev_add(QemuOpts *opts)
return -1;
}
- for (i = 0; i < ARRAY_SIZE(FsTypes); i++) {
+ for (i = 0; i < ARRAY_SIZE(FsTypes); i++) {
if (strcmp(FsTypes[i].name, qemu_opt_get(opts, "fstype")) == 0) {
break;
}
@@ -46,10 +46,17 @@ int qemu_fsdev_add(QemuOpts *opts)
return -1;
}
+ if (qemu_opt_get(opts, "security_model") == NULL) {
+ fprintf(stderr, "fsdev: No security_model specified.\n");
+ return -1;
+ }
+
fsle = qemu_malloc(sizeof(*fsle));
fsle->fse.fsdev_id = qemu_strdup(qemu_opts_id(opts));
fsle->fse.path = qemu_strdup(qemu_opt_get(opts, "path"));
+ fsle->fse.security_model = qemu_strdup(qemu_opt_get(opts,
+ "security_model"));
fsle->fse.ops = FsTypes[i].ops;
QTAILQ_INSERT_TAIL(&fstype_entries, fsle, next);