From 43f53636d0e0a4326d28ec5fa91cdd6d477b1713 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Feb 04 2020 16:00:36 +0000 Subject: import libvirt-4.5.0-23.el7_7.5 --- diff --git a/SOURCES/libvirt-RHEL-qemu-Enable-virt-ssbd-for-host-model-with-old-QEMU.patch b/SOURCES/libvirt-RHEL-qemu-Enable-virt-ssbd-for-host-model-with-old-QEMU.patch new file mode 100644 index 0000000..7b8d712 --- /dev/null +++ b/SOURCES/libvirt-RHEL-qemu-Enable-virt-ssbd-for-host-model-with-old-QEMU.patch @@ -0,0 +1,78 @@ +From 85ac61a95b3817ffcb653856f40b7c4ee86c876e Mon Sep 17 00:00:00 2001 +Message-Id: <85ac61a95b3817ffcb653856f40b7c4ee86c876e@dist-git> +From: Jiri Denemark +Date: Mon, 6 Jan 2020 16:43:40 +0100 +Subject: [PATCH] RHEL: qemu: Enable virt-ssbd for host-model with old QEMU + +RHEL-only hack for qemu-kvm-1.5.3-* + +RHEL version of QEMU in contrast to qemu-kvm-rhev does not support +reporting what CPU features can be enabled on current host and thus we +have no idea whether virt-ssbd can be enabled or not. We will just +blindly enable it when starting a domain with host-model CPU on old +QEMU, detect whether it was actually enabled once QEMU starts and update +the live XML accordingly. + +We just need to make sure qemu-kvm is new enough (at least 1.5.3-158) to +support virt-ssbd otherwise QEMU would fail to start complaining about +unknown feature. Luckily, such qemu-kvm was already present in RHEL-7.6. + +https://bugzilla.redhat.com/show_bug.cgi?id=1745181 + +Signed-off-by: Jiri Denemark +Message-Id: +Reviewed-by: Michal Privoznik +(cherry picked from commit 6244ce5a6ff5121fff9aaffe1689912955af6372) + +https://bugzilla.redhat.com/show_bug.cgi?id=1787556 + +Signed-off-by: Jiri Denemark +Message-Id: <0ac3b5185c3a0aa514742752c84fae8d23c5e2c8.1578325371.git.jdenemar@redhat.com> +Reviewed-by: Pavel Hrdina +--- + libvirt.spec.in | 1 + + src/qemu/qemu_process.c | 14 ++++++++++++++ + 2 files changed, 15 insertions(+) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 307098cd63..b8b12491a3 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -5776,6 +5776,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, + unsigned int flags) + { + int ret = -1; ++ bool host_model = false; + + if (!def->cpu) + return 0; +@@ -5822,6 +5823,8 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, + def->cpu, true) < 0) + return -1; + ++ host_model = def->cpu->mode == VIR_CPU_MODE_HOST_MODEL; ++ + if (virCPUUpdate(def->os.arch, def->cpu, + virQEMUCapsGetHostModel(qemuCaps, def->virtType, + VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE)) < 0) +@@ -5831,6 +5834,17 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, + virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType)) < 0) + goto cleanup; + ++ if (host_model && ++ ARCH_IS_X86(def->os.arch) && ++ caps->host.cpu && ++ STREQ_NULLABLE(caps->host.cpu->vendor, "AMD")) { ++ virCPUDefPtr hostCPU; ++ hostCPU = virQEMUCapsGetHostModel(qemuCaps, def->virtType, ++ VIR_QEMU_CAPS_HOST_CPU_REPORTED); ++ if (hostCPU->fallback == VIR_CPU_FALLBACK_ALLOW) ++ virCPUDefUpdateFeature(def->cpu, "virt-ssbd", VIR_CPU_FEATURE_REQUIRE); ++ } ++ + def->cpu->fallback = VIR_CPU_FALLBACK_FORBID; + ret = 0; + +-- +2.24.1 + diff --git a/SOURCES/libvirt-qemu-Forcibly-mknod-even-if-it-exists.patch b/SOURCES/libvirt-qemu-Forcibly-mknod-even-if-it-exists.patch new file mode 100644 index 0000000..f31dbd4 --- /dev/null +++ b/SOURCES/libvirt-qemu-Forcibly-mknod-even-if-it-exists.patch @@ -0,0 +1,96 @@ +From c7c9c9aba8445df4dcdf46e67860d4ab1ee6cf6b Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michal Privoznik +Date: Fri, 22 Nov 2019 16:43:59 +0100 +Subject: [PATCH] qemu: Forcibly mknod() even if it exists +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Another weird bug appeared concerning qemu namespaces. Basically +the problem is as follows: + +1) Issue an API that causes libvirt to create a node in domain's + namespace, say /dev/nvme0n1 with 8:0 as major:minor (the API can + be attach-disk for instance). Or simply create the node from a + console by hand. + +2) Detach the disk from qemu. + +3) Do something that makes /dev/nvme0n1 change it's minor number. + +4) Try to attach the disk again. + +The problem is, in a few cases - like disk-detach - we don't +remove the corresponding /dev node from the mount namespace +(because it may be used by some other disk's backing chain). But +this creates a problem, because if the node changes its MAJ:MIN +numbers we don't propagate the change into the domain's +namespace. We do plain mknod() and ignore EEXIST which obviously +is not enough because it doesn't guarantee that the node has +updated MAJ:MIN pair. + +Signed-off-by: Michal Privoznik +Reviewed-by: Daniel P. Berrangé +(cherry picked from commit cdd8a6690ee3fa4b4b8ca1d4531924bd33be136a) + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1775680 + +Signed-off-by: Michal Privoznik +Message-Id: +Reviewed-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 25 +++++++++---------------- + 1 file changed, 9 insertions(+), 16 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 249ec4d259..f2ff610750 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -11111,16 +11111,14 @@ qemuDomainCreateDeviceRecursive(const char *device, + allow_noent, ttl - 1) < 0) + goto cleanup; + } else if (isDev) { +- if (create && +- mknod(devicePath, sb.st_mode, sb.st_rdev) < 0) { +- if (errno == EEXIST) { +- ret = 0; +- } else { ++ if (create) { ++ unlink(devicePath); ++ if (mknod(devicePath, sb.st_mode, sb.st_rdev) < 0) { + virReportSystemError(errno, + _("Failed to make device %s"), + devicePath); ++ goto cleanup; + } +- goto cleanup; + } + } else if (isReg) { + if (create && +@@ -11889,17 +11887,12 @@ qemuDomainAttachDeviceMknodHelper(pid_t pid ATTRIBUTE_UNUSED, + } else if (isDev) { + VIR_DEBUG("Creating dev %s (%d,%d)", + data->file, major(data->sb.st_rdev), minor(data->sb.st_rdev)); ++ unlink(data->file); + if (mknod(data->file, data->sb.st_mode, data->sb.st_rdev) < 0) { +- /* Because we are not removing devices on hotunplug, or +- * we might be creating part of backing chain that +- * already exist due to a different disk plugged to +- * domain, accept EEXIST. */ +- if (errno != EEXIST) { +- virReportSystemError(errno, +- _("Unable to create device %s"), +- data->file); +- goto cleanup; +- } ++ virReportSystemError(errno, ++ _("Unable to create device %s"), ++ data->file); ++ goto cleanup; + } else { + delDevice = true; + } +-- +2.24.0 + diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec index a30e97a..bde7126 100644 --- a/SPECS/libvirt.spec +++ b/SPECS/libvirt.spec @@ -253,7 +253,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 4.5.0 -Release: 23%{?dist}.3%{?extra_release} +Release: 23%{?dist}.5%{?extra_release} License: LGPLv2+ URL: https://libvirt.org/ @@ -598,6 +598,8 @@ Patch332: libvirt-util-command-Ignore-bitmap-errors-when-enumerating-file-descri Patch333: libvirt-util-Avoid-possible-error-in-virCommandMassClose.patch Patch334: libvirt-domain_conf-Make-virDomainDeviceFindSCSIController-accept-virDomainDeviceDriveAddress-struct.patch Patch335: libvirt-domain_conf-Relax-SCSI-addr-used-check.patch +Patch336: libvirt-qemu-Forcibly-mknod-even-if-it-exists.patch +Patch337: libvirt-RHEL-qemu-Enable-virt-ssbd-for-host-model-with-old-QEMU.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -1128,6 +1130,7 @@ Requires: xz %if 0%{?fedora} || 0%{?rhel} > 7 Requires: systemd-container %endif +Conflicts: qemu-kvm < 10:1.5.3-158 %description daemon-driver-qemu The qemu driver plugin for the libvirtd daemon, providing @@ -2499,6 +2502,12 @@ exit 0 %changelog +* Mon Jan 13 2020 Jiri Denemark - 4.5.0-23.el7_7.5 +- RHEL: qemu: Enable virt-ssbd for host-model with old QEMU (rhbz#1787556) + +* Fri Nov 22 2019 Jiri Denemark - 4.5.0-23.el7_7.4 +- qemu: Forcibly mknod() even if it exists (rhbz#1775680) + * Mon Oct 28 2019 Jiri Denemark - 4.5.0-23.el7_7.3 - domain_conf: Make virDomainDeviceFindSCSIController accept virDomainDeviceDriveAddress struct (rhbz#1766086) - domain_conf: Relax SCSI addr used check (rhbz#1766086)