Skip to contentSkip to conversation

Block patches

GIT PULL Applied Stefan Hajnoczi 2 participants 4 messages Oct 25, 2019 – Oct 26, 2019

lore
Share & tools
lore
#0 lore raw

The following changes since commit 58560ad254fbda71d4daa6622d71683190070ee2:

Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.2-20191024' into staging (2019-10-24 16:22:58 +0100)

are available in the Git repository at:

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

for you to fetch changes up to d154ef37ff885918fa3e512fd7a8e42870291667:

yield_until_fd_readable: make it work with any AioContect (2019-10-25 14:38:29 +0200)

----------------------------------------------------------------
Pull request

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

Dietmar Maurer (1):
yield_until_fd_readable: make it work with any AioContect

Julia Suvorova (1):
virtio-blk: Add blk_drain() to virtio_blk_device_unrealize()

 hw/block/virtio-blk.c    | 1 +
 util/qemu-coroutine-io.c | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

[PULL 2/2] yield_until_fd_readable: make it work with any AioContect

From: Dietmar Maurer <[email protected]>

Simply use qemu_get_current_aio_context().

Message-Id: <[email protected]>

---
 util/qemu-coroutine-io.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
util/qemu-coroutine-io.c +5 -2
index 44a8969a69..5b80bb416f 100644
@@ -67,6 +67,7 @@ qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send)
 }
 
 typedef struct {
+    AioContext *ctx;
     Coroutine *co;
     int fd;
 } FDYieldUntilData;
@@ -74,7 +75,7 @@ typedef struct {
 static void fd_coroutine_enter(void *opaque)
 {
     FDYieldUntilData *data = opaque;
-    qemu_set_fd_handler(data->fd, NULL, NULL, NULL);
+    aio_set_fd_handler(data->ctx, data->fd, false, NULL, NULL, NULL, NULL);
     qemu_coroutine_enter(data->co);
 }
 
@@ -83,8 +84,10 @@ void coroutine_fn yield_until_fd_readable(int fd)
     FDYieldUntilData data;
 
     assert(qemu_in_coroutine());
+    data.ctx = qemu_get_current_aio_context();
     data.co = qemu_coroutine_self();
     data.fd = fd;
-    qemu_set_fd_handler(fd, fd_coroutine_enter, NULL, &data);
+    aio_set_fd_handler(
+        data.ctx, fd, false, fd_coroutine_enter, NULL, NULL, &data);
     qemu_coroutine_yield();
 }
Signature · 1 line
2.21.0
#2 lore raw

[PULL 1/2] virtio-blk: Add blk_drain() to virtio_blk_device_unrealize()

In reply to Stefan Hajnoczi

From: Julia Suvorova <[email protected]>

QEMU does not wait for completed I/O requests, assuming that the guest driver will reset the device before calling unrealize(). This does not happen on Windows, and QEMU crashes in virtio_notify(), getting the result of a completed I/O request on hot-unplugged device.

Message-Id: <[email protected]>

---
 hw/block/virtio-blk.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/virtio-blk.c +1 -0
index ed2ddebd2b..14e9f85b8b 100644
@@ -1207,6 +1207,7 @@ static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp)
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOBlock *s = VIRTIO_BLK(dev);
 
+    blk_drain(s->blk);
     virtio_blk_data_plane_destroy(s->dataplane);
     s->dataplane = NULL;
     qemu_del_vm_change_state_handler(s->change);
Signature · 1 line
2.21.0
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 16 lines · Stefan Hajnoczi

The following changes since commit 58560ad254fbda71d4daa6622d71683190070ee2:

Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.2-20191024' into staging (2019-10-24 16:22:58 +0100)

are available in the Git repository at:

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

for you to fetch changes up to d154ef37ff885918fa3e512fd7a8e42870291667:

yield_until_fd_readable: make it work with any AioContect (2019-10-25 14:38:29 +0200)

----------------------------------------------------------------
Pull request

Quoted 7 lines

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

Dietmar Maurer (1):
yield_until_fd_readable: make it work with any AioContect

Julia Suvorova (1):
virtio-blk: Add blk_drain() to virtio_blk_device_unrealize()

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.

-- PMM