diff options
Diffstat (limited to 'fsdev/qemu-fsdev.c')
-rw-r--r-- | fsdev/qemu-fsdev.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c index 5977bcca4c..7fd2aa7793 100644 --- a/fsdev/qemu-fsdev.c +++ b/fsdev/qemu-fsdev.c @@ -24,6 +24,7 @@ static QTAILQ_HEAD(FsDriverEntry_head, FsDriverListEntry) fsdriver_entries = static FsDriverTable FsDrivers[] = { { .name = "local", .ops = &local_ops}, { .name = "handle", .ops = &handle_ops}, + { .name = "synth", .ops = &synth_ops}, }; int qemu_fsdev_add(QemuOpts *opts) @@ -35,7 +36,7 @@ int qemu_fsdev_add(QemuOpts *opts) const char *path = qemu_opt_get(opts, "path"); const char *sec_model = qemu_opt_get(opts, "security_model"); const char *writeout = qemu_opt_get(opts, "writeout"); - + bool ro = qemu_opt_get_bool(opts, "readonly", 0); if (!fsdev_id) { fprintf(stderr, "fsdev: No id specified\n"); @@ -86,6 +87,11 @@ int qemu_fsdev_add(QemuOpts *opts) fsle->fse.export_flags |= V9FS_IMMEDIATE_WRITEOUT; } } + if (ro) { + fsle->fse.export_flags |= V9FS_RDONLY; + } else { + fsle->fse.export_flags &= ~V9FS_RDONLY; + } if (strcmp(fsdriver, "local")) { goto done; |