qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 2/2] qcow2: lock on prealloc
@ 2012-05-07  8:51 zwu.kernel
  2012-05-07 14:54 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: zwu.kernel @ 2012-05-07  8:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, Zhi Yong Wu, stefanha

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

preallocate() will be locked.

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] 2+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/2] qcow2: lock on prealloc
  2012-05-07  8:51 [Qemu-devel] [PATCH v2 2/2] qcow2: lock on prealloc zwu.kernel
@ 2012-05-07 14:54 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2012-05-07 14:54 UTC (permalink / raw)
  To: zwu.kernel; +Cc: Zhi Yong Wu, qemu-devel, stefanha

Am 07.05.2012 10:51, schrieb zwu.kernel@gmail.com:
> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
> 
> preallocate() will be locked.
> 
> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

Thanks, applied both to the block branch for 1.1.

Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-07 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07  8:51 [Qemu-devel] [PATCH v2 2/2] qcow2: lock on prealloc zwu.kernel
2012-05-07 14:54 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).