|
|
03cc27 |
From 3ff107d00519e66ee350f34fcad7739df32411a5 Mon Sep 17 00:00:00 2001
|
|
|
03cc27 |
Message-Id: <3ff107d00519e66ee350f34fcad7739df32411a5@dist-git>
|
|
|
03cc27 |
From: Jiri Denemark <jdenemar@redhat.com>
|
|
|
03cc27 |
Date: Thu, 23 Apr 2020 20:59:53 +0200
|
|
|
03cc27 |
Subject: [PATCH] =?UTF-8?q?RHEL:=20Fix=20migration=20on=20AMD=C2=A0hosts?=
|
|
|
03cc27 |
=?UTF-8?q?=20with=20old=20QEMU?=
|
|
|
03cc27 |
MIME-Version: 1.0
|
|
|
03cc27 |
Content-Type: text/plain; charset=UTF-8
|
|
|
03cc27 |
Content-Transfer-Encoding: 8bit
|
|
|
03cc27 |
|
|
|
03cc27 |
Fix for a RHEL-only hack for qemu-kvm-1.5.3-*
|
|
|
03cc27 |
|
|
|
03cc27 |
Downstream commit 6244ce5a6f started adding virt-ssbd feature to all
|
|
|
03cc27 |
host-model CPUs before starting a domain to make sure it is enabled if
|
|
|
03cc27 |
possible (qemu-kvm-1.5.3-* is too old for probing whether virt-ssbd may
|
|
|
03cc27 |
be enabled, we just have to try). However, we add this feature to the
|
|
|
03cc27 |
CPU definition before the definition is copied to priv->origCPU and the
|
|
|
03cc27 |
definition stored there is used with QEMU older than 2.10 to start the
|
|
|
03cc27 |
domain after it's been saved or during migration. And because the CPU
|
|
|
03cc27 |
definition contains virt-ssbd which is not provided by the host CPU,
|
|
|
03cc27 |
starting or migrating fails with
|
|
|
03cc27 |
|
|
|
03cc27 |
the CPU is incompatible with host CPU: Host CPU does not provide
|
|
|
03cc27 |
required features: virt-ssbd
|
|
|
03cc27 |
|
|
|
03cc27 |
We need to copy the original CPU definition to priv->origCPU before
|
|
|
03cc27 |
adding virt-ssbd there (normally priv->origCPU is set in
|
|
|
03cc27 |
qemuProcessUpdateLiveGuestCPU when QEMU is already running).
|
|
|
03cc27 |
|
|
|
03cc27 |
https://bugzilla.redhat.com/show_bug.cgi?id=1815572
|
|
|
03cc27 |
|
|
|
03cc27 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
03cc27 |
Message-Id: <e4a8522926cad816fcfb60a05f1c28493ddbcd63.1587659979.git.jdenemar@redhat.com>
|
|
|
03cc27 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
03cc27 |
---
|
|
|
03cc27 |
src/qemu/qemu_process.c | 11 ++++++++---
|
|
|
03cc27 |
1 file changed, 8 insertions(+), 3 deletions(-)
|
|
|
03cc27 |
|
|
|
03cc27 |
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
|
03cc27 |
index 7a7fc8f205..ea55ccf7ec 100644
|
|
|
03cc27 |
--- a/src/qemu/qemu_process.c
|
|
|
03cc27 |
+++ b/src/qemu/qemu_process.c
|
|
|
03cc27 |
@@ -5776,10 +5776,11 @@ qemuProcessSetupHotpluggableVcpus(virQEMUDriverPtr driver,
|
|
|
03cc27 |
|
|
|
03cc27 |
static int
|
|
|
03cc27 |
qemuProcessUpdateGuestCPU(virDomainDefPtr def,
|
|
|
03cc27 |
- virQEMUCapsPtr qemuCaps,
|
|
|
03cc27 |
+ qemuDomainObjPrivatePtr priv,
|
|
|
03cc27 |
virCapsPtr caps,
|
|
|
03cc27 |
unsigned int flags)
|
|
|
03cc27 |
{
|
|
|
03cc27 |
+ virQEMUCapsPtr qemuCaps = priv->qemuCaps;
|
|
|
03cc27 |
int ret = -1;
|
|
|
03cc27 |
bool host_model = false;
|
|
|
03cc27 |
|
|
|
03cc27 |
@@ -5846,8 +5847,12 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
|
|
|
03cc27 |
virCPUDefPtr hostCPU;
|
|
|
03cc27 |
hostCPU = virQEMUCapsGetHostModel(qemuCaps, def->virtType,
|
|
|
03cc27 |
VIR_QEMU_CAPS_HOST_CPU_REPORTED);
|
|
|
03cc27 |
- if (hostCPU->fallback == VIR_CPU_FALLBACK_ALLOW)
|
|
|
03cc27 |
+ if (hostCPU->fallback == VIR_CPU_FALLBACK_ALLOW) {
|
|
|
03cc27 |
+ if (!priv->origCPU && !(priv->origCPU = virCPUDefCopy(def->cpu)))
|
|
|
03cc27 |
+ goto cleanup;
|
|
|
03cc27 |
+
|
|
|
03cc27 |
virCPUDefUpdateFeature(def->cpu, "virt-ssbd", VIR_CPU_FEATURE_REQUIRE);
|
|
|
03cc27 |
+ }
|
|
|
03cc27 |
}
|
|
|
03cc27 |
|
|
|
03cc27 |
def->cpu->fallback = VIR_CPU_FALLBACK_FORBID;
|
|
|
03cc27 |
@@ -6069,7 +6074,7 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver,
|
|
|
03cc27 |
priv->runningReason = VIR_DOMAIN_RUNNING_UNKNOWN;
|
|
|
03cc27 |
|
|
|
03cc27 |
VIR_DEBUG("Updating guest CPU definition");
|
|
|
03cc27 |
- if (qemuProcessUpdateGuestCPU(vm->def, priv->qemuCaps, caps, flags) < 0)
|
|
|
03cc27 |
+ if (qemuProcessUpdateGuestCPU(vm->def, priv, caps, flags) < 0)
|
|
|
03cc27 |
goto cleanup;
|
|
|
03cc27 |
|
|
|
03cc27 |
for (i = 0; i < vm->def->nshmems; i++) {
|
|
|
03cc27 |
--
|
|
|
03cc27 |
2.26.0
|
|
|
03cc27 |
|