qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: Strange virtio regression on mainline and stable-0.10


From: Avi Kivity
Subject: [Qemu-devel] Re: Strange virtio regression on mainline and stable-0.10
Date: Tue, 05 May 2009 14:46:33 +0300
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

(re-added qemu-devel)

Kevin Wolf wrote:
Avi Kivity schrieb:
Running the Fedora 10 installer on a virtio disk on current master and on v0.10.3 will cause the installer to complain when mounting the freshly formatted filesystems.

Could be related to https://bugzilla.redhat.com/show_bug.cgi?id=498405


It appears to be the same.

I encountered IO errors with qcow2 and virtio this morning, so I already
wanted to start debugging it. Unfortunately, with current master extboot
seems to be broken for me and so I can't even boot with virtio. Have not
figured out yet what's going wrong here.

I'm using the installer so I don't depend on extboot. Of course the extboot issue needs to be fixed as well.

I don't understand it, as free_any_clusters() shouldn't be called while formatting. Any ideas?

free_any_clusters shouldn't be called at all without snapshots or
backing files.

qemu-img check notices refcount errors on my broken image though, so
this could still be the same.

data point: if I force writes to be serialized in block-qcow2.c, then everything works, and there are no calls to free_any_clusters(). It's likely that there is some lack of serialization in the allocation code, some write that is in flight does not update the global state, only acb-local state.

--
error compiling committee.c: too many arguments to function

diff --git a/block-qcow2.c b/block-qcow2.c
index c4cd38d..151e688 100644
--- a/block-qcow2.c
+++ b/block-qcow2.c
@@ -1443,6 +1443,9 @@ static BlockDriverAIOCB *qcow_aio_readv(BlockDriverState 
*bs,
     return &acb->common;
 }
 
+static int nb_writes;
+static BlockDriverAIOCB *pending_writes[300];
+
 static void qcow_aio_write_cb(void *opaque, int ret)
 {
     QCowAIOCB *acb = opaque;
@@ -1518,6 +1521,18 @@ done:
         qemu_vfree(acb->orig_buf);
     acb->common.cb(acb->common.opaque, ret);
     qemu_aio_release(acb);
+
+    {
+        int i;
+
+        for (i = 1; i < nb_writes; ++i) {
+            pending_writes[i - 1] = pending_writes[i];
+        }
+        --nb_writes;
+        if (nb_writes) {
+            qcow_aio_write_cb(pending_writes[0], 0);
+        }
+    }
 }
 
 static BlockDriverAIOCB *qcow_aio_writev(BlockDriverState *bs,
@@ -1535,7 +1550,12 @@ static BlockDriverAIOCB 
*qcow_aio_writev(BlockDriverState *bs,
     if (!acb)
         return NULL;
 
-    qcow_aio_write_cb(acb, 0);
+    pending_writes[nb_writes++] = acb;
+
+    if (nb_writes == 1) {
+        qcow_aio_write_cb(acb, 0);
+    }
+
     return &acb->common;
 }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]