]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/extra/0005-IDE-Do-not-flush-empty-CDROM-drives.patch
bump version to 2.9.1-9
[pve-qemu.git] / debian / patches / extra / 0005-IDE-Do-not-flush-empty-CDROM-drives.patch
CommitLineData
3dcc8d3b 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
ddbcf45e
WB
2From: Stefan Hajnoczi <stefanha@redhat.com>
3Date: Wed, 9 Aug 2017 17:02:11 +0100
3dcc8d3b 4Subject: [PATCH] IDE: Do not flush empty CDROM drives
ddbcf45e
WB
5
6The block backend changed in a way that flushing empty CDROM drives now
7crashes. Amend IDE to avoid doing so until the root problem can be
8addressed for 2.11.
9
10Original patch by John Snow <jsnow@redhat.com>.
11
12Reported-by: Kieron Shorrock <kshorrock@paloaltonetworks.com>
13Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
14Reviewed-by: Eric Blake <eblake@redhat.com>
15Message-id: 20170809160212.29976-2-stefanha@redhat.com
16Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
17---
18 hw/ide/core.c | 10 +++++++++-
19 1 file changed, 9 insertions(+), 1 deletion(-)
20
21diff --git a/hw/ide/core.c b/hw/ide/core.c
22index 0b48b64d3a..bea39536b0 100644
23--- a/hw/ide/core.c
24+++ b/hw/ide/core.c
25@@ -1063,7 +1063,15 @@ static void ide_flush_cache(IDEState *s)
26 s->status |= BUSY_STAT;
27 ide_set_retry(s);
28 block_acct_start(blk_get_stats(s->blk), &s->acct, 0, BLOCK_ACCT_FLUSH);
29- s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s);
30+
31+ if (blk_bs(s->blk)) {
32+ s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s);
33+ } else {
34+ /* XXX blk_aio_flush() crashes when blk_bs(blk) is NULL, remove this
35+ * temporary workaround when blk_aio_*() functions handle NULL blk_bs.
36+ */
37+ ide_flush_cb(s, 0);
38+ }
39 }
40
41 static void ide_cfata_metadata_inquiry(IDEState *s)
42--
432.11.0
44