Hi, there is the patchfile.
Regards Sascha
From aa21b1603562dd765c1d149600902fe63e8212b2 Mon Sep 17 00:00:00 2001 From: Sascha Girrulat <[email protected]> Date: Thu, 4 Apr 2019 14:08:57 +0200 Subject: [PATCH 1/2] Add upstream patch to fixup the empty cdrom handling with e.g. cloudstack This patch is exported from upstream. To apply this patch needed to change some lines around 568 to support the current debian version of the qemu source. --- ...cache-options-for-empty-CDROM-drives.patch | 89 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 90 insertions(+) create mode 100644 debian/patches/blockdev-ignore-cache-options-for-empty-CDROM-drives.patch diff --git a/debian/patches/blockdev-ignore-cache-options-for-empty-CDROM-drives.patch b/debian/patches/blockdev-ignore-cache-options-for-empty-CDROM-drives.patch new file mode 100644 index 0000000000..2957051d90 --- /dev/null +++ b/debian/patches/blockdev-ignore-cache-options-for-empty-CDROM-drives.patch @@ -0,0 +1,89 @@ +From: John Snow <[email protected]> +Date: Fri, 16 Sep 2016 22:06:28 +0200 +Subject: blockdev: ignore cache options for empty CDROM drives + +RH-Author: John Snow <[email protected]> +Message-id: <[email protected]> +Patchwork-id: 72377 +O-Subject: [RHEV-7.3 qemu-kvm-rhev PATCH 1/1] blockdev: ignore cache options for empty CDROM drives +Bugzilla: 1342999 +RH-Acked-by: Max Reitz <[email protected]> +RH-Acked-by: Kevin Wolf <[email protected]> +RH-Acked-by: Stefan Hajnoczi <[email protected]> + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1342999 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=11768839 +Upstream: N/A + +In qemu-kvm-rhev-2.3.0, QEMU will accept cache options for empty CDROM +devices, but silently ignore them as they will be overwritten when the +next CDROM is inserted. + +Libvirt and VMM are capable of generating XML configurations which +attempt to specify these cache options to QEMU, though they don't have +any effect. + +Upstream, a refactoring of cache option mechanisms means that we have +started rejecting invalid configurations where cache options are supplied +without any target to actually apply them to. + +This means that there are combinations of QEMU and libvirt that will fail +to start a VM if a user selects a cache option. + +This patch is a downstream-only workaround until libvirt can stop +supplying cache settings for empty CDROMs and/or until libvirt can take +advantage of the new QMP tray/medium manipulation mechanisms that will +allow proper cache specification for removable media. + +Signed-off-by: John Snow <[email protected]> +Signed-off-by: Miroslav Rezanina <[email protected]> +--- + blockdev.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +diff --git a/blockdev.c b/blockdev.c +index 81f95d9..200aae3 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -461,6 +461,32 @@ static void extract_common_blockdev_options(QemuOpts *opts, int *bdrv_flags, + } + } + ++/** ++ * libvirt expects to be able to pass cache options for CDROM drives without ++ * inserted media. Historically, QEMU eventually ignores these cache options as ++ * they are lost when media is inserted. Recently, QEMU started rejecting these ++ * configurations. Libvirt however still generates such configurations. ++ * ++ * To prevent QEMU from being unable to start, pretend there are no options ++ * present if the only options present are cache options for the BDS. ++ */ ++static bool __redhat_com_has_bs_opts(QDict *bs_opts) ++{ ++ size_t n, s; ++ s = qdict_size(bs_opts); ++ ++ if (s == 0) { ++ return false; ++ } else if (s > 2) { ++ return true; ++ } ++ ++ n = qdict_haskey(bs_opts, BDRV_OPT_CACHE_DIRECT); ++ n += qdict_haskey(bs_opts, BDRV_OPT_CACHE_NO_FLUSH); ++ ++ return s != n; ++} ++ + /* Takes the ownership of bs_opts */ + static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, + Error **errp) +@@ -568,7 +594,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, + read_only = qemu_opt_get_bool(opts, BDRV_OPT_READ_ONLY, false); + + /* init */ +- if ((!file || !*file) && !qdict_size(bs_opts)) { ++ if ((!file || !*file) && !__redhat_com_has_bs_opts(bs_opts)) { + BlockBackendRootState *blk_rs; + + blk = blk_new(0, BLK_PERM_ALL); diff --git a/debian/patches/series b/debian/patches/series index e179f79b6d..3bf3893ad8 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -9,3 +9,4 @@ slirp-check-data-length-while-emulating-ident-function-CVE-2019-6778.patch i2c-ddc-fix-oob-read-CVE-2019-3812.patch slirp-check-sscanf-result-when-emulating-ident-CVE-2019-9824.patch device_tree-don-t-use-load_image-CVE-2018-20815.patch +blockdev-ignore-cache-options-for-empty-CDROM-drives.patch -- 2.20.1
signature.asc
Description: OpenPGP digital signature

