提交 eabb0002 编写于 作者: J Jiri Denemark

qemu: Do not skip virCPUUpdateLive if priv->origCPU is set

Even though we got both the original CPU (used for starting a domain)
and the updated version (the CPU really provided by QEMU) during
incoming migration, restore, or snapshot revert, we still need to update
the CPU according to the data we got from the freshly started QEMU.
Otherwise we don't know whether the CPU we got from QEMU matches the one
before migration. We just need to keep the original CPU in
priv->origCPU.

Messed up by me in v3.4.0-58-g8e34f478.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
上级 e8589963
...@@ -3989,20 +3989,16 @@ qemuProcessUpdateLiveGuestCPU(virQEMUDriverPtr driver, ...@@ -3989,20 +3989,16 @@ qemuProcessUpdateLiveGuestCPU(virQEMUDriverPtr driver,
if (qemuProcessVerifyCPUFeatures(def, cpu) < 0) if (qemuProcessVerifyCPUFeatures(def, cpu) < 0)
goto cleanup; goto cleanup;
/* Don't update the CPU if we already did so when starting a domain
* during migration, restore or snapshot revert. */
if (priv->origCPU) {
ret = 0;
goto cleanup;
}
if (!(orig = virCPUDefCopy(def->cpu))) if (!(orig = virCPUDefCopy(def->cpu)))
goto cleanup; goto cleanup;
if ((rc = virCPUUpdateLive(def->os.arch, def->cpu, cpu, disabled)) < 0) { if ((rc = virCPUUpdateLive(def->os.arch, def->cpu, cpu, disabled)) < 0) {
goto cleanup; goto cleanup;
} else if (rc == 0) { } else if (rc == 0) {
if (!virCPUDefIsEqual(def->cpu, orig, false)) /* Store the original CPU in priv if QEMU changed it and we didn't
* get the original CPU via migration, restore, or snapshot revert.
*/
if (!priv->origCPU && !virCPUDefIsEqual(def->cpu, orig, false))
VIR_STEAL_PTR(priv->origCPU, orig); VIR_STEAL_PTR(priv->origCPU, orig);
def->cpu->check = VIR_CPU_CHECK_FULL; def->cpu->check = VIR_CPU_CHECK_FULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册