All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Michael Niehren <902148@bugs.launchpad.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Bug 902148] Re: qemu-img V1.0 hangs on creating Image (0.15.1 runs)
Date: Mon, 19 Dec 2011 13:22:50 +0000	[thread overview]
Message-ID: <20111219132250.GA16661@stefanha-thinkpad.localdomain> (raw)
In-Reply-To: <20111219105225.29841.79608.malone@soybean.canonical.com>

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

  reply	other threads:[~2011-12-19 13:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 13:10 [Qemu-devel] [Bug 902148] [NEW] qemu-img V1.0 hangs on creating Image (0.15.1 runs) Michael Niehren
2011-12-12 10:09 ` Stefan Hajnoczi
2011-12-19 10:02 ` [Qemu-devel] [Bug 902148] " Michael Niehren
2011-12-19 10:31   ` Stefan Hajnoczi
2011-12-19 10:52 ` Michael Niehren
2011-12-19 13:22   ` Stefan Hajnoczi [this message]
2011-12-19 17:26 ` Michael Niehren
2011-12-20  8:04   ` Stefan Hajnoczi
2011-12-20 10:17 ` Michael Niehren
2011-12-20 10:25 ` Michael Niehren
2011-12-20 10:49   ` Stefan Hajnoczi
2011-12-20 11:53     ` Stefan Hajnoczi
2011-12-20 15:25 ` Michael Niehren
2011-12-20 16:49   ` Stefan Hajnoczi
2011-12-20 21:45     ` Stefan Hajnoczi
2012-01-09 11:25     ` Kevin Wolf
2012-01-09 13:00       ` Stefan Hajnoczi
2012-01-14 15:40         ` Zhi Yong Wu
2012-01-15 11:14           ` Stefan Hajnoczi
2012-01-16  2:44             ` Zhi Yong Wu
2011-12-20 16:51 ` Stefan Hajnoczi
2011-12-20 23:59 ` Michael Niehren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111219132250.GA16661@stefanha-thinkpad.localdomain \
    --to=stefanha@gmail.com \
    --cc=902148@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.