From nobody Sun Feb 8 14:07:41 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1710263459565167.40638054958026; Tue, 12 Mar 2024 10:10:59 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 72B6619E9; Tue, 12 Mar 2024 13:10:58 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 520DC1E8F; Tue, 12 Mar 2024 13:07:21 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D9F681A74; Tue, 12 Mar 2024 13:07:11 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 36BD01A98 for ; Tue, 12 Mar 2024 13:07:09 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-8-MmrFqBAtOWKREC1OOlkEkA-1; Tue, 12 Mar 2024 13:07:07 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 24F258007AB for ; Tue, 12 Mar 2024 17:07:07 +0000 (UTC) Received: from orkuz (unknown [10.45.224.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD6AF1C060CE for ; Tue, 12 Mar 2024 17:07:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: MmrFqBAtOWKREC1OOlkEkA-1 From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH 02/22] qemu: domain: Check arch in qemuDomainMakeCPUMigratable Date: Tue, 12 Mar 2024 18:06:42 +0100 Message-ID: <413c7b8d6e52c6dcdada845798a133f152af55bb.1710262622.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: BQOWY4GU7PGLCFALAIH5JJLQ62H26SQ3 X-Message-ID-Hash: BQOWY4GU7PGLCFALAIH5JJLQ62H26SQ3 X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1710263460059100001 The content is arch specific and checking for Icelake-Server CPU model on non-x86 architectures does not make sense. Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- src/qemu/qemu_domain.c | 14 ++++++++++---- src/qemu/qemu_domain.h | 3 ++- src/qemu/qemu_migration_cookie.c | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8c85446c3d..31a6509166 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6644,10 +6644,15 @@ qemuDomainDefCopy(virQEMUDriver *driver, =20 =20 int -qemuDomainMakeCPUMigratable(virCPUDef *cpu) +qemuDomainMakeCPUMigratable(virArch arch, + virCPUDef *cpu) { - if (cpu->mode =3D=3D VIR_CPU_MODE_CUSTOM && - STREQ_NULLABLE(cpu->model, "Icelake-Server")) { + if (cpu->mode !=3D VIR_CPU_MODE_CUSTOM || + !cpu->model || + !ARCH_IS_X86(arch)) + return 0; + + if (STREQ(cpu->model, "Icelake-Server")) { /* Originally Icelake-Server CPU model contained pconfig CPU featu= re. * It was never actually enabled and thus it was removed. To enable * migration to QEMU 3.1.0 (with both new and old libvirt), we @@ -6837,7 +6842,8 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver, return -1; } =20 - if (def->cpu && qemuDomainMakeCPUMigratable(def->cpu) < 0) + if (def->cpu && + qemuDomainMakeCPUMigratable(def->os.arch, def->cpu) < 0) return -1; =20 /* Old libvirt doesn't understand