* Mon Feb 25 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-16.el8

- kvm-fdc-Revert-downstream-disablement-of-device-floppy.patch [bz#1664997]
- kvm-fdc-Restrict-floppy-controllers-to-RHEL-7-machine-ty.patch [bz#1664997]
- Resolves: bz#1664997
  (Restrict floppy device to RHEL-7 machine types)
This commit is contained in:
Danilo C. L. de Paula 2019-02-25 18:26:37 +00:00
parent 876f46e0cf
commit dd7d9e5a43
3 changed files with 107 additions and 1 deletions

View File

@ -0,0 +1,55 @@
From f869cc062302515f4d031305584386ead0d32714 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 21 Feb 2019 09:11:01 +0000
Subject: [PATCH 2/2] fdc: Restrict floppy controllers to RHEL-7 machine types
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190221091101.31999-3-armbru@redhat.com>
Patchwork-id: 84693
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH v2 2/2] fdc: Restrict floppy controllers to RHEL-7 machine types
Bugzilla: 1664997
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Make floppy controllers' realize() fail except with RHEL-7 machine
types. The "is a RHEL-7 machine type" test is a bit of a hack: it
looks for "-rhel7." in the machine type name.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/block/fdc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 6f19f12..9ece2db 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -42,6 +42,8 @@
#include "qemu/log.h"
#include "trace.h"
+#include "hw/boards.h"
+
/********************************************************/
/* debug Floppy devices */
@@ -2629,6 +2631,14 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
int i, j;
static int command_tables_inited = 0;
+ /* Restricted for Red Hat Enterprise Linux: */
+ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
+ if (!strstr(mc->name, "-rhel7.")) {
+ error_setg(errp, "Device %s is not supported with machine type %s",
+ object_get_typename(OBJECT(dev)), mc->name);
+ return;
+ }
+
if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
}
--
1.8.3.1

View File

@ -0,0 +1,41 @@
From 20a51f6e5ebc56707554a52e2fb6a61bf6511315 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 21 Feb 2019 09:11:00 +0000
Subject: [PATCH 1/2] fdc: Revert downstream disablement of device "floppy"
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190221091101.31999-2-armbru@redhat.com>
Patchwork-id: 84691
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH v2 1/2] fdc: Revert downstream disablement of device "floppy"
Bugzilla: 1664997
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Board code creates floppy devices on behalf of -drive if=floppy,...
When they got qdevifified, they also became available with -device.
We made it unavailable downstream as per our policy to permit new
devices only when we have a use for them (commit 0533a6ee98f). We now
have a use: we need it to move from -drive to -blockdev.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/block/fdc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 56b7aeb..6f19f12 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -599,7 +599,6 @@ static void floppy_drive_class_init(ObjectClass *klass, void *data)
k->bus_type = TYPE_FLOPPY_BUS;
k->props = floppy_drive_properties;
k->desc = "virtual floppy drive";
- k->user_creatable = false; /* RH state preserve */
}
static const TypeInfo floppy_drive_info = {
--
1.8.3.1

View File

@ -68,7 +68,7 @@ Obsoletes: %1-rhev
Summary: QEMU is a machine emulator and virtualizer
Name: qemu-kvm
Version: 3.1.0
Release: 15%{?dist}
Release: 16%{?dist}
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
Epoch: 15
License: GPLv2 and GPLv2+ and CC-BY
@ -202,6 +202,10 @@ Patch57: kvm-scsi-disk-Acquire-the-AioContext-in-scsi_-_realize.patch
Patch58: kvm-virtio-scsi-Forbid-devices-with-different-iothreads-.patch
# For bz#1644985 - The "fsfreeze-hook" script path shown by command "qemu-ga --help" or "man qemu-ga" is wrong - Fast Train
Patch59: kvm-doc-fix-the-configuration-path.patch
# For bz#1664997 - Restrict floppy device to RHEL-7 machine types
Patch60: kvm-fdc-Revert-downstream-disablement-of-device-floppy.patch
# For bz#1664997 - Restrict floppy device to RHEL-7 machine types
Patch61: kvm-fdc-Restrict-floppy-controllers-to-RHEL-7-machine-ty.patch
BuildRequires: zlib-devel
BuildRequires: glib2-devel
@ -1094,6 +1098,12 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%changelog
* Mon Feb 25 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-16.el8
- kvm-fdc-Revert-downstream-disablement-of-device-floppy.patch [bz#1664997]
- kvm-fdc-Restrict-floppy-controllers-to-RHEL-7-machine-ty.patch [bz#1664997]
- Resolves: bz#1664997
(Restrict floppy device to RHEL-7 machine types)
* Wed Feb 13 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-15.el8
- kvm-Add-raw-qcow2-nbd-and-luks-iotests-to-run-during-the.patch [bz#1664855]
- kvm-Introduce-the-qemu-kvm-tests-rpm.patch [bz#1669924]