From nobody Mon Apr 29 02:01:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498053656945110.98301930599052; Wed, 21 Jun 2017 07:00:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 519C47F3ED; Wed, 21 Jun 2017 14:00:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B2EE177650; Wed, 21 Jun 2017 14:00:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8F4CF4E981; Wed, 21 Jun 2017 14:00:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5LE0pIU010812 for ; Wed, 21 Jun 2017 10:00:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 02C856C1FB; Wed, 21 Jun 2017 14:00:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC0DC6C1F7 for ; Wed, 21 Jun 2017 14:00:46 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 4F34F1000DB; Wed, 21 Jun 2017 16:00:45 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 519C47F3ED Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 519C47F3ED From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 21 Jun 2017 16:00:44 +0200 Message-Id: <7e78b7e96897ebf76856d33f4a3b856ac620919d.1498053644.git.jdenemar@redhat.com> Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: Do not skip virCPUUpdateLive if priv->origCPU is set X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 21 Jun 2017 14:00:55 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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-g8e34f4781. Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 63119396b..d669dfb32 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3989,20 +3989,16 @@ qemuProcessUpdateLiveGuestCPU(virQEMUDriverPtr driv= er, if (qemuProcessVerifyCPUFeatures(def, cpu) < 0) goto cleanup; =20 - /* Don't update the CPU if we already did so when starting a domain - * during migration, restore or snapshot revert. */ - if (priv->origCPU) { - ret =3D 0; - goto cleanup; - } - if (!(orig =3D virCPUDefCopy(def->cpu))) goto cleanup; =20 if ((rc =3D virCPUUpdateLive(def->os.arch, def->cpu, cpu, disabled= )) < 0) { goto cleanup; } else if (rc =3D=3D 0) { - if (!virCPUDefIsEqual(def->cpu, orig, false)) + /* Store the original CPU in priv if QEMU changed it and we di= dn't + * get the original CPU via migration, restore, or snapshot re= vert. + */ + if (!priv->origCPU && !virCPUDefIsEqual(def->cpu, orig, false)) VIR_STEAL_PTR(priv->origCPU, orig); =20 def->cpu->check =3D VIR_CPU_CHECK_FULL; --=20 2.13.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list