From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: John Snow <jsnow@redhat.com>,
mark.kanda@oracle.com, Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH v2 0/4] block: fix blk_aio_*() segfault when blk->root == NULL
Date: Tue, 13 Feb 2018 14:20:58 +0000 [thread overview]
Message-ID: <20180213142102.14450-1-stefanha@redhat.com> (raw)
v2:
* Introduce AIO_WAIT_WHILE() since aio_poll(ctx, true) is not allowed [Paolo]
Using bdrv_inc_in_flight(blk_bs(blk)) doesn't work since BlockBackend->root may
be NULL.
This patch series solves the issue by adding an BlockBackend->in_flight counter
so requests can be tracked even when there is no BlockDriverState.
This should fix the IDE and virtio-blk segfaults that have been encountered
when there is no BlockDriverState.
The patch is based on work by Kevin Wolf.
Kevin Wolf (1):
block: test blk_aio_flush() with blk->root == NULL
Stefan Hajnoczi (3):
block: extract AIO_WAIT_WHILE() from BlockDriverState
block: add BlockBackend->in_flight counter
Revert "IDE: Do not flush empty CDROM drives"
tests/Makefile.include | 2 +
util/Makefile.objs | 2 +-
include/block/aio-wait.h | 116 +++++++++++++++++++++++++++++++++++++++++++++
include/block/block.h | 40 +++-------------
include/block/block_int.h | 7 ++-
block.c | 7 ++-
block/block-backend.c | 60 ++++++++++++++++++++---
block/io.c | 10 +---
hw/ide/core.c | 10 +---
tests/test-block-backend.c | 82 ++++++++++++++++++++++++++++++++
util/aio-wait.c | 40 ++++++++++++++++
11 files changed, 313 insertions(+), 63 deletions(-)
create mode 100644 include/block/aio-wait.h
create mode 100644 tests/test-block-backend.c
create mode 100644 util/aio-wait.c
--
2.14.3
next reply other threads:[~2018-02-13 14:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 14:20 Stefan Hajnoczi [this message]
2018-02-13 14:20 ` [Qemu-devel] [PATCH v2 1/4] block: extract AIO_WAIT_WHILE() from BlockDriverState Stefan Hajnoczi
2018-02-13 16:01 ` Eric Blake
2018-02-14 14:06 ` Stefan Hajnoczi
2018-02-14 22:31 ` Eric Blake
2018-02-15 9:27 ` Stefan Hajnoczi
2018-02-15 10:12 ` Kevin Wolf
2018-02-15 14:15 ` Eric Blake
2018-02-14 22:33 ` Eric Blake
2018-02-13 14:21 ` [Qemu-devel] [PATCH v2 2/4] block: add BlockBackend->in_flight counter Stefan Hajnoczi
2018-02-13 16:03 ` Eric Blake
2018-02-13 14:21 ` [Qemu-devel] [PATCH v2 3/4] block: test blk_aio_flush() with blk->root == NULL Stefan Hajnoczi
2018-02-13 14:21 ` [Qemu-devel] [PATCH v2 4/4] Revert "IDE: Do not flush empty CDROM drives" Stefan Hajnoczi
2018-02-15 9:28 ` [Qemu-devel] [PATCH v2 0/4] block: fix blk_aio_*() segfault when blk->root == NULL Stefan Hajnoczi
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=20180213142102.14450-1-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mark.kanda@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).