1 http://openwall.com/lists/oss-security/2017/08/21/2
2 https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg01850.html
4 The block backend changed in a way that flushing empty CDROM drives now
5 crashes. Amend IDE to avoid doing so until the root problem can be
8 Original patch by John Snow <address@hidden>.
10 Reported-by: Kieron Shorrock <address@hidden>
11 Signed-off-by: Stefan Hajnoczi <address@hidden>
13 hw/ide/core.c | 10 +++++++++-
14 1 file changed, 9 insertions(+), 1 deletion(-)
16 diff --git a/hw/ide/core.c b/hw/ide/core.c
17 index 0b48b64d3a..bea39536b0 100644
20 @@ -1063,7 +1063,15 @@ static void ide_flush_cache(IDEState *s)
21 s->status |= BUSY_STAT;
23 block_acct_start(blk_get_stats(s->blk), &s->acct, 0, BLOCK_ACCT_FLUSH);
24 - s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s);
26 + if (blk_bs(s->blk)) {
27 + s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s);
29 + /* XXX blk_aio_flush() crashes when blk_bs(blk) is NULL, remove this
30 + * temporary workaround when blk_aio_*() functions handle NULL blk_bs.
36 static void ide_cfata_metadata_inquiry(IDEState *s)