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-05-24 15:10:56 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-09-22 21:38:52 +0530
commit02cb7f3a256517cbf3136caff2863fbafc57b540 (patch)
tree1d741e85dfe584b35a4a5e69a086d7b19fafd0ad /hw/9pfs/virtio-9p-device.c
parent70c18fc08bcc9e9bbd8c00ca5e694e07890687e5 (diff)
hw/9pfs: Use read-write lock for protecting fid path.
On rename we take the write lock and this ensure path doesn't change as we operate on them. 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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 97f2da5f0e..eea70cb1f3 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -131,6 +131,7 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf)
s->tag_len;
s->vdev.get_config = virtio_9p_get_config;
s->fid_list = NULL;
+ qemu_co_rwlock_init(&s->rename_lock);
if (v9fs_init_worker_threads() < 0) {
fprintf(stderr, "worker thread initialization failed\n");