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>
This commit is contained in:
Aneesh Kumar K.V 2011-05-24 15:10:56 +05:30
parent 70c18fc08b
commit 02cb7f3a25
8 changed files with 155 additions and 87 deletions

View file

@ -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");