From nobody Sat Feb 7 09:37:01 2026 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534432358531973.9676229306872; Thu, 16 Aug 2018 08:12:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D86D920277; Thu, 16 Aug 2018 15:12:35 +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 58BEF100194B; Thu, 16 Aug 2018 15:12:35 +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 768D018037EF; Thu, 16 Aug 2018 15:12:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7GFCWJg024315 for ; Thu, 16 Aug 2018 11:12:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B3BC2156715; Thu, 16 Aug 2018 15:12:32 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4EBD2156712; Thu, 16 Aug 2018 15:12:31 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 16 Aug 2018 16:12:25 +0100 Message-Id: <20180816151227.10886-2-berrange@redhat.com> In-Reply-To: <20180816151227.10886-1-berrange@redhat.com> References: <20180816151227.10886-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] qemu: record the QEMU default machine in capabilities 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 16 Aug 2018 15:12:37 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 We don't honour the QEMU default machine type anymore, always using the libvirt chosen default instead. The QEMU argv parser, however, will need to know the exacty QEMU default, so we must record that info. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Ferlan --- src/qemu/qemu_capabilities.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e6e199b2c6..a0a1b97f1d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -515,6 +515,7 @@ struct virQEMUCapsMachineType { char *alias; unsigned int maxCpus; bool hotplugCpus; + bool qemuDefault; }; =20 typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData; @@ -2324,8 +2325,10 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuC= aps, preferredIdx =3D qemuCaps->nmachineTypes - 1; } =20 - if (machines[i]->isDefault) + if (machines[i]->isDefault) { + mach->qemuDefault =3D true; defIdx =3D qemuCaps->nmachineTypes - 1; + } } =20 /* @@ -3355,7 +3358,7 @@ virQEMUCapsCachePrivFree(void *privData) * ... * * ... - * + * * ... * */ @@ -3520,6 +3523,11 @@ virQEMUCapsLoadCache(virArch hostArch, if (STREQ_NULLABLE(str, "yes")) qemuCaps->machineTypes[i].hotplugCpus =3D true; VIR_FREE(str); + + str =3D virXMLPropString(nodes[i], "default"); + if (STREQ_NULLABLE(str, "yes")) + qemuCaps->machineTypes[i].qemuDefault =3D true; + VIR_FREE(str); } } VIR_FREE(nodes); @@ -3768,6 +3776,8 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) qemuCaps->machineTypes[i].alias); if (qemuCaps->machineTypes[i].hotplugCpus) virBufferAddLit(&buf, " hotplugCpus=3D'yes'"); + if (qemuCaps->machineTypes[i].qemuDefault) + virBufferAddLit(&buf, " default=3D'yes'"); virBufferAsprintf(&buf, " maxCpus=3D'%u'/>\n", qemuCaps->machineTypes[i].maxCpus); } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list