Skip to contentSkip to conversation

Block patches

GIT PULL Applied Stefan Hajnoczi 2 participants 4 messages Mar 17, 2016 Block layer

lore
Share & tools
lore
#0 lore raw

The following changes since commit 8c4575472494a5dfedfe05e7b58ca9ce3872ad56:

Merge remote-tracking branch 'remotes/ehabkost/tags/machine-pull-request' into staging (2016-03-17 08:52:58 +0000)

are available in the git repository at:

git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 1f3ddfcb258e6e0562467a9644daad3f28597da8:

Revert "qed: Implement .bdrv_drain" (2016-03-17 09:50:14 +0000)

----------------------------------------------------------------

----------------------------------------------------------------

Matthew Fortune (1):
aio-posix: Change CONFIG_EPOLL to CONFIG_EPOLL_CREATE1

Stefan Hajnoczi (1):
Revert "qed: Implement .bdrv_drain"

 aio-posix.c |  6 +++---
 block/qed.c | 13 -------------
 2 files changed, 3 insertions(+), 16 deletions(-)
Signature · 1 line
2.5.0
#1 lore raw

[Qemu-devel] [PULL 2/2] Revert "qed: Implement .bdrv_drain"

This reverts commit df9a681dc9ad41c9cdeb9ecc5d060ba9abd27e01.

Note that commit df9a681dc9ad41c9cdeb9ecc5d060ba9abd27e01 included some unrelated hunks, possibly due to a merge failure or an overlooked squash. This only reverts the qed .bdrv_drain() implementation.

The qed .bdrv_drain() implementation is unsafe and can lead to a double request completion.

Paolo Bonzini reports:
"The problem is that bdrv_qed_drain calls qed_plug_allocating_write_reqs unconditionally, but this is not correct if an allocating write is queued. In this case, qed_unplug_allocating_write_reqs will restart the allocating write and possibly cause it to complete. The aiocb however is still in use for the L2/L1 table writes, and will then be completed again as soon as the table writes are stable."

For QEMU 2.6 we can simply revert this commit. A full solution for the qed need check timer may be added if the bdrv_drain() implementation is extended.

Message-id: [email protected]

---
 block/qed.c | 13 -------------
 1 file changed, 13 deletions(-)
block/qed.c +0 -13
index 8de7dd0..5a58856 100644
@@ -377,18 +377,6 @@ static void bdrv_qed_attach_aio_context(BlockDriverState *bs,
     }
 }
 
-static void bdrv_qed_drain(BlockDriverState *bs)
-{
-    BDRVQEDState *s = bs->opaque;
-
-    /* Cancel timer and start doing I/O that were meant to happen as if it
-     * fired, that way we get bdrv_drain() taking care of the ongoing requests
-     * correctly. */
-    qed_cancel_need_check_timer(s);
-    qed_plug_allocating_write_reqs(s);
-    bdrv_aio_flush(s->bs, qed_clear_need_check, s);
-}
-
 static int bdrv_qed_open(BlockDriverState *bs, QDict *options, int flags,
                          Error **errp)
 {
@@ -1694,7 +1682,6 @@ static BlockDriver bdrv_qed = {
     .bdrv_check               = bdrv_qed_check,
     .bdrv_detach_aio_context  = bdrv_qed_detach_aio_context,
     .bdrv_attach_aio_context  = bdrv_qed_attach_aio_context,
-    .bdrv_drain               = bdrv_qed_drain,
 };
 
 static void bdrv_qed_init(void)
Signature · 1 line
2.5.0
#2 lore raw

[Qemu-devel] [PULL 1/2] aio-posix: Change CONFIG_EPOLL to CONFIG_EPOLL_CREATE1

In reply to Stefan Hajnoczi

From: Matthew Fortune <[email protected]>

CONFIG_EPOLL was being used to guard epoll_create1 which results in build failures on CentOS 5.

Message-id: [email protected]

---
 aio-posix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
aio-posix.c +3 -3
index fa7f8ab..7fd565f 100644
@@ -18,7 +18,7 @@
 #include "block/block.h"
 #include "qemu/queue.h"
 #include "qemu/sockets.h"
-#ifdef CONFIG_EPOLL
+#ifdef CONFIG_EPOLL_CREATE1
 #include <sys/epoll.h>
 #endif
 
@@ -33,7 +33,7 @@ struct AioHandler
     QLIST_ENTRY(AioHandler) node;
 };
 
-#ifdef CONFIG_EPOLL
+#ifdef CONFIG_EPOLL_CREATE1
 
 /* The fd number threashold to switch to epoll */
 #define EPOLL_ENABLE_THRESHOLD 64
@@ -483,7 +483,7 @@ bool aio_poll(AioContext *ctx, bool blocking)
 
 void aio_context_setup(AioContext *ctx, Error **errp)
 {
-#ifdef CONFIG_EPOLL
+#ifdef CONFIG_EPOLL_CREATE1
     assert(!ctx->epollfd);
     ctx->epollfd = epoll_create1(EPOLL_CLOEXEC);
     if (ctx->epollfd == -1) {
Signature · 1 line
2.5.0
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 8 lines · Stefan Hajnoczi

The following changes since commit 8c4575472494a5dfedfe05e7b58ca9ce3872ad56:

Merge remote-tracking branch 'remotes/ehabkost/tags/machine-pull-request' into staging (2016-03-17 08:52:58 +0000)

are available in the git repository at:

git://github.com/stefanha/qemu.git tags/block-pull-request

Quoted 8 lines

for you to fetch changes up to 1f3ddfcb258e6e0562467a9644daad3f28597da8:

Revert "qed: Implement .bdrv_drain" (2016-03-17 09:50:14 +0000)

----------------------------------------------------------------

----------------------------------------------------------------

Applied, thanks.

-- PMM