From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcdBK-0005VD-Lc for qemu-devel@nongnu.org; Mon, 19 Dec 2011 08:23:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RcdB7-0008A6-V9 for qemu-devel@nongnu.org; Mon, 19 Dec 2011 08:23:06 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:65272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcdB7-00089z-Nh for qemu-devel@nongnu.org; Mon, 19 Dec 2011 08:22:53 -0500 Received: by eekb45 with SMTP id b45so6098929eek.4 for ; Mon, 19 Dec 2011 05:22:52 -0800 (PST) Date: Mon, 19 Dec 2011 13:22:50 +0000 From: Stefan Hajnoczi Message-ID: <20111219132250.GA16661@stefanha-thinkpad.localdomain> References: <20111209131037.2413.97284.malonedeb@gac.canonical.com> <20111219105225.29841.79608.malone@soybean.canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111219105225.29841.79608.malone@soybean.canonical.com> Subject: Re: [Qemu-devel] [Bug 902148] Re: qemu-img V1.0 hangs on creating Image (0.15.1 runs) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Niehren <902148@bugs.launchpad.net> Cc: qemu-devel@nongnu.org On Mon, Dec 19, 2011 at 10:52:24AM -0000, Michael Niehren wrote: > Ok, sorry, here the output: > > Thread 1 (Thread 0x7f57507c2740 (LWP 27263)): > #0 0x00007f57507da952 in qemu_aio_wait () > #1 0x00007f57507dcf2d in bdrv_rw_co () > #2 0x00007f57507dd2c2 in bdrv_pread () > #3 0x00007f57507ed03a in qcow2_open () > #4 0x00007f57507dc281 in bdrv_open_common () > #5 0x00007f57507ddb73 in bdrv_open () > #6 0x00007f57507ecafa in qcow2_create2 () > #7 0x00007f57507ece58 in qcow2_create () > #8 0x00007f57507e12c1 in bdrv_img_create () > #9 0x00007f575080bfeb in img_create () > #10 0x00007f574f340c7d in __libc_start_main () from /lib64/libc.so.6 > #11 0x00007f57507d9359 in _start () > > I compiled the rpm's myself, so i am sure the only difference of both is the enable-debug Flag, same > source code. Here are my compile-flags on running configure: > > --disable-curses --disable-curl --audio-card-list=ac97 \ > --enable-kvm --enable-spice --enable-linux-aio \ > --enable-tcg-interpreter --enable-vnc-thread I cannot reproduce it here but is it possible for you to try this patch? diff --git a/block.c b/block.c index d015887..aae71c2 100644 --- a/block.c +++ b/block.c @@ -1042,6 +1042,8 @@ static void coroutine_fn bdrv_rw_co_entry(void *opaque) { RwCo *rwco = opaque; + printf("bdrv_rw_co_entry is_write %d sector_num %" PRId64 " nb_sectors %d =", + rwco->is_write, rwco->sector_num, rwco->nb_sectors); if (!rwco->is_write) { rwco->ret = bdrv_co_do_readv(rwco->bs, rwco->sector_num, rwco->nb_sectors, rwco->qiov); @@ -1049,6 +1051,8 @@ static void coroutine_fn bdrv_rw_co_entry(void *opaque) rwco->ret = bdrv_co_do_writev(rwco->bs, rwco->sector_num, rwco->nb_sectors, rwco->qiov); } + assert(rwco->ret != NOT_DONE); + printf("%d\n", rwco->ret); } /* @@ -1081,6 +1085,7 @@ static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t * co = qemu_coroutine_create(bdrv_rw_co_entry); qemu_coroutine_enter(co, &rwco); while (rwco.ret == NOT_DONE) { + printf("waiting for rwco.ret != NOT_DONE\n"); qemu_aio_wait(); } } Here is my sample output from a successful run of ./qemu-img create -f qcow2 test.img 10G: Formatting 'test.img', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 bdrv_rw_co_entry is_write 0 sector_num 0 nb_sectors 1 =waiting for rwco.ret != NOT_DONE waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 1 sector_num 0 nb_sectors 1 =waiting for rwco.ret != NOT_DONE waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 1 sector_num 128 nb_sectors 128 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 0 sector_num 0 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 0 sector_num 128 nb_sectors 128 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 0 sector_num 0 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 1 sector_num 256 nb_sectors 128 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 0 sector_num 128 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 1 sector_num 128 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 1 sector_num 256 nb_sectors 128 =waiting for rwco.ret != NOT_DONE waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 0 sector_num 384 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 1 sector_num 384 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 0 sector_num 0 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 1 sector_num 0 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 0 sector_num 0 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 bdrv_rw_co_entry is_write 1 sector_num 0 nb_sectors 1 =waiting for rwco.ret != NOT_DONE 0 s