aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/virtio-9p-device.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-12-14 13:48:59 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2012-01-04 19:51:28 +0530
commit99519f0a776797db8fbdbf828240333e5181a612 (patch)
tree60dea3adf91a2f3317ab05be685bcaee7b5c46fd /hw/9pfs/virtio-9p-device.c
parentf3c6a169a39d188e98c17a0a0ebfa7f85e5aafdd (diff)
hw/9pfs: Move opt validation to FsDriver callback
This remove all conditional code from common code path and make opt validation a FSDriver callback. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/virtio-9p-device.c')
-rw-r--r--hw/9pfs/virtio-9p-device.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index cd343e1d81..642d5e2c46 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -77,16 +77,19 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf)
exit(1);
}
- if (!fse->path || !conf->tag) {
- /* we haven't specified a mount_tag or the path */
- fprintf(stderr, "fsdev with id %s needs path "
- "and Virtio-9p device needs mount_tag arguments\n",
+ if (!conf->tag) {
+ /* we haven't specified a mount_tag */
+ fprintf(stderr, "fsdev with id %s needs mount_tag arguments\n",
conf->fsdev_id);
exit(1);
}
s->ctx.export_flags = fse->export_flags;
- s->ctx.fs_root = g_strdup(fse->path);
+ if (fse->path) {
+ s->ctx.fs_root = g_strdup(fse->path);
+ } else {
+ s->ctx.fs_root = NULL;
+ }
s->ctx.exops.get_st_gen = NULL;
if (fse->export_flags & V9FS_SM_PASSTHROUGH) {