All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 2/2] qcow2: lock on prealloc
@ 2012-05-05  3:13 zwu.kernel
  0 siblings, 0 replies; only message in thread
From: zwu.kernel @ 2012-05-05  3:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, Zhi Yong Wu, marcandre.lureau, stefanha

From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
 block/qcow2.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index 8c60a6f..ee4678f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1192,7 +1192,10 @@ static int qcow2_create2(const char *filename, int64_t total_size,
 
     /* And if we're supposed to preallocate metadata, do that now */
     if (prealloc) {
+        BDRVQcowState *s = bs->opaque;
+        qemu_co_mutex_lock(&s->lock);
         ret = preallocate(bs);
+        qemu_co_mutex_unlock(&s->lock);
         if (ret < 0) {
             goto out;
         }
-- 
1.7.6

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-05  3:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-05  3:13 [Qemu-devel] [PATCH 2/2] qcow2: lock on prealloc zwu.kernel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.