* Tue Jun 11 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 4.0.0-4.el8

- kvm-Disable-VXHS-support.patch [bz#1714937]
- kvm-aarch64-Add-virt-rhel8.1.0-machine-type-for-ARM.patch [bz#1713735]
- kvm-aarch64-Allow-ARM-VIRT-iommu-option-in-RHEL8.1-machi.patch [bz#1713735]
- kvm-usb-call-reset-handler-before-updating-state.patch [bz#1713679]
- kvm-usb-host-skip-reset-for-untouched-devices.patch [bz#1713679]
- kvm-usb-host-avoid-libusb_set_configuration-calls.patch [bz#1713679]
- kvm-aarch64-Compile-out-IOH3420.patch [bz#1627283]
- kvm-vl-Fix-drive-blockdev-persistent-reservation-managem.patch [bz#1714891]
- kvm-vl-Document-why-objects-are-delayed.patch [bz#1714891]
- Resolves: bz#1627283
  (Compile out IOH3420 on aarch64)
- Resolves: bz#1713679
  (Detached device when trying to upgrade USB device firmware when in doing USB Passthrough via QEMU)
- Resolves: bz#1713735
  (Allow ARM VIRT iommu option in RHEL8.1 machine)
- Resolves: bz#1714891
  (Guest with persistent reservation manager for a disk fails to start)
- Resolves: bz#1714937
  (Disable VXHS support)
This commit is contained in:
Danilo C. L. de Paula 2019-06-11 22:15:20 +01:00
parent 115fdcbf37
commit 0544bace3c
10 changed files with 803 additions and 11 deletions

View File

@ -0,0 +1,293 @@
From 517e4a2f490ff56c8b3fbf9a56c8d4a6e167c2b6 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 29 May 2019 16:09:59 +0100
Subject: [PATCH 1/9] Disable VXHS support
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
Message-id: <1559146199-30110-1-git-send-email-mrezanin@redhat.com>
Patchwork-id: 88273
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH] Disable VXHS support
Bugzilla: 1714937
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
From: Miroslav Rezanina <mrezanin@redhat.com>
As we ended our partnership with Veritas, we do not support VXHS anymore.
Reverting our downstream changes included in "Initial redhat commit".
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
block/Makefile.objs | 2 +-
block/vxhs.c | 119 ++++--------------------------------------
configure | 33 ++++++++++--
redhat/qemu-kvm.spec.template | 11 +---
4 files changed, 41 insertions(+), 124 deletions(-)
diff --git a/block/Makefile.objs b/block/Makefile.objs
index f4cf03b..7a81892 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -30,7 +30,7 @@ block-obj-$(CONFIG_LIBNFS) += nfs.o
block-obj-$(CONFIG_CURL) += curl.o
block-obj-$(CONFIG_RBD) += rbd.o
block-obj-$(CONFIG_GLUSTERFS) += gluster.o
-#block-obj-$(CONFIG_VXHS) += vxhs.o
+block-obj-$(CONFIG_VXHS) += vxhs.o
block-obj-$(CONFIG_LIBSSH2) += ssh.o
block-obj-y += accounting.o dirty-bitmap.o
block-obj-y += write-threshold.o
diff --git a/block/vxhs.c b/block/vxhs.c
index 3dbb954..2e18229 100644
--- a/block/vxhs.c
+++ b/block/vxhs.c
@@ -9,8 +9,7 @@
*/
#include "qemu/osdep.h"
-#include "block/vxhs_shim.h"
-#include <gmodule.h>
+#include <qnio/qnio_api.h>
#include <sys/param.h>
#include "block/block_int.h"
#include "block/qdict.h"
@@ -60,97 +59,6 @@ typedef struct BDRVVXHSState {
char *tlscredsid; /* tlscredsid */
} BDRVVXHSState;
-#define LIBVXHS_FULL_PATHNAME "/usr/lib64/qemu/libvxhs.so.1"
-static bool libvxhs_loaded;
-static GModule *libvxhs_handle;
-
-static LibVXHSFuncs libvxhs;
-
-typedef struct LibVXHSSymbols {
- const char *name;
- gpointer *addr;
-} LibVXHSSymbols;
-
-static LibVXHSSymbols libvxhs_symbols[] = {
- {"iio_init", (gpointer *) &libvxhs.iio_init},
- {"iio_fini", (gpointer *) &libvxhs.iio_fini},
- {"iio_min_version", (gpointer *) &libvxhs.iio_min_version},
- {"iio_max_version", (gpointer *) &libvxhs.iio_max_version},
- {"iio_open", (gpointer *) &libvxhs.iio_open},
- {"iio_close", (gpointer *) &libvxhs.iio_close},
- {"iio_writev", (gpointer *) &libvxhs.iio_writev},
- {"iio_readv", (gpointer *) &libvxhs.iio_readv},
- {"iio_ioctl", (gpointer *) &libvxhs.iio_ioctl},
- {NULL}
-};
-
-static void bdrv_vxhs_set_funcs(GModule *handle, Error **errp)
-{
- int i = 0;
- while (libvxhs_symbols[i].name) {
- const char *name = libvxhs_symbols[i].name;
- if (!g_module_symbol(handle, name, libvxhs_symbols[i].addr)) {
- error_setg(errp, "%s could not be loaded from libvxhs: %s",
- name, g_module_error());
- return;
- }
- ++i;
- }
-}
-
-static void bdrv_vxhs_load_libs(Error **errp)
-{
- Error *local_err = NULL;
- int32_t ver;
-
- if (libvxhs_loaded) {
- return;
- }
-
- if (!g_module_supported()) {
- error_setg(errp, "modules are not supported on this platform: %s",
- g_module_error());
- return;
- }
-
- libvxhs_handle = g_module_open(LIBVXHS_FULL_PATHNAME,
- G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
- if (!libvxhs_handle) {
- error_setg(errp, "The VXHS library from Veritas might not be installed "
- "correctly (%s)", g_module_error());
- return;
- }
-
- g_module_make_resident(libvxhs_handle);
-
- bdrv_vxhs_set_funcs(libvxhs_handle, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
-
- /* Now check to see if the libvxhs we are using here is supported
- * by the loaded version */
-
- ver = (*libvxhs.iio_min_version)();
- if (ver > QNIO_VERSION) {
- error_setg(errp, "Trying to use libvxhs version %"PRId32" API, but "
- "only %"PRId32" or newer is supported by %s",
- QNIO_VERSION, ver, LIBVXHS_FULL_PATHNAME);
- return;
- }
-
- ver = (*libvxhs.iio_max_version)();
- if (ver < QNIO_VERSION) {
- error_setg(errp, "Trying to use libvxhs version %"PRId32" API, but "
- "only %"PRId32" or earlier is supported by %s",
- QNIO_VERSION, ver, LIBVXHS_FULL_PATHNAME);
- return;
- }
-
- libvxhs_loaded = true;
-}
-
static void vxhs_complete_aio_bh(void *opaque)
{
VXHSAIOCB *acb = opaque;
@@ -318,7 +226,7 @@ static void vxhs_refresh_limits(BlockDriverState *bs, Error **errp)
static int vxhs_init_and_ref(void)
{
if (vxhs_ref++ == 0) {
- if ((*libvxhs.iio_init)(QNIO_VERSION, vxhs_iio_callback)) {
+ if (iio_init(QNIO_VERSION, vxhs_iio_callback)) {
return -ENODEV;
}
}
@@ -328,7 +236,7 @@ static int vxhs_init_and_ref(void)
static void vxhs_unref(void)
{
if (--vxhs_ref == 0) {
- (*libvxhs.iio_fini)();
+ iio_fini();
}
}
@@ -398,17 +306,8 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
char *client_key = NULL;
char *client_cert = NULL;
- bdrv_vxhs_load_libs(&local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- /* on error, cannot cleanup because the iio_fini() function
- * is not loaded */
- return -EINVAL;
- }
-
ret = vxhs_init_and_ref();
if (ret < 0) {
- error_setg(&local_err, "libvxhs iio_init() failed");
ret = -EINVAL;
goto out;
}
@@ -493,8 +392,8 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
/*
* Open qnio channel to storage agent if not opened before
*/
- dev_handlep = (*libvxhs.iio_open)(of_vsa_addr, s->vdisk_guid, 0,
- cacert, client_key, client_cert);
+ dev_handlep = iio_open(of_vsa_addr, s->vdisk_guid, 0,
+ cacert, client_key, client_cert);
if (dev_handlep == NULL) {
trace_vxhs_open_iio_open(of_vsa_addr);
ret = -ENODEV;
@@ -554,11 +453,11 @@ static BlockAIOCB *vxhs_aio_rw(BlockDriverState *bs, uint64_t offset,
switch (iodir) {
case VDISK_AIO_WRITE:
- ret = (*libvxhs.iio_writev)(dev_handle, acb, qiov->iov, qiov->niov,
+ ret = iio_writev(dev_handle, acb, qiov->iov, qiov->niov,
offset, size, iio_flags);
break;
case VDISK_AIO_READ:
- ret = (*libvxhs.iio_writev)(dev_handle, acb, qiov->iov, qiov->niov,
+ ret = iio_readv(dev_handle, acb, qiov->iov, qiov->niov,
offset, size, iio_flags);
break;
default:
@@ -607,7 +506,7 @@ static void vxhs_close(BlockDriverState *bs)
* Close vDisk device
*/
if (s->vdisk_hostinfo.dev_handle) {
- (*libvxhs.iio_close)(s->vdisk_hostinfo.dev_handle);
+ iio_close(s->vdisk_hostinfo.dev_handle);
s->vdisk_hostinfo.dev_handle = NULL;
}
@@ -629,7 +528,7 @@ static int64_t vxhs_get_vdisk_stat(BDRVVXHSState *s)
int ret = 0;
void *dev_handle = s->vdisk_hostinfo.dev_handle;
- ret = (*libvxhs.iio_ioctl)(dev_handle, IOR_VDISK_STAT, &vdisk_size, 0);
+ ret = iio_ioctl(dev_handle, IOR_VDISK_STAT, &vdisk_size, 0);
if (ret < 0) {
trace_vxhs_get_vdisk_stat_err(s->vdisk_guid, ret, errno);
return -EIO;
diff --git a/configure b/configure
index d6d5912..8cb6740 100755
--- a/configure
+++ b/configure
@@ -3616,7 +3616,7 @@ fi
glib_req_ver=2.40
glib_modules=gthread-2.0
-if test "$modules" = yes -o "$vxhs" = yes; then
+if test "$modules" = yes; then
glib_modules="$glib_modules gmodule-export-2.0"
fi
@@ -5760,6 +5760,33 @@ if compile_prog "" "" ; then
fi
##########################################
+# Veritas HyperScale block driver VxHS
+# Check if libvxhs is installed
+
+if test "$vxhs" != "no" ; then
+ cat > $TMPC <<EOF
+#include <stdint.h>
+#include <qnio/qnio_api.h>
+
+void *vxhs_callback;
+
+int main(void) {
+ iio_init(QNIO_VERSION, vxhs_callback);
+ return 0;
+}
+EOF
+ vxhs_libs="-lvxhs -lssl"
+ if compile_prog "" "$vxhs_libs" ; then
+ vxhs=yes
+ else
+ if test "$vxhs" = "yes" ; then
+ feature_not_found "vxhs block device" "Install libvxhs See github"
+ fi
+ vxhs=no
+ fi
+fi
+
+##########################################
# check for _Static_assert()
have_static_assert=no
@@ -7195,8 +7222,8 @@ elif test "$pthread_setname_np_wo_tid" = "yes" ; then
fi
if test "$vxhs" = "yes" ; then
- echo "CONFIG_VXHS=m" >> $config_host_mak
- echo "VXHS_LIBS= -lssl" >> $config_host_mak
+ echo "CONFIG_VXHS=y" >> $config_host_mak
+ echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak
fi
if test "$libpmem" = "yes" ; then
--
1.8.3.1

View File

@ -0,0 +1,56 @@
From c3e39ef14e99f903b95fa051936f40ebd6c35484 Mon Sep 17 00:00:00 2001
From: Auger Eric <eric.auger@redhat.com>
Date: Mon, 3 Jun 2019 19:17:39 +0100
Subject: [PATCH 2/9] aarch64: Add virt-rhel8.1.0 machine type for ARM
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Auger Eric <eric.auger@redhat.com>
Message-id: <20190603191740.32665-2-eric.auger@redhat.com>
Patchwork-id: 88461
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH 1/2] aarch64: Add virt-rhel8.1.0 machine type for ARM
Bugzilla: 1713735
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This patch adds a new machine type, virt-rhel8.1.0, for QEMU rhel-av.
This machine type is based off 4.0 with the exception that it removes
support for dynamic sysbus devices: VFIO_CALXEDA_XGMAC, VFIO_AMD_XGBE, and
RAMFB_DEVICE because downstream RHEL doesn't support these devices. IOMMU
instantiation still is disabled but will be enabled in subsequent patches.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 5602d9f..9316a8d 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2158,7 +2158,7 @@ static void rhel_machine_init(void)
}
type_init(rhel_machine_init);
-static void rhel800_virt_instance_init(Object *obj)
+static void rhel810_virt_instance_init(Object *obj)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
@@ -2204,8 +2204,8 @@ static void rhel800_virt_instance_init(Object *obj)
vms->irqmap=a15irqmap;
}
-static void rhel800_virt_options(MachineClass *mc)
+static void rhel810_virt_options(MachineClass *mc)
{
compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
}
-DEFINE_RHEL_MACHINE_AS_LATEST(8, 0, 0)
+DEFINE_RHEL_MACHINE_AS_LATEST(8, 1, 0)
--
1.8.3.1

View File

@ -0,0 +1,66 @@
From 59a46d11cad715b082d30c0de33317466a9bab9e Mon Sep 17 00:00:00 2001
From: Auger Eric <eric.auger@redhat.com>
Date: Mon, 3 Jun 2019 19:17:40 +0100
Subject: [PATCH 3/9] aarch64: Allow ARM VIRT iommu option in RHEL8.1 machine
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Auger Eric <eric.auger@redhat.com>
Message-id: <20190603191740.32665-3-eric.auger@redhat.com>
Patchwork-id: 88460
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH 2/2] aarch64: Allow ARM VIRT iommu option in RHEL8.1 machine
Bugzilla: 1713735
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This patch restores the ARM VIRT iommu option historically
introduced in qemu 3.0 and disabled in rhel8.0 (RHBZ#1656504 /
commit 7bfdb4cd2b49) as we did not have support of the feature
at libvirt level.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9316a8d..670fa10 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1785,7 +1785,6 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp)
}
}
-#if 0 /* Disabled for Red Hat Enterprise Linux */
static char *virt_get_iommu(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -1813,7 +1812,6 @@ static void virt_set_iommu(Object *obj, const char *value, Error **errp)
error_append_hint(errp, "Valid values are none, smmuv3.\n");
}
}
-#endif /* disabled for RHEL */
static CpuInstanceProperties
virt_cpu_index_to_props(MachineState *ms, unsigned cpu_index)
@@ -2198,8 +2196,13 @@ static void rhel810_virt_instance_init(Object *obj)
NULL);
}
- /* IOMMU is disabled by default and non-configurable for RHEL */
+ /* Default disallows iommu instantiation */
vms->iommu = VIRT_IOMMU_NONE;
+ object_property_add_str(obj, "iommu", virt_get_iommu, virt_set_iommu, NULL);
+ object_property_set_description(obj, "iommu",
+ "Set the IOMMU type. "
+ "Valid values are none and smmuv3",
+ NULL);
vms->irqmap=a15irqmap;
}
--
1.8.3.1

View File

@ -0,0 +1,54 @@
From 59097210f25bfcabc82c9989d3c083a6febeadd6 Mon Sep 17 00:00:00 2001
From: Auger Eric <eric.auger@redhat.com>
Date: Tue, 4 Jun 2019 15:23:26 +0100
Subject: [PATCH 7/9] aarch64: Compile out IOH3420
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Auger Eric <eric.auger@redhat.com>
Message-id: <20190604152326.18510-1-eric.auger@redhat.com>
Patchwork-id: 88525
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH v2] aarch64: Compile out IOH3420
Bugzilla: 1627283
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
BZ: 1627283
BRANCH: rhel-av-8.1.0/master-4.0.0
UPSTREAM: N/A
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=21989313
TEST: On Sabre, no ioh3420 available
IOH3420 is not used on aarch64 or arm as we prefer the generic root port
so let's compile it out.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
v1 -> v2
- do not touch arm-softmmu.mak
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
default-configs/aarch64-rh-devices.mak | 1 -
1 file changed, 1 deletion(-)
diff --git a/default-configs/aarch64-rh-devices.mak b/default-configs/aarch64-rh-devices.mak
index 13ce7c7..224e29b 100644
--- a/default-configs/aarch64-rh-devices.mak
+++ b/default-configs/aarch64-rh-devices.mak
@@ -12,7 +12,6 @@ CONFIG_EDID=y
CONFIG_FW_CFG_DMA=y
CONFIG_GPIO_KEY=y
CONFIG_I2C=y
-CONFIG_IOH3420=y
CONFIG_IVSHMEM=y
CONFIG_KVM=y
CONFIG_LINUX=y
--
1.8.3.1

View File

@ -0,0 +1,47 @@
From 646f497c8e1dcea5c1ec8731693e3f06be8f6cc2 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue, 4 Jun 2019 07:13:39 +0100
Subject: [PATCH 4/9] usb: call reset handler before updating state
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <20190604071341.3432-2-kraxel@redhat.com>
Patchwork-id: 88478
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH 1/3] usb: call reset handler before updating state
Bugzilla: 1713679
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
That way the device reset handler can see what
the before-reset state of the device is.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190522094702.17619-2-kraxel@redhat.com
(cherry picked from commit 7ed4657396add28382081a15557c78cd480c1cf1)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/usb/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/core.c b/hw/usb/core.c
index 8fbd9c7..3ab48a1 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -87,10 +87,10 @@ void usb_device_reset(USBDevice *dev)
if (dev == NULL || !dev->attached) {
return;
}
+ usb_device_handle_reset(dev);
dev->remote_wakeup = 0;
dev->addr = 0;
dev->state = USB_STATE_DEFAULT;
- usb_device_handle_reset(dev);
}
void usb_wakeup(USBEndpoint *ep, unsigned int stream)
--
1.8.3.1

View File

@ -0,0 +1,68 @@
From a92cfe1254f947c32f15ebb1f81b825076c5625e Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue, 4 Jun 2019 07:13:41 +0100
Subject: [PATCH 6/9] usb-host: avoid libusb_set_configuration calls
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <20190604071341.3432-4-kraxel@redhat.com>
Patchwork-id: 88477
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH 3/3] usb-host: avoid libusb_set_configuration calls
Bugzilla: 1713679
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
Seems some devices become confused when we call
libusb_set_configuration(). So before calling the function check
whenever the device has multiple configurations in the first place, and
in case it hasn't (which is the case for the majority of devices) simply
skip the call as it will have no effect anyway.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190522094702.17619-4-kraxel@redhat.com
(cherry picked from commit bfe44898848614cfcb3a269bc965afbe1f0f331c)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/usb/host-libusb.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 4e9a45a..4f765d7 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1225,19 +1225,21 @@ static void usb_host_set_address(USBHostDevice *s, int addr)
static void usb_host_set_config(USBHostDevice *s, int config, USBPacket *p)
{
- int rc;
+ int rc = 0;
trace_usb_host_set_config(s->bus_num, s->addr, config);
usb_host_release_interfaces(s);
- rc = libusb_set_configuration(s->dh, config);
- if (rc != 0) {
- usb_host_libusb_error("libusb_set_configuration", rc);
- p->status = USB_RET_STALL;
- if (rc == LIBUSB_ERROR_NO_DEVICE) {
- usb_host_nodev(s);
+ if (s->ddesc.bNumConfigurations != 1) {
+ rc = libusb_set_configuration(s->dh, config);
+ if (rc != 0) {
+ usb_host_libusb_error("libusb_set_configuration", rc);
+ p->status = USB_RET_STALL;
+ if (rc == LIBUSB_ERROR_NO_DEVICE) {
+ usb_host_nodev(s);
+ }
+ return;
}
- return;
}
p->status = usb_host_claim_interfaces(s, config);
if (p->status != USB_RET_SUCCESS) {
--
1.8.3.1

View File

@ -0,0 +1,46 @@
From 507b4bb7a63544c72e8ef1713ada9ff7c2e0024f Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue, 4 Jun 2019 07:13:40 +0100
Subject: [PATCH 5/9] usb-host: skip reset for untouched devices
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <20190604071341.3432-3-kraxel@redhat.com>
Patchwork-id: 88479
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH 2/3] usb-host: skip reset for untouched devices
Bugzilla: 1713679
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
If the guest didn't talk to the device yet, skip the reset.
Without this usb-host devices get resetted a number of times
at boot time for no good reason.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190522094702.17619-3-kraxel@redhat.com
(cherry picked from commit 65f14ab98da1da920f98ee8734dc1588b01d6b2b)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/usb/host-libusb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 67b7465..4e9a45a 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1459,6 +1459,9 @@ static void usb_host_handle_reset(USBDevice *udev)
if (!s->allow_guest_reset) {
return;
}
+ if (udev->addr == 0) {
+ return;
+ }
trace_usb_host_reset(s->bus_num, s->addr);
--
1.8.3.1

View File

@ -0,0 +1,66 @@
From d5a193a4b838b00b064d441da5c038a5ff251f8b Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 6 Jun 2019 19:31:39 +0100
Subject: [PATCH 9/9] vl: Document why objects are delayed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190606193139.31976-3-armbru@redhat.com>
Patchwork-id: 88610
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH 2/2] vl: Document why objects are delayed
Bugzilla: 1714891
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Objects should not be "delayed" without a reason, as the previous
commit demonstrates. The remaining ones have reasons. State them.
and demand future ones come with such a statement.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190604151251.9903-3-armbru@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit edfb4389c26cbfd873707306024130bda6049780)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
vl.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index 627e37d..686c639 100644
--- a/vl.c
+++ b/vl.c
@@ -2852,19 +2852,25 @@ static bool object_create_initial(const char *type, QemuOpts *opts)
exit(0);
}
+ /*
+ * Objects should not be made "delayed" without a reason. If you
+ * add one, state the reason in a comment!
+ */
+
+ /* Reason: rng-egd property "chardev" */
if (g_str_equal(type, "rng-egd")) {
return false;
}
#if defined(CONFIG_VHOST_USER) && defined(CONFIG_LINUX)
+ /* Reason: cryptodev-vhost-user property "chardev" */
if (g_str_equal(type, "cryptodev-vhost-user")) {
return false;
}
#endif
/*
- * return false for concrete netfilters since
- * they depend on netdevs already existing
+ * Reason: filter-* property "netdev" etc.
*/
if (g_str_equal(type, "filter-buffer") ||
g_str_equal(type, "filter-dump") ||
--
1.8.3.1

View File

@ -0,0 +1,66 @@
From 6473a5d45b4ae75d5eef64b7b5dcd6735f498fb3 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 6 Jun 2019 19:31:38 +0100
Subject: [PATCH 8/9] vl: Fix -drive / -blockdev persistent reservation
management
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190606193139.31976-2-armbru@redhat.com>
Patchwork-id: 88609
O-Subject: [RHEL-AV-8.1.0 qemu-kvm PATCH 1/2] vl: Fix -drive / -blockdev persistent reservation management
Bugzilla: 1714891
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
qemu-system-FOO's main() acts on command line arguments in its own
idiosyncratic order. There's not much method to its madness.
Whenever we find a case where one kind of command line argument needs
to refer to something created for another kind later, we rejigger the
order.
Recent commit cda4aa9a5a "vl: Create block backends before setting
machine properties" was such a rejigger. Block backends are now
created before "delayed" objects. This broke persistent reservation
management. Reproducer:
$ qemu-system-x86_64 -object pr-manager-helper,id=pr-helper0,path=/tmp/pr-helper0.sock-drive -drive file=/dev/mapper/crypt,file.pr-manager=pr-helper0,format=raw,if=none,id=drive-scsi0-0-0-2
qemu-system-x86_64: -drive file=/dev/mapper/crypt,file.pr-manager=pr-helper0,format=raw,if=none,id=drive-scsi0-0-0-2: No persistent reservation manager with id 'pr-helper0'
The delayed pr-manager-helper object is created too late for use by
-drive or -blockdev. Normal objects are still created in time.
pr-manager-helper has always been a delayed object (commit 7c9e527659
"scsi, file-posix: add support for persistent reservation
management"). Turns out there's no real reason for that. Make it a
normal object.
Fixes: cda4aa9a5a08777cf13e164c0543bd4888b8adce
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190604151251.9903-2-armbru@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 9ea18ed25a36527167e9676f25d983df5e7f76e6)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
vl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index 2b95925..627e37d 100644
--- a/vl.c
+++ b/vl.c
@@ -2852,8 +2852,7 @@ static bool object_create_initial(const char *type, QemuOpts *opts)
exit(0);
}
- if (g_str_equal(type, "rng-egd") ||
- g_str_has_prefix(type, "pr-manager-")) {
+ if (g_str_equal(type, "rng-egd")) {
return false;
}
--
1.8.3.1

View File

@ -8,7 +8,6 @@
%global have_gluster 1
%global have_kvm_setup 0
%global have_memlock_limits 0
%global have_vxhs 0
%ifnarch %{ix86} x86_64
%global have_usbredir 0
@ -25,7 +24,6 @@
%endif
%ifarch x86_64
%global kvm_target x86_64
%global have_vxhs 1
%else
%global have_spice 0
%global have_opengl 0
@ -69,7 +67,7 @@ Obsoletes: %1-rhev
Summary: QEMU is a machine emulator and virtualizer
Name: qemu-kvm
Version: 4.0.0
Release: 3%{?dist}
Release: 4%{?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
@ -138,6 +136,24 @@ Patch25: kvm-compat-Generic-hw_compat_rhel_8_0.patch
Patch26: kvm-redhat-sync-pseries-rhel7.6.0-with-rhel-av-8.0.1.patch
# For bz#1709726 - Forward and backward migration failed with "qemu-kvm: error while loading state for instance 0x0 of device 'spapr'"
Patch27: kvm-redhat-define-pseries-rhel8.1.0-machine-type.patch
# For bz#1714937 - Disable VXHS support
Patch28: kvm-Disable-VXHS-support.patch
# For bz#1713735 - Allow ARM VIRT iommu option in RHEL8.1 machine
Patch29: kvm-aarch64-Add-virt-rhel8.1.0-machine-type-for-ARM.patch
# For bz#1713735 - Allow ARM VIRT iommu option in RHEL8.1 machine
Patch30: kvm-aarch64-Allow-ARM-VIRT-iommu-option-in-RHEL8.1-machi.patch
# For bz#1713679 - Detached device when trying to upgrade USB device firmware when in doing USB Passthrough via QEMU
Patch31: kvm-usb-call-reset-handler-before-updating-state.patch
# For bz#1713679 - Detached device when trying to upgrade USB device firmware when in doing USB Passthrough via QEMU
Patch32: kvm-usb-host-skip-reset-for-untouched-devices.patch
# For bz#1713679 - Detached device when trying to upgrade USB device firmware when in doing USB Passthrough via QEMU
Patch33: kvm-usb-host-avoid-libusb_set_configuration-calls.patch
# For bz#1627283 - Compile out IOH3420 on aarch64
Patch34: kvm-aarch64-Compile-out-IOH3420.patch
# For bz#1714891 - Guest with persistent reservation manager for a disk fails to start
Patch35: kvm-vl-Fix-drive-blockdev-persistent-reservation-managem.patch
# For bz#1714891 - Guest with persistent reservation manager for a disk fails to start
Patch36: kvm-vl-Document-why-objects-are-delayed.patch
BuildRequires: zlib-devel
BuildRequires: glib2-devel
@ -430,9 +446,6 @@ buildldflags="VL_LDFLAGS=-Wl,--build-id"
%global block_drivers_list qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle
%if 0%{have_vxhs}
%global block_drivers_list %{block_drivers_list},vxhs
%endif
%if 0%{have_gluster}
%global block_drivers_list %{block_drivers_list},gluster
%endif
@ -492,11 +505,6 @@ buildldflags="VL_LDFLAGS=-Wl,--build-id"
--disable-usb-redir \
%endif
--disable-tcmalloc \
%if 0%{have_vxhs}
--enable-vxhs \
%else
--disable-vxhs \
%endif
%ifarch x86_64
--enable-libpmem \
%else
@ -543,6 +551,7 @@ buildldflags="VL_LDFLAGS=-Wl,--build-id"
--enable-trace-backend=dtrace \
--disable-vde \
--disable-vhost-scsi \
--disable-vxhs \
--disable-virtfs \
--disable-vnc-jpeg \
--disable-vte \
@ -1064,6 +1073,27 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%changelog
* Tue Jun 11 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 4.0.0-4.el8
- kvm-Disable-VXHS-support.patch [bz#1714937]
- kvm-aarch64-Add-virt-rhel8.1.0-machine-type-for-ARM.patch [bz#1713735]
- kvm-aarch64-Allow-ARM-VIRT-iommu-option-in-RHEL8.1-machi.patch [bz#1713735]
- kvm-usb-call-reset-handler-before-updating-state.patch [bz#1713679]
- kvm-usb-host-skip-reset-for-untouched-devices.patch [bz#1713679]
- kvm-usb-host-avoid-libusb_set_configuration-calls.patch [bz#1713679]
- kvm-aarch64-Compile-out-IOH3420.patch [bz#1627283]
- kvm-vl-Fix-drive-blockdev-persistent-reservation-managem.patch [bz#1714891]
- kvm-vl-Document-why-objects-are-delayed.patch [bz#1714891]
- Resolves: bz#1627283
(Compile out IOH3420 on aarch64)
- Resolves: bz#1713679
(Detached device when trying to upgrade USB device firmware when in doing USB Passthrough via QEMU)
- Resolves: bz#1713735
(Allow ARM VIRT iommu option in RHEL8.1 machine)
- Resolves: bz#1714891
(Guest with persistent reservation manager for a disk fails to start)
- Resolves: bz#1714937
(Disable VXHS support)
* Tue May 28 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 4.0.0-3.el8
- kvm-redhat-fix-cut-n-paste-garbage-in-hw_compat-comments.patch [bz#1709726]
- kvm-compat-Generic-hw_compat_rhel_8_0.patch [bz#1709726]