From nobody Fri Dec 19 06:33:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1591403351; cv=none; d=zohomail.com; s=zohoarc; b=WHfSuvZc21ff8AZkNCsa3RkiPH3IjSy551viU48OZtCWvrqQJc4VrhXTw58KpB5VTrPpiO9UpEQKITo0XvN7SJ99TvqMn2cTijbAyNUybLSb8tlRxEtuNtPimuN7kj8+w1zxnLgc7LL42JIvCTDUpvX8jdR/Pm1++DrScJ/Ldu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591403351; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rNp+bqNEyXZ8pKGyVm2PF1IaAjeq3ldu2im+sTX1BfA=; b=CeoFO96bAS+zjWjvoHKQ/Zh5mLUvdf3QaV0+CFmkAUg1WZVWBh8tABtR87yGj30ibLIZoSwlvdY5b8Y/WxbzFJd+I0zsKWEVRUPnx7AlqPacWblQrUqEPCAAy6Fj6oOH1JuoBa0EyAF9qRDhi8pVQchxzLsEeA/rWzKtu2ZEk4o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1591403351891979.3609565257636; Fri, 5 Jun 2020 17:29:11 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-110-4GzgUE2BMbWkcmgkmkAYtw-1; Fri, 05 Jun 2020 20:24:27 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A826F835B92; Sat, 6 Jun 2020 00:24:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 859DD7F4EA; Sat, 6 Jun 2020 00:24:21 +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 554DC181ACAD; Sat, 6 Jun 2020 00:24:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 055IWKkZ030112 for ; Fri, 5 Jun 2020 14:32:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id D1F051972B; Fri, 5 Jun 2020 18:32:20 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.40.193.140]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7AFA9108D9 for ; Fri, 5 Jun 2020 18:32:18 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id D9AA6245144; Fri, 5 Jun 2020 20:31:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591403350; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rNp+bqNEyXZ8pKGyVm2PF1IaAjeq3ldu2im+sTX1BfA=; b=cd/BFeddI6NocpnUuomgAzTKv6h+toGwIk2oTZBd+lf6/bQ7kIpIJDkfAe3xoIimm47Fc4 7r9Odt6P3PzwOY6BaKd1pMcXoE6KDVO/nNMJNkU+CaUC7FGQzpbsE53BGuQF5fPF+IyHRS R1BlA9EnuE0bsmkjKChMvvIiI553lpg= X-MC-Unique: 4GzgUE2BMbWkcmgkmkAYtw-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 8/9] qemu: Fill default value in //cpu/@migratable attribute Date: Fri, 5 Jun 2020 20:31:30 +0200 Message-Id: <1c84c692f75dd612e5e606d13231576ef61a38eb.1591380620.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Before QEMU introduced migratable CPU property, "-cpu host" included all features that could be enabled on the host, even those which would block migration. In other words, the default was equivalent to migratable=3Doff. When the migratable property was introduced, the default changed to migratable=3Don. Let's record the default in domain XML. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 14 ++++++++++++-- .../migration-in-params-in.xml | 2 +- .../migration-out-params-in.xml | 2 +- .../qemuxml2xmloutdata/cpu-check-default-none.xml | 2 +- tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml | 2 +- .../cpu-host-passthrough-features.xml | 2 +- tests/qemuxml2xmloutdata/kvm-features.xml | 2 +- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3239ac1a52..2dad823a86 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4792,7 +4792,8 @@ qemuDomainDefSetDefaultCPU(virDomainDefPtr def, =20 =20 static int -qemuDomainDefCPUPostParse(virDomainDefPtr def) +qemuDomainDefCPUPostParse(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps) { virCPUFeatureDefPtr sveFeature =3D NULL; bool sveVectorLengthsProvided =3D false; @@ -4888,6 +4889,15 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def) } } =20 + if (qemuCaps && + def->cpu->mode =3D=3D VIR_CPU_MODE_HOST_PASSTHROUGH && + !def->cpu->migratable) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE)) + def->cpu->migratable =3D VIR_TRISTATE_SWITCH_ON; + else if (ARCH_IS_X86(def->os.arch)) + def->cpu->migratable =3D VIR_TRISTATE_SWITCH_OFF; + } + /* Nothing to be done if only CPU topology is specified. */ if (def->cpu->mode =3D=3D VIR_CPU_MODE_CUSTOM && !def->cpu->model) @@ -5033,7 +5043,7 @@ qemuDomainDefPostParse(virDomainDefPtr def, if (qemuDomainDefVcpusPostParse(def) < 0) return -1; =20 - if (qemuDomainDefCPUPostParse(def) < 0) + if (qemuDomainDefCPUPostParse(def, qemuCaps) < 0) return -1; =20 if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0) diff --git a/tests/qemustatusxml2xmldata/migration-in-params-in.xml b/tests= /qemustatusxml2xmldata/migration-in-params-in.xml index fdc2d39173..93450c38d5 100644 --- a/tests/qemustatusxml2xmldata/migration-in-params-in.xml +++ b/tests/qemustatusxml2xmldata/migration-in-params-in.xml @@ -277,7 +277,7 @@ - + diff --git a/tests/qemustatusxml2xmldata/migration-out-params-in.xml b/test= s/qemustatusxml2xmldata/migration-out-params-in.xml index 1956eac120..c1daab4dee 100644 --- a/tests/qemustatusxml2xmldata/migration-out-params-in.xml +++ b/tests/qemustatusxml2xmldata/migration-out-params-in.xml @@ -291,7 +291,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/cpu-check-default-none.xml b/tests/qe= muxml2xmloutdata/cpu-check-default-none.xml index ddffb2f15b..9f6b043f2c 100644 --- a/tests/qemuxml2xmloutdata/cpu-check-default-none.xml +++ b/tests/qemuxml2xmloutdata/cpu-check-default-none.xml @@ -8,7 +8,7 @@ hvm - + destroy restart diff --git a/tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml b/tests/qemuxml= 2xmloutdata/cpu-host-kvmclock.xml index 6d8fa367c7..9414c41c7a 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-kvmclock.xml @@ -8,7 +8,7 @@ hvm - + diff --git a/tests/qemuxml2xmloutdata/cpu-host-passthrough-features.xml b/t= ests/qemuxml2xmloutdata/cpu-host-passthrough-features.xml index 9a961eb1a1..bd1e50ef6a 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-passthrough-features.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-passthrough-features.xml @@ -13,7 +13,7 @@ hvm - + diff --git a/tests/qemuxml2xmloutdata/kvm-features.xml b/tests/qemuxml2xmlo= utdata/kvm-features.xml index 7c554671b3..9c53eb4630 100644 --- a/tests/qemuxml2xmloutdata/kvm-features.xml +++ b/tests/qemuxml2xmloutdata/kvm-features.xml @@ -15,7 +15,7 @@ - + destroy restart --=20 2.27.0