From 02cb7f3a256517cbf3136caff2863fbafc57b540 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Tue, 24 May 2011 15:10:56 +0530 Subject: 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 --- hw/9pfs/virtio-9p-device.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/9pfs/virtio-9p-device.c') 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"); -- cgit v1.2.1