diff --git a/libvirt-RHEL-Enable-usage-of-x-blockdev-reopen.patch b/libvirt-RHEL-Enable-usage-of-x-blockdev-reopen.patch deleted file mode 100644 index 49550bd..0000000 --- a/libvirt-RHEL-Enable-usage-of-x-blockdev-reopen.patch +++ /dev/null @@ -1,253 +0,0 @@ -From 7d27eb2ca9d5a3a9add7bf2bc2850aa72b97a806 Mon Sep 17 00:00:00 2001 -Message-Id: <7d27eb2ca9d5a3a9add7bf2bc2850aa72b97a806@dist-git> -From: Peter Krempa -Date: Wed, 28 Jul 2021 17:37:21 +0200 -Subject: [PATCH] RHEL: Enable usage of x-blockdev-reopen -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RHEL-only - -Introduce a new capability QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API -based on the presence of '__com.redhat_rhel-av-8_2_0-api' feature for -'x-blockdev-reopen' which states that reopen works for what libvirt -is going to use it and wire up code to call the x- prefixed command. - -This implementation will become dormant once qemu starts supporting -upstream-stable blockdev-reopen. - -https://bugzilla.redhat.com/show_bug.cgi?id=1799013 - -Starting with libvirt-7.6, upstream has adapted to the new format of -arguments so this patch was modified to support blockdev-reopen which -takes an array of nodes to reopen. - -https://bugzilla.redhat.com/show_bug.cgi?id=1929765 -Message-Id: <3fcde2fc6add36d5276ae224caf18adc8bca7d48.1627486352.git.pkrempa@redhat.com> -Reviewed-by: Ján Tomko ---- - src/qemu/qemu_block.c | 24 +++++++++++++++--------- - src/qemu/qemu_block.h | 3 ++- - src/qemu/qemu_capabilities.c | 11 +++++++++++ - src/qemu/qemu_capabilities.h | 1 + - src/qemu/qemu_monitor.c | 5 +++-- - src/qemu/qemu_monitor.h | 3 ++- - src/qemu/qemu_monitor_json.c | 12 +++++++++--- - src/qemu/qemu_monitor_json.h | 3 ++- - tests/qemumonitorjsontest.c | 2 +- - 9 files changed, 46 insertions(+), 18 deletions(-) - -diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c -index 0bc92f6a23..3af064614e 100644 ---- a/src/qemu/qemu_block.c -+++ b/src/qemu/qemu_block.c -@@ -3287,7 +3287,8 @@ qemuBlockBitmapsHandleCommitFinish(virStorageSource *topsrc, - - int - qemuBlockReopenFormatMon(qemuMonitor *mon, -- virStorageSource *src) -+ virStorageSource *src, -+ bool downstream) - { - g_autoptr(virJSONValue) reopenprops = NULL; - g_autoptr(virJSONValue) srcprops = NULL; -@@ -3296,15 +3297,19 @@ qemuBlockReopenFormatMon(qemuMonitor *mon, - if (!(srcprops = qemuBlockStorageSourceGetBlockdevProps(src, src->backingStore))) - return -1; - -- if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0) -- return -1; -+ if (downstream) { -+ reopenprops = g_steal_pointer(&srcprops); -+ } else { -+ if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0) -+ return -1; - -- if (virJSONValueObjectCreate(&reopenprops, -- "a:options", &reopenoptions, -- NULL) < 0) -- return -1; -+ if (virJSONValueObjectCreate(&reopenprops, -+ "a:options", &reopenoptions, -+ NULL) < 0) -+ return -1; -+ } - -- if (qemuMonitorBlockdevReopen(mon, &reopenprops) < 0) -+ if (qemuMonitorBlockdevReopen(mon, &reopenprops, downstream) < 0) - return -1; - - return 0; -@@ -3328,6 +3333,7 @@ qemuBlockReopenFormat(virDomainObj *vm, - { - qemuDomainObjPrivate *priv = vm->privateData; - virQEMUDriver *driver = priv->driver; -+ bool downstream = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API); - int rc; - - /* If we are lacking the object here, qemu might have opened an image with -@@ -3341,7 +3347,7 @@ qemuBlockReopenFormat(virDomainObj *vm, - if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) - return -1; - -- rc = qemuBlockReopenFormatMon(priv->mon, src); -+ rc = qemuBlockReopenFormatMon(priv->mon, src, downstream); - - if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) - return -1; -diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h -index 54601a48a9..88fc9974c4 100644 ---- a/src/qemu/qemu_block.h -+++ b/src/qemu/qemu_block.h -@@ -268,7 +268,8 @@ qemuBlockBitmapsHandleCommitFinish(virStorageSource *topsrc, - /* only for use in qemumonitorjsontest */ - int - qemuBlockReopenFormatMon(qemuMonitor *mon, -- virStorageSource *src); -+ virStorageSource *src, -+ bool downstream); - - int - qemuBlockReopenReadWrite(virDomainObj *vm, -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 70c3ec2f0c..99e9eb485e 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -638,6 +638,7 @@ VIR_ENUM_IMPL(virQEMUCaps, - "query-display-options", /* QEMU_CAPS_QUERY_DISPLAY_OPTIONS */ - "s390-pv-guest", /* QEMU_CAPS_S390_PV_GUEST */ - "set-action", /* QEMU_CAPS_SET_ACTION */ -+ "blockdev-reopen.__com.redhat_rhel-av-8_2_0-api", - ); - - -@@ -1551,6 +1552,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVhostUserFS[] = - /* see documentation for virQEMUQAPISchemaPathGet for the query format */ - static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { - { "block-commit/arg-type/*top", QEMU_CAPS_ACTIVE_COMMIT }, -+ { "x-blockdev-reopen/$__com.redhat_rhel-av-8_2_0-api", QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API }, - { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, - { "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, - { "blockdev-add/arg-type/+vxhs", QEMU_CAPS_VXHS}, -@@ -5155,6 +5157,15 @@ virQEMUCapsInitProcessCaps(virQEMUCaps *qemuCaps) - qemuCaps->arch == VIR_ARCH_MIPS) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_SCSI_NCR53C90); - -+ /* RHEL-only: -+ * - if upstream blockdev-reopen is enabled, clear the downstream flag -+ * - if the downstream flag is present but not the upstream, assert the upstream flag too -+ */ -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) -+ virQEMUCapsClear(qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API); -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API)) -+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN); -+ - virQEMUCapsInitProcessCapsInterlock(qemuCaps); - } - -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index bc762d1916..658176c12b 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -618,6 +618,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ - QEMU_CAPS_QUERY_DISPLAY_OPTIONS, /* 'query-display-options' qmp command present */ - QEMU_CAPS_S390_PV_GUEST, /* -object s390-pv-guest,... */ - QEMU_CAPS_SET_ACTION, /* 'set-action' QMP command */ -+ QEMU_CAPS_BLOCKDEV_REOPEN_COM_REDHAT_AV_8_2_0_API, /* downstream support for blockdev reopen in rhel-av-8.2.0 */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c -index 42846349c4..065ed59336 100644 ---- a/src/qemu/qemu_monitor.c -+++ b/src/qemu/qemu_monitor.c -@@ -4331,14 +4331,15 @@ qemuMonitorBlockdevAdd(qemuMonitor *mon, - - int - qemuMonitorBlockdevReopen(qemuMonitor *mon, -- virJSONValue **props) -+ virJSONValue **props, -+ bool downstream) - { - VIR_DEBUG("props=%p (node-name=%s)", *props, - NULLSTR(virJSONValueObjectGetString(*props, "node-name"))); - - QEMU_CHECK_MONITOR(mon); - -- return qemuMonitorJSONBlockdevReopen(mon, props); -+ return qemuMonitorJSONBlockdevReopen(mon, props, downstream); - } - - -diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h -index 2f08357c0c..d1eb8f1b26 100644 ---- a/src/qemu/qemu_monitor.h -+++ b/src/qemu/qemu_monitor.h -@@ -1405,7 +1405,8 @@ int qemuMonitorBlockdevAdd(qemuMonitor *mon, - virJSONValue **props); - - int qemuMonitorBlockdevReopen(qemuMonitor *mon, -- virJSONValue **props); -+ virJSONValue **props, -+ bool downstream); - - int qemuMonitorBlockdevDel(qemuMonitor *mon, - const char *nodename); -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 8d3c4031a6..88bc1485e3 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -8626,13 +8626,19 @@ qemuMonitorJSONBlockdevAdd(qemuMonitor *mon, - - int - qemuMonitorJSONBlockdevReopen(qemuMonitor *mon, -- virJSONValue **props) -+ virJSONValue **props, -+ bool downstream) - { - g_autoptr(virJSONValue) cmd = NULL; - g_autoptr(virJSONValue) reply = NULL; - -- if (!(cmd = qemuMonitorJSONMakeCommandInternal("blockdev-reopen", props))) -- return -1; -+ if (downstream) { -+ if (!(cmd = qemuMonitorJSONMakeCommandInternal("x-blockdev-reopen", props))) -+ return -1; -+ } else { -+ if (!(cmd = qemuMonitorJSONMakeCommandInternal("blockdev-reopen", props))) -+ return -1; -+ } - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - return -1; -diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h -index c8cf734a1c..1c93645fda 100644 ---- a/src/qemu/qemu_monitor_json.h -+++ b/src/qemu/qemu_monitor_json.h -@@ -598,7 +598,8 @@ int qemuMonitorJSONBlockdevAdd(qemuMonitor *mon, - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - - int qemuMonitorJSONBlockdevReopen(qemuMonitor *mon, -- virJSONValue **props) -+ virJSONValue **props, -+ bool downstream) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - - int qemuMonitorJSONBlockdevDel(qemuMonitor *mon, -diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c -index 9ec5f06981..38388efe0d 100644 ---- a/tests/qemumonitorjsontest.c -+++ b/tests/qemumonitorjsontest.c -@@ -2824,7 +2824,7 @@ testQemuMonitorJSONBlockdevReopen(const void *opaque) - if (qemuMonitorTestAddItem(test, "blockdev-reopen", "{\"return\":{}}") < 0) - return -1; - -- if (qemuBlockReopenFormatMon(qemuMonitorTestGetMonitor(test), src) < 0) -+ if (qemuBlockReopenFormatMon(qemuMonitorTestGetMonitor(test), src, false) < 0) - return -1; - - return 0; --- -2.33.0 - diff --git a/libvirt-RHEL-Fix-virConnectGetMaxVcpus-output.patch b/libvirt-RHEL-Fix-virConnectGetMaxVcpus-output.patch index 665b226..753c284 100644 --- a/libvirt-RHEL-Fix-virConnectGetMaxVcpus-output.patch +++ b/libvirt-RHEL-Fix-virConnectGetMaxVcpus-output.patch @@ -1,5 +1,5 @@ -From 27750c7d5c43ddc3aaf8a544a370e23a4cae2ac6 Mon Sep 17 00:00:00 2001 -Message-Id: <27750c7d5c43ddc3aaf8a544a370e23a4cae2ac6@dist-git> +From 49692aff9e0342b25e8cc2a3a3e694c2efac0bd1 Mon Sep 17 00:00:00 2001 +Message-Id: <49692aff9e0342b25e8cc2a3a3e694c2efac0bd1@dist-git> From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Mon, 27 Aug 2018 13:09:38 +0200 Subject: [PATCH] RHEL: Fix virConnectGetMaxVcpus output diff --git a/libvirt-virshDomainGetVcpuBitmap-Return-bitmap-when-taking-the-fallback-path.patch b/libvirt-virshDomainGetVcpuBitmap-Return-bitmap-when-taking-the-fallback-path.patch deleted file mode 100644 index f7f3b0e..0000000 --- a/libvirt-virshDomainGetVcpuBitmap-Return-bitmap-when-taking-the-fallback-path.patch +++ /dev/null @@ -1,45 +0,0 @@ -From fdbfa94e98ef8a62dc170c6f22970bddba602eda Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Wed, 15 Sep 2021 15:09:00 +0200 -Subject: [PATCH] virshDomainGetVcpuBitmap: Return bitmap when taking the - fallback path - -In case the specific VCPU states are not present in the XML we were -taking a fallback code path just noting that all cpus of the VM are -enabled. - -This was broken by a mistake in a recent refactor where a 'goto cleanup' -was mistakenly replaced by a 'return NULL'. This broke reporting of cpus -and also caused a memory leak. - -Return the fallback cpu map. - -Fixes: bd1f40fe7d4 -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2004429 -Signed-off-by: Peter Krempa -Reviewed-by: Pavel Hrdina -Reviewed-by: Jiri Denemark -Reviewed-by: Jonathon Jongsma -(cherry picked from commit 59e74c319384b766a50669c6248222da0cf10fd0) -Signed-off-by: Jiri Denemark ---- - tools/virsh-domain.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c -index e5bd1fdd75..f5a3e1accc 100644 ---- a/tools/virsh-domain.c -+++ b/tools/virsh-domain.c -@@ -6710,7 +6710,7 @@ virshDomainGetVcpuBitmap(vshControl *ctl, - for (i = 0; i < curvcpus; i++) - ignore_value(virBitmapSetBit(ret, i)); - -- return NULL; -+ return ret; - } - - for (i = 0; i < nnodes; i++) { --- -2.33.0 - diff --git a/libvirt.spec b/libvirt.spec index 890d281..13c8c99 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -205,8 +205,8 @@ Summary: Library providing a simple virtualization API Name: libvirt -Version: 7.7.0 -Release: 3%{?dist}%{?extra_release} +Version: 7.8.0 +Release: 1%{?dist}%{?extra_release} License: LGPLv2+ URL: https://libvirt.org/ @@ -217,8 +217,6 @@ Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz Source1: symlinks Patch1: libvirt-RHEL-Fix-virConnectGetMaxVcpus-output.patch -Patch2: libvirt-RHEL-Enable-usage-of-x-blockdev-reopen.patch -Patch3: libvirt-virshDomainGetVcpuBitmap-Return-bitmap-when-taking-the-fallback-path.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -1281,28 +1279,28 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \ # raising the test timeout VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check --timeout-multiplier 10 -%global libvirt_daemon_schedule_restart() mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || : \ +%define libvirt_daemon_schedule_restart() mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || : \ /bin/systemctl is-active %1.service 1>/dev/null 2>&1 && \ touch %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 || : -%global libvirt_daemon_finish_restart() rm -f %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 \ +%define libvirt_daemon_finish_restart() rm -f %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 \ rmdir %{_localstatedir}/lib/rpm-state/libvirt 2>/dev/null || : -%global libvirt_daemon_needs_restart() -f %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 +%define libvirt_daemon_needs_restart() -f %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 -%global libvirt_daemon_perform_restart() if test %libvirt_daemon_needs_restart %1 \ +%define libvirt_daemon_perform_restart() if test %libvirt_daemon_needs_restart %1 \ then \ /bin/systemctl try-restart %1.service >/dev/null 2>&1 || : \ fi \ %libvirt_daemon_finish_restart %1 -%global libvirt_daemon_systemd_post() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1.service +%define libvirt_daemon_systemd_post() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1.service -%global libvirt_daemon_systemd_post_inet() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.service +%define libvirt_daemon_systemd_post_inet() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.service -%global libvirt_daemon_systemd_preun() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1.socket +%define libvirt_daemon_systemd_preun() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1.socket -%global libvirt_daemon_systemd_preun_inet() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.socket +%define libvirt_daemon_systemd_preun_inet() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.socket %pre daemon # 'libvirt' group is just to allow password-less polkit access to @@ -2087,6 +2085,12 @@ exit 0 %changelog +* Tue Oct 5 2021 Jiri Denemark - 7.8.0-1 +- Rebased to libvirt-7.8.0 (rhbz#2001507) +- The rebase also fixes the following bugs: + rhbz#1999420, rhbz#2002761, rhbz#1998920, rhbz#1986066, rhbz#1822891 + rhbz#2001627, rhbz#1819160, rhbz#2000861, rhbz#2003092 + * Wed Sep 22 2021 Jiri Denemark - 7.7.0-3 - virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path (rhbz#2004429) diff --git a/sources b/sources index 6025a97..a28a166 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libvirt-7.7.0.tar.xz) = a0d585c9ac46be08d2865d66456d681b7233291d17f6e0ed2564d0f29dc38ea7afc846ab382f58a193d3cd9acaf25fcc526feb3c98e12a6b4b8ae5aa4aec2f3e +SHA512 (libvirt-7.8.0.tar.xz) = 0fe31b70178d662a5c8019ef424568b95d9d4c2eb74113c1b697ccf4eef1e110c3095e19835cef2c9459a694a5f4785b0761c19ec78062af88c39651291fa040 diff --git a/symlinks b/symlinks index 37f660b..1582e83 100644 --- a/symlinks +++ b/symlinks @@ -155,6 +155,7 @@ tests/qemuxml2xmloutdata/clock-realtime.xml ../qemuxml2argvdata/clock-realtime.x tests/qemuxml2xmloutdata/clock-timer-armvtimer.aarch64-latest.xml ../qemuxml2argvdata/clock-timer-armvtimer.xml tests/qemuxml2xmloutdata/disk-detect-zeroes.x86_64-latest.xml ../qemuxml2argvdata/disk-detect-zeroes.xml tests/qemuxml2xmloutdata/disk-nvme.xml ../qemuxml2argvdata/disk-nvme.xml +tests/qemuxml2xmloutdata/disk-virtio-queues.x86_64-latest.xml ../qemuxml2argvdata/disk-virtio-queues.xml tests/qemuxml2xmloutdata/disk-virtio-queues.xml ../qemuxml2argvdata/disk-virtio-queues.xml tests/qemuxml2xmloutdata/disk-virtio-scsi-reservations.xml ../qemuxml2argvdata/disk-virtio-scsi-reservations.xml tests/qemuxml2xmloutdata/downscript.xml ../qemuxml2argvdata/downscript.xml @@ -1097,6 +1098,9 @@ tests/virhostcpudata/linux-with-die/node/node0/cpu6 ../../cpu/cpu6 tests/virhostcpudata/linux-with-die/node/node0/cpu7 ../../cpu/cpu7 tests/virhostcpudata/linux-with-die/node/node0/cpu8 ../../cpu/cpu8 tests/virhostcpudata/linux-with-die/node/node0/cpu9 ../../cpu/cpu9 +tests/virstoragetestdata/images/sub/link1 ../qcow2_raw-raw-reldir.qcow2 +tests/virstoragetestdata/images/sub/link2 ../qcow2_qcow2-qcow2-symlink_raw-raw-reldir.qcow2 +tests/virstoragetestdata/lookup/sub/link2 ../wrap tests/vmx2xmldata/cdrom-ide-file-missing-datastore.xml cdrom-ide-empty.xml tests/vmx2xmldata/cdrom-ide-file-missing-file.xml cdrom-ide-empty.xml tests/vmx2xmldata/serial-pipe-client-app.xml serial-pipe.xml