From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111795; cv=none; d=zoho.com; s=zohoarc; b=FW06Xm/+QDWTxdd+ZzVkdrhh1sD7kon9HGxu/sLREDU1mJUNtA871Sfyo8hTf+Sp1EwF/t60NvTWjhdn9V5+n1Nu0toix6IKGZMkhHquOpgUw3XugHMBi1hShjWEImgGyr615HGghD+JmJmfwUZ7grbolaiPRMim3TNrjeez+wc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111795; 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:ARC-Authentication-Results; bh=wDIRhqP+zfs+Q9t/h0ud0lVARVNTzrfoLyzcsDhg9J4=; b=J3x+EYbjVDLCV7bn1dQViFCC5PllSTZGh/cHmelz62x7t+c7Q9qleby6+RDW0aeekmcwjhkeqEh97WT4mGj3qyUWOWmVjR7Xm8GiIAb7fIAZDNnjXIIKCrthPgJ9rsZSAMZ+In8b345ds3xzLdwNP32adtfDlF7vPqTLII75TNA= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 157011179533421.960951229510556; Thu, 3 Oct 2019 07:09:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B71EC8E594; Thu, 3 Oct 2019 14:09:53 +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 8DF345D9DC; Thu, 3 Oct 2019 14:09: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 2288D1803518; Thu, 3 Oct 2019 14:09:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5lv9021000 for ; Thu, 3 Oct 2019 10:05:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5FD1A6012C; Thu, 3 Oct 2019 14:05:47 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 350D76013A for ; Thu, 3 Oct 2019 14:05:44 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 3EB4B100414; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:19 +0200 Message-Id: <6ce2fcd739929b92961fec74444cf7c458d5c48e.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/22] conf: Use VIR_AUTO* in virDomainCapsCPUModelsAdd 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-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 03 Oct 2019 14:09:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_capabilities.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 1000d8b969..37e767d5c9 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -246,25 +246,20 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr c= puModels, virDomainCapsCPUUsable usable, char **blockers) { - char *nameCopy =3D NULL; - char **blockersCopy =3D NULL; + VIR_AUTOFREE(char *) nameCopy =3D NULL; + VIR_AUTOSTRINGLIST blockersCopy =3D NULL; =20 if (VIR_STRNDUP(nameCopy, name, nameLen) < 0) - goto error; + return -1; =20 if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) - goto error; + return -1; =20 if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy, usable, &blockersCopy) < 0) - goto error; + return -1; =20 return 0; - - error: - VIR_FREE(nameCopy); - virStringListFree(blockersCopy); - return -1; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111798; cv=none; d=zoho.com; s=zohoarc; b=nP8XkG0xkaTT2EPj+PiHNx5tT4MDqdtQHMdFVq/y6ho5SWcKKxKNJry/1NM9fydArHAoKD5DltnyVI2GrdCfHzaaiZGcgjWEcTxnnD2TUt3YmeX5vmBZM8YfEnJo2d57ViWMOMo9hhmj2LKwvn4WBaSCHTm9c+5Iwjlr7/UNa2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111798; 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:ARC-Authentication-Results; bh=L3sO28XMl7cGF4b64IhATyNy5eLM+5iL9ybtoA1ihzA=; b=Tk+arWf6wQe37Lo88H6PJ4faPerME/J7gM4TFvxyCgNORiO+eIV5K6purhNRgtHW+IRKQxBAKumAr7iqQV0nArSeSXQHZmxN782DiBtaxOVEuCFXIefsDWxq/bruY5vZxsn22iu3x3Z/bzJc4EIICO7zLxe74lzK1wOBbwZ8nz0= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111798712888.0339541217505; Thu, 3 Oct 2019 07:09:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1897F898118; Thu, 3 Oct 2019 14:09:57 +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 E8FEA5D9DC; Thu, 3 Oct 2019 14:09:56 +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 AD18D6B49E; Thu, 3 Oct 2019 14:09:56 +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 x93E5lrI021007 for ; Thu, 3 Oct 2019 10:05:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 86BC6194B2; Thu, 3 Oct 2019 14:05:47 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C1F2196AE for ; Thu, 3 Oct 2019 14:05:44 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 45E161005D5; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:20 +0200 Message-Id: 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 Subject: [libvirt] [PATCH 02/22] conf: Drop nameLen parameter from virDomainCapsCPUModelsAdd 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-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Thu, 03 Oct 2019 14:09:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" All callers use nameLen =3D=3D -1 anyway. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_capabilities.c | 7 +++---- src/conf/domain_capabilities.h | 1 - src/qemu/qemu_capabilities.c | 2 +- tests/cputest.c | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 37e767d5c9..fa0b9dfc71 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -171,7 +171,7 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr ol= d) =20 for (i =3D 0; i < old->nmodels; i++) { if (virDomainCapsCPUModelsAdd(cpuModels, - old->models[i].name, -1, + old->models[i].name, old->models[i].usable, old->models[i].blockers) < 0) goto error; @@ -204,7 +204,7 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr = old, continue; =20 if (virDomainCapsCPUModelsAdd(cpuModels, - old->models[i].name, -1, + old->models[i].name, old->models[i].usable, old->models[i].blockers) < 0) goto error; @@ -242,14 +242,13 @@ virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModels= Ptr cpuModels, int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, - ssize_t nameLen, virDomainCapsCPUUsable usable, char **blockers) { VIR_AUTOFREE(char *) nameCopy =3D NULL; VIR_AUTOSTRINGLIST blockersCopy =3D NULL; =20 - if (VIR_STRNDUP(nameCopy, name, nameLen) < 0) + if (VIR_STRDUP(nameCopy, name) < 0) return -1; =20 if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 4756af38e9..7ff2181eda 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -201,7 +201,6 @@ int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUMode= lsPtr cpuModels, char ***blockers); int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, - ssize_t nameLen, virDomainCapsCPUUsable usable, char **blockers); virDomainCapsCPUModelPtr diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3b50576a2b..806d102efd 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1871,7 +1871,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, } =20 for (i =3D 0; i < count; i++) { - if (virDomainCapsCPUModelsAdd(cpus, name[i], -1, usable, NULL) < 0) + if (virDomainCapsCPUModelsAdd(cpus, name[i], usable, NULL) < 0) return -1; } =20 diff --git a/tests/cputest.c b/tests/cputest.c index 7037bcc8bd..403d23b961 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -854,7 +854,7 @@ cpuTestUpdateLive(const void *arg) usable =3D hvModel->usable; } =20 - if (virDomainCapsCPUModelsAdd(models, expected->model, -1, + if (virDomainCapsCPUModelsAdd(models, expected->model, usable, blockers) < 0) goto cleanup; =20 @@ -964,7 +964,7 @@ cpuTestInitModels(const char **list) return NULL; =20 for (model =3D list; *model; model++) { - if (virDomainCapsCPUModelsAdd(cpus, *model, -1, + if (virDomainCapsCPUModelsAdd(cpus, *model, VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL= ) < 0) goto error; } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111553; cv=none; d=zoho.com; s=zohoarc; b=Ns4qjYmEbZxl+aRw/0b9LUfg3f8rnF+FCtDVTTKtGi9o/VYxQpI2xJXnH5IJBOAnydJBPEY0d+KyJx5/2HNVfDEWGiKmjUZHc3BPb75tXSxVeEldOnfF42wZYbD0VRY62Rbf5w/UqSiNUQ8o8rlzaM9+AJxPPDk+9ncU31y1UDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111553; 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:ARC-Authentication-Results; bh=soGrObgf6+jXXAYa0jDL7u0jhjuQQOD+NOHgEvPP5ZM=; b=E+Tff7Iq1xmMXvjSC/W66CiTriMysIX2Hm56bptnXeN87DhRAjUlWhfLDYwnM0NYSruqgqkFLSCfsW5mUhiugYpMmwYw3XDO7LtWQAr51PZwvMLRvyWdjJHml8Xfw0zR7ki3f4V2SMFCiFzb3qgxgAhGG1jKlAO68EKuyIrsZTM= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111553361524.8660113263027; Thu, 3 Oct 2019 07:05:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3EFF641C9; Thu, 3 Oct 2019 14:05:50 +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 52EBA5C226; Thu, 3 Oct 2019 14:05:50 +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 7CDE762CF9; Thu, 3 Oct 2019 14:05:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5luZ020997 for ; Thu, 3 Oct 2019 10:05:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 52AE11001B23; Thu, 3 Oct 2019 14:05:47 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01F561001B13 for ; Thu, 3 Oct 2019 14:05:44 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 4C5061005D6; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:21 +0200 Message-Id: <578c6b45a5509fe060bc96b51265186abc1a5e9f.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/22] qemu: Copy CPU models in virQEMUCapsGetCPUDefinitions 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-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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 03 Oct 2019 14:05:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Rather than returning a direct pointer the list stored in qemuCaps the function now creates a new copy of the CPU models list. The main purpose of this seemingly useless change is to update callers to free the result returned by virQEMUCapsGetCPUDefinitions because the internals of this function will change significantly in the following patches. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 23 ++++++++++++++++++----- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 7 +++++-- tests/cputest.c | 1 - 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 806d102efd..705e3a87b0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1883,10 +1883,17 @@ virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { + virDomainCapsCPUModelsPtr cpuModels; + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - return qemuCaps->kvmCPUModels; + cpuModels =3D qemuCaps->kvmCPUModels; else - return qemuCaps->tcgCPUModels; + cpuModels =3D qemuCaps->tcgCPUModels; + + if (!cpuModels) + return NULL; + + return virDomainCapsCPUModelsCopy(cpuModels); } =20 =20 @@ -3084,6 +3091,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, virCPUDefPtr cpu, bool migratable) { + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; virCPUDataPtr data =3D NULL; int ret =3D -1; =20 @@ -3093,7 +3101,9 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, if (!(data =3D virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratab= le))) goto cleanup; =20 - if (cpuDecode(cpu, data, virQEMUCapsGetCPUDefinitions(qemuCaps, type))= < 0) + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type); + + if (cpuDecode(cpu, data, cpuModels) < 0) goto cleanup; =20 ret =3D 0; @@ -3176,10 +3186,13 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, if ((rc =3D virQEMUCapsInitCPUModel(qemuCaps, type, cpu, false)) < 0) { goto error; } else if (rc =3D=3D 1) { + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; + VIR_DEBUG("No host CPU model info from QEMU; probing host CPU dire= ctly"); =20 - hostCPU =3D virQEMUCapsProbeHostCPU(hostArch, - virQEMUCapsGetCPUDefinitions(qem= uCaps, type)); + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type); + hostCPU =3D virQEMUCapsProbeHostCPU(hostArch, cpuModels); + if (!hostCPU || virCPUDefCopyModelFilter(cpu, hostCPU, true, virQEMUCapsCPUFilterFeatures, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 95fe844c34..9e681a22b3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13754,7 +13754,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, virQEMUCapsPtr qemuCaps =3D NULL; virArch arch; virDomainVirtType virttype; - virDomainCapsCPUModelsPtr cpuModels; + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; bool migratable; virCPUDefPtr cpu =3D NULL; char *cpustr =3D NULL; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a50cd54393..9405bdc3f9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6133,6 +6133,8 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, =20 /* nothing to update for host-passthrough */ if (def->cpu->mode !=3D VIR_CPU_MODE_HOST_PASSTHROUGH) { + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; + if (def->cpu->check =3D=3D VIR_CPU_CHECK_PARTIAL && virCPUCompare(caps->host.arch, virQEMUCapsGetHostModel(qemuCaps, def->virtType, @@ -6145,8 +6147,9 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, VIR_QEMU_CAPS_HOST_CPU_MI= GRATABLE)) < 0) return -1; =20 - if (virCPUTranslate(def->os.arch, def->cpu, - virQEMUCapsGetCPUDefinitions(qemuCaps, def->vi= rtType)) < 0) + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType= ); + + if (virCPUTranslate(def->os.arch, def->cpu, cpuModels) < 0) return -1; =20 def->cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; diff --git a/tests/cputest.c b/tests/cputest.c index 403d23b961..40b843dd8f 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -542,7 +542,6 @@ cpuTestGetCPUModels(const struct data *data, return -1; =20 *models =3D virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM= ); - virObjectRef(*models); =20 virObjectUnref(qemuCaps); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111690; cv=none; d=zoho.com; s=zohoarc; b=nIOLLXxMFHdhYAWXQ1PDiRbCKjkOV82zYGjwbKMuKlR7XS6qnd5HT7K8zs+I0HoV04eyul6kwViA6aEislyorOGIbLpB/ULMOrabA+QZmQyoYyfFKLbJ8IcjBR4VX1pEfNUpDlpRBl0JRv8oZrsyoC3J6ILQPmM9Dc9iJMk+cSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111690; 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:ARC-Authentication-Results; bh=TJgFusx3Q+OjDTIMlDLVrvuWuJP1kRVyrb6YXwUMgXk=; b=K1rIjw5FnqAYMrYYI5F8xApwvtQw1ILVSaGvQSfcVrlqpYoEsf6jF8qXSHdcuaGQvBJw3B98fF/d8YqPRt6Hn/Q4DWCPuCC8q6SlZneML7xu5C3Y2cG4lZQO6LKsviPoO302OTb0OMwprl4ZVoeIMXBD3EtCGc2/xhaDGkhyZcg= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111690532842.9296113872907; Thu, 3 Oct 2019 07:08:10 -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 51CC810CC1FE; Thu, 3 Oct 2019 14:08:08 +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 1A0305D721; Thu, 3 Oct 2019 14:08:08 +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 BF4B918005A0; Thu, 3 Oct 2019 14:08:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5l1P021012 for ; Thu, 3 Oct 2019 10:05:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE24C5C22C; Thu, 3 Oct 2019 14:05:47 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D0F65C290 for ; Thu, 3 Oct 2019 14:05:44 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 51B0E1005D7; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:22 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/22] qemu: Filter models in virQEMUCapsGetCPUDefinitions 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-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.6.2 (mx1.redhat.com [10.5.110.65]); Thu, 03 Oct 2019 14:08:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Some callers of virQEMUCapsGetCPUDefinitions will need to filter the returned list of CPU models. Let's add the filtering parameters directly to virQEMUCapsGetCPUDefinitions to avoid copying the CPU models list twice. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 11 ++++++++--- src/qemu/qemu_capabilities.h | 4 +++- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 2 +- tests/cputest.c | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 705e3a87b0..dac3d3b633 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1881,7 +1881,9 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, =20 virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, - virDomainVirtType type) + virDomainVirtType type, + const char **modelWhitelist, + const char **modelBlacklist) { virDomainCapsCPUModelsPtr cpuModels; =20 @@ -1893,6 +1895,9 @@ virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, if (!cpuModels) return NULL; =20 + if (modelWhitelist || modelBlacklist) + return virDomainCapsCPUModelsFilter(cpuModels, modelWhitelist, mod= elBlacklist); + return virDomainCapsCPUModelsCopy(cpuModels); } =20 @@ -3101,7 +3106,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, if (!(data =3D virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratab= le))) goto cleanup; =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type); + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, NULL); =20 if (cpuDecode(cpu, data, cpuModels) < 0) goto cleanup; @@ -3190,7 +3195,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, =20 VIR_DEBUG("No host CPU model info from QEMU; probing host CPU dire= ctly"); =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type); + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, N= ULL); hostCPU =3D virQEMUCapsProbeHostCPU(hostArch, cpuModels); =20 if (!hostCPU || diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 5e990ce01e..f1510f3a7b 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -564,7 +564,9 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCap= s, size_t count, virDomainCapsCPUUsable usable); virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemu= Caps, - virDomainVirtType t= ype); + virDomainVirtType t= ype, + const char **modelW= hitelist, + const char **modelB= lacklist); virDomainCapsCPUModelsPtr virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mo= n); =20 typedef enum { diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9e681a22b3..265e10b466 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13780,7 +13780,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, if (!qemuCaps) goto cleanup; =20 - if (!(cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, virttype)) = || + if (!(cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, virttype, N= ULL, NULL)) || cpuModels->nmodels =3D=3D 0) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("QEMU '%s' does not support any CPU models for " diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9405bdc3f9..50f6df9dbd 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6147,7 +6147,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, VIR_QEMU_CAPS_HOST_CPU_MI= GRATABLE)) < 0) return -1; =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType= ); + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType= , NULL, NULL); =20 if (virCPUTranslate(def->os.arch, def->cpu, cpuModels) < 0) return -1; diff --git a/tests/cputest.c b/tests/cputest.c index 40b843dd8f..a7cac82d84 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -541,7 +541,7 @@ cpuTestGetCPUModels(const struct data *data, if (!(qemuCaps =3D cpuTestMakeQEMUCaps(data))) return -1; =20 - *models =3D virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM= ); + *models =3D virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM= , NULL, NULL); =20 virObjectUnref(qemuCaps); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111813; cv=none; d=zoho.com; s=zohoarc; b=WG8uZ6fsFAcigKpT11K6MJ77hvWFY5J9SZdUd3mnOcG3zGLdEAwYcUZC+KD0ERz/znPnPTSO2D1312pC9cBR2uWxQ0m/bWTjqOLwOl4CIuCYAgWuF/FSM+0l0wks+AfsbELI7cnuieElqjcuCuSLHfEegqvOpMejzXjalIouTOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111813; 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:ARC-Authentication-Results; bh=3WDFx0cz7ORBFGi2x3Rx437KhvtCabJWVY4FiP7tcBI=; b=fLTDFJF6EoAeUvPTqwYFTC2tlYr6drp96nR1p4FSQ7+ZO7N+Gmr4YkZsUzVgf0EvV1ZMnxG6dupHZwzT7e3fpnXNxe26qZlbASFLfA2T4YGobyaZivOFUmOwJvTffF5fWboIRIWyBBEwQBKhyV81oTzf74PltcURRPkXlD6/3AE= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111813439292.9172564868529; Thu, 3 Oct 2019 07:10:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3C4F83098432; Thu, 3 Oct 2019 14:10:11 +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 0748560C80; Thu, 3 Oct 2019 14:10:11 +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 A66DF6B5C5; Thu, 3 Oct 2019 14:10:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5pQd021091 for ; Thu, 3 Oct 2019 10:05:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CAFE5D6A9; Thu, 3 Oct 2019 14:05:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 218E95D772 for ; Thu, 3 Oct 2019 14:05:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 557D31005D8; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:23 +0200 Message-Id: <0841bc61665137fbadc7dcdda01fe373f296d96b.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/22] qemu: Use virQEMUCapsGetCPUDefinitions more 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-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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 03 Oct 2019 14:10:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index dac3d3b633..255ae8e665 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5256,24 +5256,17 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps, =20 if (virQEMUCapsIsCPUModeSupported(qemuCaps, caps, domCaps->virttype, VIR_CPU_MODE_CUSTOM)) { - virDomainCapsCPUModelsPtr filtered =3D NULL; - char **models =3D NULL; const char *blacklist[] =3D { "host", NULL }; + VIR_AUTOSTRINGLIST models =3D NULL; =20 if (virCPUGetModels(domCaps->arch, &models) >=3D 0) { - virDomainCapsCPUModelsPtr cpus; - - if (domCaps->virttype =3D=3D VIR_DOMAIN_VIRT_KVM) - cpus =3D qemuCaps->kvmCPUModels; - else - cpus =3D qemuCaps->tcgCPUModels; - - filtered =3D virDomainCapsCPUModelsFilter(cpus, - (const char **)models, - blacklist); - virStringListFree(models); + domCaps->cpu.custom =3D virQEMUCapsGetCPUDefinitions(qemuCaps, + domCaps->vi= rttype, + (const char= **)models, + blacklist); + } else { + domCaps->cpu.custom =3D NULL; } - domCaps->cpu.custom =3D filtered; } =20 return 0; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111817; cv=none; d=zoho.com; s=zohoarc; b=NZ2Gr9m9mx8KmmrhzfwsAEFuVY44j3OIPEdaOhfM+bAR2Dj3XbdMNf1LtNKTcH9MGlCIxGKTfB1oeRolJO3cPjoRUo8qHxzswdhwKBGSXo6SWhFOWDSy7/tyWImEDM074uPDVNKh7TBmxCIrW6x7FHapdv1SfqNR7IkONCfhsyQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111817; 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:ARC-Authentication-Results; bh=HZVmgZ5OO52cmCjDNITogbZg8Ny3ir3AFL1EEHCv38c=; b=St9aLXkp88kD7hjIEoNnEWJKbA0qRpc3BvmiHtg647OIaGZPFcA8Y+r10r3pMjF7xmrUqF33tXTo4VlOBSGh7ocy/A5XkewCrtljuLH8sB7KGdhqFb2AdTeVqEksOJxJzVA6jw35XOZlWVVSQv2YzBlIBygGEP6z7ClnFZpg4D0= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 157011181799441.46611533101873; Thu, 3 Oct 2019 07:10:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDB5910CC207; Thu, 3 Oct 2019 14:10:15 +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 AC5C34513; Thu, 3 Oct 2019 14:10:15 +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 551BD2551B; Thu, 3 Oct 2019 14:10:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5ppT021092 for ; Thu, 3 Oct 2019 10:05:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CB795D717; Thu, 3 Oct 2019 14:05:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21F7C5D784 for ; Thu, 3 Oct 2019 14:05:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 597361005D9; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:24 +0200 Message-Id: <1731d7154526eb959be8868caf4f8cb64efa7ad8.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/22] qemu: Use VIR_AUTOPTR in qemuMonitorJSONGetCPUDefinitions 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-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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Thu, 03 Oct 2019 14:10:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor_json.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index aa6074bc02..720cd78a23 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5527,8 +5527,8 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, qemuMonitorCPUDefInfoPtr **cpus) { int ret =3D -1; - virJSONValuePtr cmd; - virJSONValuePtr reply =3D NULL; + VIR_AUTOPTR(virJSONValue) cmd =3D NULL; + VIR_AUTOPTR(virJSONValue) reply =3D NULL; virJSONValuePtr data; qemuMonitorCPUDefInfoPtr *cpulist =3D NULL; size_t n =3D 0; @@ -5630,8 +5630,6 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, qemuMonitorCPUDefInfoFree(cpulist[i]); VIR_FREE(cpulist); } - virJSONValueFree(cmd); - virJSONValueFree(reply); return ret; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111704; cv=none; d=zoho.com; s=zohoarc; b=XywUewQk1VwErwNsyGv3T5cmaRYVGUNQjYRJBNhZVbi3iWAjeYxfDqB8Pp+3r/hea1lRDZVst03+CZtLJf3yT0PYlktWKaeFIV/yOd13hbv7aRQH7V0XL8cFpuf1SyIdR769YOmqEuFUllNVp3A3qFa9qP6mMYj7cBFL5AiLr1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111704; 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:ARC-Authentication-Results; bh=LBzTKFDMYklXSgO3tNf4cXMtA1Rf+/sPbsxBftwES3o=; b=dc2JceC6Q/R2EU11tsBXvTpQ9bruzqOV5AsDTPLKxEmq6e/LHcEjvVWQA/BT2GhuCIzJMm7spJe9ShcuZSVF0vczxsW7xWE6UL3uDb1A26s2zsUvHZRnAODxRIn4dmMgUYBLsJnj2spdCuvPixpOYicdmVrqpFrBDJQ66HVMAyQ= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111704729209.02491857562813; Thu, 3 Oct 2019 07:08:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B11B191864B; Thu, 3 Oct 2019 14:08:23 +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 16AD8425F; Thu, 3 Oct 2019 14:08:22 +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 C0DA56B4B1; Thu, 3 Oct 2019 14:08: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 x93E5nDG021048 for ; Thu, 3 Oct 2019 10:05:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 34796196AE; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B25D319D70 for ; Thu, 3 Oct 2019 14:05:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5D7F21005DA; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:25 +0200 Message-Id: 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 Subject: [libvirt] [PATCH 07/22] qemu: Introduce qemuMonitorCPUDefs struct 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-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Thu, 03 Oct 2019 14:08:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" It is a container for a CPU models list (qemuMonitorCPUDefInfo) and a number of elements in this list. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 24 ++++++---------- src/qemu/qemu_monitor.c | 39 +++++++++++++++++++------ src/qemu/qemu_monitor.h | 14 +++++++-- src/qemu/qemu_monitor_json.c | 56 ++++++++++++++---------------------- src/qemu/qemu_monitor_json.h | 2 +- tests/qemumonitorjsontest.c | 38 +++++++++--------------- 6 files changed, 89 insertions(+), 84 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 255ae8e665..b06e89a9c5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2447,40 +2447,34 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemu= Caps, virDomainCapsCPUModelsPtr virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon) { + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; virDomainCapsCPUModelsPtr models =3D NULL; - qemuMonitorCPUDefInfoPtr *cpus =3D NULL; - int ncpus =3D 0; size_t i; =20 - if ((ncpus =3D qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0) + if (qemuMonitorGetCPUDefinitions(mon, &defs) < 0) return NULL; =20 - if (!(models =3D virDomainCapsCPUModelsNew(ncpus))) + if (!(models =3D virDomainCapsCPUModelsNew(defs->ncpus))) goto error; =20 - for (i =3D 0; i < ncpus; i++) { + for (i =3D 0; i < defs->ncpus; i++) { virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; =20 - if (cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_YES) + if (defs->cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_YES) usable =3D VIR_DOMCAPS_CPU_USABLE_YES; - else if (cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_NO) + else if (defs->cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_NO) usable =3D VIR_DOMCAPS_CPU_USABLE_NO; =20 - if (virDomainCapsCPUModelsAddSteal(models, &cpus[i]->name, usable, - &cpus[i]->blockers) < 0) + if (virDomainCapsCPUModelsAddSteal(models, &defs->cpus[i]->name, u= sable, + &defs->cpus[i]->blockers) < 0) goto error; } =20 - cleanup: - for (i =3D 0; i < ncpus; i++) - qemuMonitorCPUDefInfoFree(cpus[i]); - VIR_FREE(cpus); return models; =20 error: virObjectUnref(models); - models =3D NULL; - goto cleanup; + return NULL; } =20 =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 2d46f5cfa7..62248f3362 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3521,25 +3521,48 @@ qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPt= r machine) =20 int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefInfoPtr **cpus) + qemuMonitorCPUDefsPtr *cpuDefs) { - VIR_DEBUG("cpus=3D%p", cpus); + VIR_DEBUG("cpuDefs=3D%p", cpuDefs); =20 QEMU_CHECK_MONITOR(mon); =20 - return qemuMonitorJSONGetCPUDefinitions(mon, cpus); + return qemuMonitorJSONGetCPUDefinitions(mon, cpuDefs); } =20 =20 void -qemuMonitorCPUDefInfoFree(qemuMonitorCPUDefInfoPtr cpu) +qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs) { - if (!cpu) + size_t i; + + if (!defs) return; =20 - virStringListFree(cpu->blockers); - VIR_FREE(cpu->name); - VIR_FREE(cpu); + for (i =3D 0; i < defs->ncpus; i++) { + virStringListFree(defs->cpus[i]->blockers); + VIR_FREE(defs->cpus[i]->name); + VIR_FREE(defs->cpus[i]); + } + + VIR_FREE(defs->cpus); + VIR_FREE(defs); +} + + +qemuMonitorCPUDefsPtr +qemuMonitorCPUDefsNew(size_t count) +{ + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; + + if (VIR_ALLOC(defs) < 0) + return NULL; + + if (count > 0 && VIR_ALLOC_N(defs->cpus, count) < 0) + return NULL; + + defs->ncpus =3D count; + VIR_RETURN_PTR(defs); } =20 =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index b42bdfbea8..d59bafbeda 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1101,9 +1101,19 @@ struct _qemuMonitorCPUDefInfo { char **blockers; /* NULL-terminated string list */ }; =20 +typedef struct _qemuMonitorCPUDefs qemuMonitorCPUDefs; +typedef qemuMonitorCPUDefs *qemuMonitorCPUDefsPtr; +struct _qemuMonitorCPUDefs { + size_t ncpus; + qemuMonitorCPUDefInfoPtr *cpus; +}; + int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefInfoPtr **cpus); -void qemuMonitorCPUDefInfoFree(qemuMonitorCPUDefInfoPtr cpu); + qemuMonitorCPUDefsPtr *cpuDefs); +qemuMonitorCPUDefsPtr qemuMonitorCPUDefsNew(size_t count); +void qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs); +VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorCPUDefs, qemuMonitorCPUDefsFree); + =20 typedef enum { QEMU_MONITOR_CPU_PROPERTY_BOOLEAN, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 720cd78a23..02bbefdc12 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5524,60 +5524,57 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, =20 int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefInfoPtr **cpus) + qemuMonitorCPUDefsPtr *cpuDefs) { - int ret =3D -1; + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; VIR_AUTOPTR(virJSONValue) cmd =3D NULL; VIR_AUTOPTR(virJSONValue) reply =3D NULL; virJSONValuePtr data; - qemuMonitorCPUDefInfoPtr *cpulist =3D NULL; - size_t n =3D 0; + size_t ncpus; size_t i; =20 - *cpus =3D NULL; + *cpuDefs =3D NULL; =20 if (!(cmd =3D qemuMonitorJSONMakeCommand("query-cpu-definitions", NULL= ))) return -1; =20 if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; + return -1; =20 /* Urgh, some QEMU architectures have the query-cpu-definitions * command, but return 'GenericError' with string "Not supported", * instead of simply omitting the command entirely :-( */ - if (qemuMonitorJSONHasError(reply, "GenericError")) { - ret =3D 0; - goto cleanup; - } + if (qemuMonitorJSONHasError(reply, "GenericError")) + return 0; =20 if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0) - goto cleanup; + return -1; =20 data =3D virJSONValueObjectGetArray(reply, "return"); - n =3D virJSONValueArraySize(data); + ncpus =3D virJSONValueArraySize(data); =20 - if (VIR_ALLOC_N(cpulist, n) < 0) - goto cleanup; + if (!(defs =3D qemuMonitorCPUDefsNew(ncpus))) + return -1; =20 - for (i =3D 0; i < n; i++) { + for (i =3D 0; i < defs->ncpus; i++) { virJSONValuePtr child =3D virJSONValueArrayGet(data, i); const char *tmp; qemuMonitorCPUDefInfoPtr cpu; =20 if (VIR_ALLOC(cpu) < 0) - goto cleanup; + return -1; =20 - cpulist[i] =3D cpu; + defs->cpus[i] =3D cpu; =20 if (!(tmp =3D virJSONValueObjectGetString(child, "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("query-cpu-definitions reply data was missing= 'name'")); - goto cleanup; + return -1; } =20 if (VIR_STRDUP(cpu->name, tmp) < 0) - goto cleanup; + return -1; =20 if (virJSONValueObjectHasKey(child, "unavailable-features")) { virJSONValuePtr blockers; @@ -5590,7 +5587,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unavailable-features in query-cpu-defini= tions " "reply data was not an array")); - goto cleanup; + return -1; } =20 len =3D virJSONValueArraySize(blockers); @@ -5602,7 +5599,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, =20 cpu->usable =3D VIR_TRISTATE_BOOL_NO; if (VIR_ALLOC_N(cpu->blockers, len + 1) < 0) - goto cleanup; + return -1; =20 for (j =3D 0; j < len; j++) { virJSONValuePtr blocker =3D virJSONValueArrayGet(blockers,= j); @@ -5611,26 +5608,17 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unexpected value in unavailable-feat= ures " "array")); - goto cleanup; + return -1; } =20 if (VIR_STRDUP(cpu->blockers[j], virJSONValueGetString(blo= cker)) < 0) - goto cleanup; + return -1; } } } =20 - ret =3D n; - *cpus =3D cpulist; - cpulist =3D NULL; - - cleanup: - if (cpulist) { - for (i =3D 0; i < n; i++) - qemuMonitorCPUDefInfoFree(cpulist[i]); - VIR_FREE(cpulist); - } - return ret; + VIR_STEAL_PTR(*cpuDefs, defs); + return 0; } =20 =20 diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index b756a86350..5b8338cefb 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -376,7 +376,7 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, ATTRIBUTE_NONNULL(2); =20 int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefInfoPtr **cpus) + qemuMonitorCPUDefsPtr *cpuDefs) ATTRIBUTE_NONNULL(2); =20 int qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 8179e802c1..14d0a4e22f 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -428,10 +428,7 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaqu= e) { const testGenericData *data =3D opaque; virDomainXMLOptionPtr xmlopt =3D data->xmlopt; - int ret =3D -1; - qemuMonitorCPUDefInfoPtr *cpus =3D NULL; - int ncpus =3D 0; - size_t i; + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; VIR_AUTOPTR(qemuMonitorTest) test =3D NULL; =20 if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) @@ -453,31 +450,30 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaq= ue) " } " " ]" "}") < 0) - goto cleanup; + return -1; =20 - if ((ncpus =3D qemuMonitorGetCPUDefinitions(qemuMonitorTestGetMonitor(= test), - &cpus)) < 0) - goto cleanup; + if (qemuMonitorGetCPUDefinitions(qemuMonitorTestGetMonitor(test), &def= s) < 0) + return -1; =20 - if (ncpus !=3D 3) { + if (defs->ncpus !=3D 3) { virReportError(VIR_ERR_INTERNAL_ERROR, - "ncpus %d is not 3", ncpus); - goto cleanup; + "ncpus %zu is not 3", defs->ncpus); + return -1; } =20 #define CHECK_FULL(i, wantname, Usable) \ do { \ - if (STRNEQ(cpus[i]->name, (wantname))) { \ + if (STRNEQ(defs->cpus[i]->name, (wantname))) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "name %s is not %s", \ - cpus[i]->name, (wantname)); \ - goto cleanup; \ + defs->cpus[i]->name, (wantname)); \ + return -1; \ } \ - if (cpus[i]->usable !=3D (Usable)) { \ + if (defs->cpus[i]->usable !=3D (Usable)) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "%s: expecting usable flag %d, got %d", \ - cpus[i]->name, Usable, cpus[i]->usable); \ - goto cleanup; \ + defs->cpus[i]->name, Usable, defs->cpus[i]->usa= ble); \ + return -1; \ } \ } while (0) =20 @@ -496,13 +492,7 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaqu= e) #undef CHECK_USABLE #undef CHECK_FULL =20 - ret =3D 0; - - cleanup: - for (i =3D 0; i < ncpus; i++) - qemuMonitorCPUDefInfoFree(cpus[i]); - VIR_FREE(cpus); - return ret; + return 0; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111808; cv=none; d=zoho.com; s=zohoarc; b=FB4KOfZTVcYyR94DoBt2TTWmeZUlS6RG9zjIIAnSUljUkvVL6c09fPxExilK60V+FT7Kxyae4lbj6p2/17yaz6ZeitgGl2R5PBeM+e0IG70MFKiEnaJvlNfwWmBAi8KAZAQXAmgTCXIv8rAwEW6s44CS1MiJs+COv5xBz9W6BTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111808; 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:ARC-Authentication-Results; bh=5RgWgMSWMVih+DIFxrjd7/rQ/qLgIW8iZ3LNzYk+674=; b=e55RSxWyGLOtKFO8uIwIQsPU1Z/YA+15AzcI7GVVgRGdKJNORJoFMQ7pTAx5s2jyV6TzgPzST0WMyI3dC2uxstfdhG/yX42LomNaHPh2cTBbrlWO6PQJYJiPahyLhPwU6to8mxcd3ulqrAAsT2zqG0KXqjOobaXJgJYPh5GYh7w= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111808705616.1984664092869; Thu, 3 Oct 2019 07:10:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 752B918C8913; Thu, 3 Oct 2019 14:10:06 +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 39A31608C0; Thu, 3 Oct 2019 14:10:06 +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 CA6706B4B3; Thu, 3 Oct 2019 14:10:05 +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 x93E5ncG021035 for ; Thu, 3 Oct 2019 10:05:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 112E2194B2; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B48E7196AE for ; Thu, 3 Oct 2019 14:05:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 616DB1005DB; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:26 +0200 Message-Id: <964c4f67514d2837762f7ee824ad2ce80e0bac34.1570111135.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 Subject: [libvirt] [PATCH 08/22] qemu: Flatten qemuMonitorCPUDefs.cpus 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-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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Thu, 03 Oct 2019 14:10:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Let's store qemuMonitorCPUDefInfo directly in the array of CPUs in qemuMonitorCPUDefs rather then using an array of pointers. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 8 ++++---- src/qemu/qemu_monitor.c | 5 ++--- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 7 +------ tests/qemumonitorjsontest.c | 8 ++++---- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b06e89a9c5..74920901b3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2460,13 +2460,13 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon) for (i =3D 0; i < defs->ncpus; i++) { virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; =20 - if (defs->cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_YES) + if (defs->cpus[i].usable =3D=3D VIR_TRISTATE_BOOL_YES) usable =3D VIR_DOMCAPS_CPU_USABLE_YES; - else if (defs->cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_NO) + else if (defs->cpus[i].usable =3D=3D VIR_TRISTATE_BOOL_NO) usable =3D VIR_DOMCAPS_CPU_USABLE_NO; =20 - if (virDomainCapsCPUModelsAddSteal(models, &defs->cpus[i]->name, u= sable, - &defs->cpus[i]->blockers) < 0) + if (virDomainCapsCPUModelsAddSteal(models, &defs->cpus[i].name, us= able, + &defs->cpus[i].blockers) < 0) goto error; } =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 62248f3362..4442ef6cca 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3540,9 +3540,8 @@ qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs) return; =20 for (i =3D 0; i < defs->ncpus; i++) { - virStringListFree(defs->cpus[i]->blockers); - VIR_FREE(defs->cpus[i]->name); - VIR_FREE(defs->cpus[i]); + virStringListFree(defs->cpus[i].blockers); + VIR_FREE(defs->cpus[i].name); } =20 VIR_FREE(defs->cpus); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index d59bafbeda..7d35c97860 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1105,7 +1105,7 @@ typedef struct _qemuMonitorCPUDefs qemuMonitorCPUDefs; typedef qemuMonitorCPUDefs *qemuMonitorCPUDefsPtr; struct _qemuMonitorCPUDefs { size_t ncpus; - qemuMonitorCPUDefInfoPtr *cpus; + qemuMonitorCPUDefInfoPtr cpus; }; =20 int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 02bbefdc12..c2a2f6eee6 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5560,12 +5560,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, for (i =3D 0; i < defs->ncpus; i++) { virJSONValuePtr child =3D virJSONValueArrayGet(data, i); const char *tmp; - qemuMonitorCPUDefInfoPtr cpu; - - if (VIR_ALLOC(cpu) < 0) - return -1; - - defs->cpus[i] =3D cpu; + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + i; =20 if (!(tmp =3D virJSONValueObjectGetString(child, "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 14d0a4e22f..3413dee701 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -463,16 +463,16 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaq= ue) =20 #define CHECK_FULL(i, wantname, Usable) \ do { \ - if (STRNEQ(defs->cpus[i]->name, (wantname))) { \ + if (STRNEQ(defs->cpus[i].name, (wantname))) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "name %s is not %s", \ - defs->cpus[i]->name, (wantname)); \ + defs->cpus[i].name, (wantname)); \ return -1; \ } \ - if (defs->cpus[i]->usable !=3D (Usable)) { \ + if (defs->cpus[i].usable !=3D (Usable)) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "%s: expecting usable flag %d, got %d", \ - defs->cpus[i]->name, Usable, defs->cpus[i]->usa= ble); \ + defs->cpus[i].name, Usable, defs->cpus[i].usabl= e); \ return -1; \ } \ } while (0) --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111695; cv=none; d=zoho.com; s=zohoarc; b=ZAdaeL/tGCmW6ht/OcqMnA4urYwqLCMejBTW2dAJTrMFqA4r4rP9NCJp7BpeO1nixhs7PuU5HfemANQ5GF4K+Rw9iuy0t+tAhZtT//5hM3gICz4hmy504r14NhOXgN/uJOak3pgUMWbsDkiivGSPipprRtTazNEioCpSVHD3j3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111695; 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:ARC-Authentication-Results; bh=DNP5YfZdyAQKzHEa1/OJDR6HO8RxUWxcWD98K0mprFY=; b=UuEtpfJ7AGeGBbvQfhpSUAD7SBhC7INzMkQgJ6GRqC046yA70jzrE775kFvkiASbBq7H4qySQPEPGVgR6094p835/i8q/LyHDT1YPsV0aNg1cHT/1bAg5Mq6sjuaxM3Xs7y/OgkutLhDfrpOa5CT4SXGLMD5TGuhzyfDxntza8U= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111695917747.7622738791488; Thu, 3 Oct 2019 07:08:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93D6310DCCAB; Thu, 3 Oct 2019 14:08:13 +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 5C3CF60632; Thu, 3 Oct 2019 14:08:13 +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 0651B6B49D; Thu, 3 Oct 2019 14:08:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5nps021033 for ; Thu, 3 Oct 2019 10:05:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 101C3601A3; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8C276012C for ; Thu, 3 Oct 2019 14:05:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 64EE31005DC; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:27 +0200 Message-Id: <82fd33a1090385abf642fc7795651374c5239bbd.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/22] build: Export virStringListCopy internal API 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-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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Thu, 03 Oct 2019 14:08:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/libvirt_private.syms | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 7b681fac64..b8e118db0d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3078,6 +3078,7 @@ virStringIsEmpty; virStringIsPrintable; virStringListAdd; virStringListAutoFree; +virStringListCopy; virStringListFree; virStringListFreeCount; virStringListGetFirstWithPrefix; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111699; cv=none; d=zoho.com; s=zohoarc; b=WBxWhz28Dl6q+OaxeEU+zNJElCljiMZCEtRmd9fcxpuv6E6MSf5DAmZG66d1WFIoHIqQXN+GRXDG1NGfQTqFni3/tZOey9btuItNEFQ00H+nr/uxvQkmlzt9pW/uHQkkYrxuPfiViXMwEa0/+1RC8JaOVYuIrJ9SlRFRoIFhXvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111699; 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:ARC-Authentication-Results; bh=lzPDSCGW21xaA8q4naX3gV2VoSdC5Ws09yRmHZGk8Ps=; b=eGIpRSFFlHq+3zc10XHH7pIin26A+xsIGHQJOZp6juOPmCvjCd4yHep97zrOITrpE4mC4xZEDaVRhnw40s5tdfCDNNIG6iCWmiqZwR1IPnSPjinZAABJ1Db6oqWZ5ZOV+cB4mOWgS9/IioqQoqAI3Uo31h88fhEHsNtYKl6sots= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111699908677.060093157598; Thu, 3 Oct 2019 07:08:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E7B303067319; Thu, 3 Oct 2019 14:08:17 +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 BF73A5C72D; Thu, 3 Oct 2019 14:08:17 +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 667D26B4B1; Thu, 3 Oct 2019 14:08:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5nLC021034 for ; Thu, 3 Oct 2019 10:05:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 106B11001B28; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA8891001B20 for ; Thu, 3 Oct 2019 14:05:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 689B71005DD; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:28 +0200 Message-Id: <1a37133c87116f44de1b9c97729c5d62cc1dd8f2.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/22] qemu: Add qemuMonitorCPUDefsCopy 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-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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 03 Oct 2019 14:08:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 33 +++++++++++++++++++++++++++++++++ src/qemu/qemu_monitor.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 4442ef6cca..ebd7eaa1a9 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3565,6 +3565,39 @@ qemuMonitorCPUDefsNew(size_t count) } =20 =20 +int +qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst, + qemuMonitorCPUDefsPtr src) +{ + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; + size_t i; + + if (!src) { + *dst =3D NULL; + return 0; + } + + if (!(defs =3D qemuMonitorCPUDefsNew(src->ncpus))) + return -1; + + defs->ncpus =3D src->ncpus; + for (i =3D 0; i < src->ncpus; i++) { + qemuMonitorCPUDefInfoPtr cpuDst =3D defs->cpus + i; + qemuMonitorCPUDefInfoPtr cpuSrc =3D src->cpus + i; + + cpuDst->usable =3D cpuSrc->usable; + + if (VIR_STRDUP(cpuDst->name, cpuSrc->name) < 0 || + virStringListCopy(&cpuDst->blockers, + (const char **)cpuSrc->blockers) < 0) + return -1; + } + + VIR_STEAL_PTR(*dst, defs); + return 0; +} + + int qemuMonitorGetCPUModelExpansion(qemuMonitorPtr mon, qemuMonitorCPUModelExpansionType type, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 7d35c97860..0b6d4848a0 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1111,6 +1111,8 @@ struct _qemuMonitorCPUDefs { int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, qemuMonitorCPUDefsPtr *cpuDefs); qemuMonitorCPUDefsPtr qemuMonitorCPUDefsNew(size_t count); +int qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst, + qemuMonitorCPUDefsPtr src); void qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs); VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorCPUDefs, qemuMonitorCPUDefsFree); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111708; cv=none; d=zoho.com; s=zohoarc; b=dYdFCBMxUe1No1dTCgCoquPbN+qJ9HEXwob34/8hidRGGnzhwFoObPB1EmgbYa18Sdl1bE0UEdotzCZakVhnxWia7m0P9lvzqR9NgB3FYnPh+Bf4Gyoan8Ynd4PBjy0APeg/sg1BkGXlbbqX0ZNSAFtplBJzKeujqn69io9i8FQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111708; 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:ARC-Authentication-Results; bh=fhHRM6vdvJMWtunTJCYFpU5KcwWEM0SQjDt2uceaQvA=; b=UHEE4JB/8k54H5Nl+mZqvR49bNGBQytXsZX1vVgPmwcYyk8H+Fo6a8EyCdjkaC5SGV2O2mPIGMUaRhwoyjeWs00FEdqHxVvcBhwzVrHvsRrDM8FwZIWT0RywcoNGcurBSM9p5AptLxlwCmuf1uLuMy5UmIPimAsCTdzFIdbWkMY= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15701117082741016.9461863653355; Thu, 3 Oct 2019 07:08:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5588A302C072; Thu, 3 Oct 2019 14:08:26 +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 2AAED5C22C; Thu, 3 Oct 2019 14:08:26 +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 D20D26B4B1; Thu, 3 Oct 2019 14:08:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5nah021049 for ; Thu, 3 Oct 2019 10:05:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3607D6012C; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BA156013A for ; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 6C6381005DE; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:29 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/22] qemu: Use VIR_AUTOFREE in virQEMUCapsLoadCPUModels 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-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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 03 Oct 2019 14:08:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 58 +++++++++++++++--------------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 74920901b3..52a2594bf3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3423,15 +3423,10 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { virDomainCapsCPUModelsPtr cpus =3D NULL; - xmlNodePtr *nodes =3D NULL; - char *str =3D NULL; + VIR_AUTOFREE(xmlNodePtr *) nodes =3D NULL; size_t i; int n; - int ret =3D -1; xmlNodePtr node; - xmlNodePtr *blockerNodes =3D NULL; - char **blockers =3D NULL; - int nblockers; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) n =3D virXPathNodeSet("./cpu[@type=3D'kvm']", ctxt, &nodes); @@ -3441,16 +3436,14 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (n < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("failed to parse qemu capabilities cpus")); - goto cleanup; + return -1; } =20 - if (n =3D=3D 0) { - ret =3D 0; - goto cleanup; - } + if (n =3D=3D 0) + return 0; =20 if (!(cpus =3D virDomainCapsCPUModelsNew(n))) - goto cleanup; + return -1; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) qemuCaps->kvmCPUModels =3D cpus; @@ -3459,19 +3452,24 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, =20 for (i =3D 0; i < n; i++) { int usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; - - if ((str =3D virXMLPropString(nodes[i], "usable")) && - (usable =3D virDomainCapsCPUUsableTypeFromString(str)) < 0) { + VIR_AUTOFREE(char *) strUsable =3D NULL; + VIR_AUTOFREE(char *) name =3D NULL; + VIR_AUTOFREE(xmlNodePtr *) blockerNodes =3D NULL; + VIR_AUTOSTRINGLIST blockers =3D NULL; + int nblockers; + + if ((strUsable =3D virXMLPropString(nodes[i], "usable")) && + (usable =3D virDomainCapsCPUUsableTypeFromString(strUsable)) <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown value '%s' in attribute 'usable'"), = str); - goto cleanup; + _("unknown value '%s' in attribute 'usable'"), + strUsable); + return -1; } - VIR_FREE(str); =20 - if (!(str =3D virXMLPropString(nodes[i], "name"))) { + if (!(name =3D virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing cpu name in QEMU capabilities cache"= )); - goto cleanup; + return -1; } =20 node =3D ctxt->node; @@ -3482,38 +3480,30 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (nblockers < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("failed to parse CPU blockers in QEMU capabil= ities")); - goto cleanup; + return -1; } =20 if (nblockers > 0) { size_t j; =20 if (VIR_ALLOC_N(blockers, nblockers + 1) < 0) - goto cleanup; + return -1; =20 for (j =3D 0; j < nblockers; j++) { if (!(blockers[j] =3D virXMLPropString(blockerNodes[j], "n= ame"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing blocker name in QEMU " "capabilities cache")); - goto cleanup; + return -1; } } - VIR_FREE(blockerNodes); } =20 - if (virDomainCapsCPUModelsAddSteal(cpus, &str, usable, &blockers) = < 0) - goto cleanup; + if (virDomainCapsCPUModelsAddSteal(cpus, &name, usable, &blockers)= < 0) + return -1; } =20 - ret =3D 0; - - cleanup: - VIR_FREE(nodes); - VIR_FREE(str); - VIR_FREE(blockerNodes); - virStringListFree(blockers); - return ret; + return 0; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111572; cv=none; d=zoho.com; s=zohoarc; b=GNSqN6tIRyLy28r+WQfhCOunt+CItYkZZG++PufKD/A3yLlhZOb/gjy0f9WSE5cp7g7xLKJTwavrdaCr8ToFwA0EKZzhjyGMWhs8iM3Aop/NbB2jh/5iIMGEzD/zFN1HhjoWc5QKTr0FuWOhR876ZRB5SobNe6iAJ4wyYqbHWdo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111572; 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:ARC-Authentication-Results; bh=wk/3bXgPSnnMfN2u7LuP/QJz183YTYMuoEFaX00BRoM=; b=WYhn9HoTd2PudaGnIFZQ/tMY+Jwv3LLhkaW4U2Rf8DUuqPr6FM0JJtgTGj3VDVr0W/Ko4+STHwaMqjSdNx7ozlvTfEM+cvcDEn32UBBGdOmOY451WO9bR1Pfk0IPJNn2mteTqp32Jyc4bET1QAkfp/TGpiSdIm3MnxB+PjvHCAI= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111572138750.2474588053898; Thu, 3 Oct 2019 07:06:12 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6E55E3090FDA; Thu, 3 Oct 2019 14:06:10 +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 41308601A3; Thu, 3 Oct 2019 14:06:10 +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 EB1A5180B536; Thu, 3 Oct 2019 14:06:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5pwN021121 for ; Thu, 3 Oct 2019 10:05:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4960611DE; Thu, 3 Oct 2019 14:05:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 884486092F for ; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 7017E1005E0; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:30 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/22] qemu: Introduce virQEMUCapsCPUDefsToModels 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-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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 03 Oct 2019 14:06:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The function translates qemuMonitorCPUDefsPtr (used by QEMU caps probing code) into virDomainCapsCPUModelsPtr used by domain capabilities. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 62 +++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 52a2594bf3..56b0e31c68 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1879,6 +1879,44 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, } =20 =20 +static virDomainCapsCPUModelsPtr +virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs, + const char **modelWhitelist, + const char **modelBlacklist) +{ + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; + size_t i; + + if (!defs) + return NULL; + + if (!(cpuModels =3D virDomainCapsCPUModelsNew(defs->ncpus))) + return NULL; + + for (i =3D 0; i < defs->ncpus; i++) { + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + i; + virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; + + if (modelWhitelist && !virStringListHasString(modelWhitelist, cpu-= >name)) + continue; + + if (modelBlacklist && virStringListHasString(modelBlacklist, cpu->= name)) + continue; + + if (cpu->usable =3D=3D VIR_TRISTATE_BOOL_YES) + usable =3D VIR_DOMCAPS_CPU_USABLE_YES; + else if (cpu->usable =3D=3D VIR_TRISTATE_BOOL_NO) + usable =3D VIR_DOMCAPS_CPU_USABLE_NO; + + if (virDomainCapsCPUModelsAdd(cpuModels, cpu->name, + usable, cpu->blockers) < 0) + return NULL; + } + + VIR_RETURN_PTR(cpuModels); +} + + virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type, @@ -2448,33 +2486,11 @@ virDomainCapsCPUModelsPtr virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon) { VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; - virDomainCapsCPUModelsPtr models =3D NULL; - size_t i; =20 if (qemuMonitorGetCPUDefinitions(mon, &defs) < 0) return NULL; =20 - if (!(models =3D virDomainCapsCPUModelsNew(defs->ncpus))) - goto error; - - for (i =3D 0; i < defs->ncpus; i++) { - virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; - - if (defs->cpus[i].usable =3D=3D VIR_TRISTATE_BOOL_YES) - usable =3D VIR_DOMCAPS_CPU_USABLE_YES; - else if (defs->cpus[i].usable =3D=3D VIR_TRISTATE_BOOL_NO) - usable =3D VIR_DOMCAPS_CPU_USABLE_NO; - - if (virDomainCapsCPUModelsAddSteal(models, &defs->cpus[i].name, us= able, - &defs->cpus[i].blockers) < 0) - goto error; - } - - return models; - - error: - virObjectUnref(models); - return NULL; + return virQEMUCapsCPUDefsToModels(defs, NULL, NULL); } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111715; cv=none; d=zoho.com; s=zohoarc; b=Mk4PqbSFBh54kAKWjdex9LoCiMyFHv7fT8W3ERwSwDwf/W/YkkVVFNaOJwqEsVZyBuryJF1oEDCDYrSwhdWhaILkYyQWab+J9WCTfKf5K0guXGDNfzhBxhKVyU1aZm8dBliyKB+kV+Aa402Vf1cMDrGytnT1/9xJkArYF90VSVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111715; 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:ARC-Authentication-Results; bh=Oqo3oZG+9yt/SbTOCiRtWbJdnPf/S3vlxnGR6YzhVHw=; b=YZIbynGG1wlD78ocuc23mzshLtNVsVomliga9fSN01ZAYuLCDcuLt3Iwi98DLGcQOSBIlM3UXwVK27DPW5CGSZw1AK7Hs3gL6S3h/nNAjWQO4LyxibqaWBEIVFVOwVEOYKxX863cUSJG7ctyj2Q9AqLG7+rHFf59+Cqd0QOYr6o= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111715570365.1267223918305; Thu, 3 Oct 2019 07:08:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB44D20FD; Thu, 3 Oct 2019 14:08:33 +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 77F4660C18; Thu, 3 Oct 2019 14:08:33 +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 1E7106B4A9; Thu, 3 Oct 2019 14:08:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5nAa021063 for ; Thu, 3 Oct 2019 10:05:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5D8E11001B20; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CED61001B23 for ; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 740271005E6; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:31 +0200 Message-Id: <938699093e247c087854d761c4ea9ec0d38afe66.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 13/22] qemu: Switch qemuCaps to use qemuMonitorCPUDefs 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-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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Thu, 03 Oct 2019 14:08:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We will need to keep some QEMU-specific data for each CPU model supported by a QEMU binary. Instead of complicating the generic virDomainCapsCPUModelsPtr, we can just directly store qemuMonitorCPUDefsPtr returned by the capabilities probing code. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 110 +++++++++++++++++------------------ 1 file changed, 52 insertions(+), 58 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 56b0e31c68..94d9cc3e32 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -603,8 +603,8 @@ struct _virQEMUCaps { virArch arch; =20 virHashTablePtr domCapsCache; - virDomainCapsCPUModelsPtr kvmCPUModels; - virDomainCapsCPUModelsPtr tcgCPUModels; + qemuMonitorCPUDefsPtr kvmCPUModels; + qemuMonitorCPUDefsPtr tcgCPUModels; =20 size_t nmachineTypes; struct virQEMUCapsMachineType *machineTypes; @@ -1617,17 +1617,9 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qem= uCaps) =20 ret->arch =3D qemuCaps->arch; =20 - if (qemuCaps->kvmCPUModels) { - ret->kvmCPUModels =3D virDomainCapsCPUModelsCopy(qemuCaps->kvmCPUM= odels); - if (!ret->kvmCPUModels) - goto error; - } - - if (qemuCaps->tcgCPUModels) { - ret->tcgCPUModels =3D virDomainCapsCPUModelsCopy(qemuCaps->tcgCPUM= odels); - if (!ret->tcgCPUModels) - goto error; - } + if (qemuMonitorCPUDefsCopy(&ret->kvmCPUModels, qemuCaps->kvmCPUModels)= < 0 || + qemuMonitorCPUDefsCopy(&ret->tcgCPUModels, qemuCaps->tcgCPUModels)= < 0) + goto error; =20 if (virQEMUCapsHostCPUDataCopy(&ret->kvmCPU, &qemuCaps->kvmCPU) < 0 || virQEMUCapsHostCPUDataCopy(&ret->tcgCPU, &qemuCaps->tcgCPU) < 0) @@ -1853,25 +1845,36 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCap= s, virDomainCapsCPUUsable usable) { size_t i; - virDomainCapsCPUModelsPtr cpus =3D NULL; + size_t start; + qemuMonitorCPUDefsPtr defs =3D NULL; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM && qemuCaps->kvmCPUModels) - cpus =3D qemuCaps->kvmCPUModels; + defs =3D qemuCaps->kvmCPUModels; else if (type =3D=3D VIR_DOMAIN_VIRT_QEMU && qemuCaps->tcgCPUModels) - cpus =3D qemuCaps->tcgCPUModels; + defs =3D qemuCaps->tcgCPUModels; =20 - if (!cpus) { - if (!(cpus =3D virDomainCapsCPUModelsNew(count))) + if (defs) { + start =3D defs->ncpus; + + if (VIR_EXPAND_N(defs->cpus, defs->ncpus, count) < 0) + return -1; + } else { + start =3D 0; + + if (!(defs =3D qemuMonitorCPUDefsNew(count))) return -1; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - qemuCaps->kvmCPUModels =3D cpus; + qemuCaps->kvmCPUModels =3D defs; else - qemuCaps->tcgCPUModels =3D cpus; + qemuCaps->tcgCPUModels =3D defs; } =20 for (i =3D 0; i < count; i++) { - if (virDomainCapsCPUModelsAdd(cpus, name[i], usable, NULL) < 0) + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + start + i; + + cpu->usable =3D usable; + if (VIR_STRDUP(cpu->name, name[i]) < 0) return -1; } =20 @@ -1923,20 +1926,14 @@ virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCap= s, const char **modelWhitelist, const char **modelBlacklist) { - virDomainCapsCPUModelsPtr cpuModels; + qemuMonitorCPUDefsPtr defs; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - cpuModels =3D qemuCaps->kvmCPUModels; + defs =3D qemuCaps->kvmCPUModels; else - cpuModels =3D qemuCaps->tcgCPUModels; + defs =3D qemuCaps->tcgCPUModels; =20 - if (!cpuModels) - return NULL; - - if (modelWhitelist || modelBlacklist) - return virDomainCapsCPUModelsFilter(cpuModels, modelWhitelist, mod= elBlacklist); - - return virDomainCapsCPUModelsCopy(cpuModels); + return virQEMUCapsCPUDefsToModels(defs, modelWhitelist, modelBlacklist= ); } =20 =20 @@ -1996,7 +1993,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, virDomainVirtType type, virCPUMode mode) { - virDomainCapsCPUModelsPtr cpus; + qemuMonitorCPUDefsPtr cpus; =20 switch (mode) { case VIR_CPU_MODE_HOST_PASSTHROUGH: @@ -2012,7 +2009,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, cpus =3D qemuCaps->kvmCPUModels; else cpus =3D qemuCaps->tcgCPUModels; - return cpus && cpus->nmodels > 0; + return cpus && cpus->ncpus > 0; =20 case VIR_CPU_MODE_LAST: break; @@ -2499,18 +2496,18 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qe= muCaps, qemuMonitorPtr mon, bool tcg) { - virDomainCapsCPUModelsPtr models =3D NULL; + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; =20 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS)) return 0; =20 - if (!(models =3D virQEMUCapsFetchCPUDefinitions(mon))) + if (qemuMonitorGetCPUDefinitions(mon, &defs) < 0) return -1; =20 if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) - qemuCaps->tcgCPUModels =3D models; + VIR_STEAL_PTR(qemuCaps->tcgCPUModels, defs); else - qemuCaps->kvmCPUModels =3D models; + VIR_STEAL_PTR(qemuCaps->kvmCPUModels, defs); =20 return 0; } @@ -3438,7 +3435,7 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt, virDomainVirtType type) { - virDomainCapsCPUModelsPtr cpus =3D NULL; + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; VIR_AUTOFREE(xmlNodePtr *) nodes =3D NULL; size_t i; int n; @@ -3458,20 +3455,14 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (n =3D=3D 0) return 0; =20 - if (!(cpus =3D virDomainCapsCPUModelsNew(n))) + if (!(defs =3D qemuMonitorCPUDefsNew(n))) return -1; =20 - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - qemuCaps->kvmCPUModels =3D cpus; - else - qemuCaps->tcgCPUModels =3D cpus; - for (i =3D 0; i < n; i++) { + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + i; int usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; VIR_AUTOFREE(char *) strUsable =3D NULL; - VIR_AUTOFREE(char *) name =3D NULL; VIR_AUTOFREE(xmlNodePtr *) blockerNodes =3D NULL; - VIR_AUTOSTRINGLIST blockers =3D NULL; int nblockers; =20 if ((strUsable =3D virXMLPropString(nodes[i], "usable")) && @@ -3481,8 +3472,9 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, strUsable); return -1; } + cpu->usable =3D usable; =20 - if (!(name =3D virXMLPropString(nodes[i], "name"))) { + if (!(cpu->name =3D virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing cpu name in QEMU capabilities cache"= )); return -1; @@ -3502,11 +3494,11 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (nblockers > 0) { size_t j; =20 - if (VIR_ALLOC_N(blockers, nblockers + 1) < 0) + if (VIR_ALLOC_N(cpu->blockers, nblockers + 1) < 0) return -1; =20 for (j =3D 0; j < nblockers; j++) { - if (!(blockers[j] =3D virXMLPropString(blockerNodes[j], "n= ame"))) { + if (!(cpu->blockers[j] =3D virXMLPropString(blockerNodes[j= ], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing blocker name in QEMU " "capabilities cache")); @@ -3514,11 +3506,13 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, } } } - - if (virDomainCapsCPUModelsAddSteal(cpus, &name, usable, &blockers)= < 0) - return -1; } =20 + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + VIR_STEAL_PTR(qemuCaps->kvmCPUModels, defs); + else + VIR_STEAL_PTR(qemuCaps->tcgCPUModels, defs); + return 0; } =20 @@ -3928,23 +3922,23 @@ virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps, virBufferPtr buf, virDomainVirtType type) { - virDomainCapsCPUModelsPtr cpus; + qemuMonitorCPUDefsPtr defs; const char *typeStr; size_t i; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) { typeStr =3D "kvm"; - cpus =3D qemuCaps->kvmCPUModels; + defs =3D qemuCaps->kvmCPUModels; } else { typeStr =3D "tcg"; - cpus =3D qemuCaps->tcgCPUModels; + defs =3D qemuCaps->tcgCPUModels; } =20 - if (!cpus) + if (!defs) return; =20 - for (i =3D 0; i < cpus->nmodels; i++) { - virDomainCapsCPUModelPtr cpu =3D cpus->models + i; + for (i =3D 0; i < defs->ncpus; i++) { + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + i; =20 virBufferAsprintf(buf, "name); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111711; cv=none; d=zoho.com; s=zohoarc; b=OyYR4h3dfn8K5fnSF2bfuiHE23ptgq8KTKybrsBxYVqbCCzJkGl+8nsSPfK23M4HeG5S9DbwhSf4Leqo5i09ck9JU8U9n835UURsUwHpaJsyFZeXfuy9hColX38IxaTy+spWnHdkc5iZYnv62schcGz1tnB0gyqgwHt4YAxmrus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111711; 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:ARC-Authentication-Results; bh=L16onV8wfbzbbWv4EB8jXXIiBQKmBa5DzyLVVA/tToo=; b=JKzk2yYCU6RCJtXNxDqV3UxLj2HWPzxho6pVqwVlx1Tv1khVh+AnG39fuNsiK22NavrLaDylVwgXMy4U8MmKJBXu+RWuB6Ky7vL0VxEn5fFrUBhiLkdmfup/IawPsW3rqIEx6NpR2HiYsg8t941qLmBvMvNk8QG5PicjLtIvyxg= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111711810546.7372120568538; Thu, 3 Oct 2019 07:08:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 06AD83086E20; Thu, 3 Oct 2019 14:08:30 +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 CA6725DA60; Thu, 3 Oct 2019 14:08:29 +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 82077180B761; Thu, 3 Oct 2019 14:08:29 +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 x93E5nau021050 for ; Thu, 3 Oct 2019 10:05:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A48219D70; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F6FD450F for ; Thu, 3 Oct 2019 14:05:49 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 77CEC1005F3; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:32 +0200 Message-Id: <26ab8ab9940c3de034ddd8155ba168c6677f82c3.1570111135.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 Subject: [libvirt] [PATCH 14/22] conf: Drop unused virDomainCapsCPUModelsFilter 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-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 03 Oct 2019 14:08:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/conf/domain_capabilities.c | 33 --------------------------------- src/conf/domain_capabilities.h | 3 --- src/libvirt_private.syms | 1 - 3 files changed, 37 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index fa0b9dfc71..e3bed42e59 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -185,39 +185,6 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr o= ld) } =20 =20 -virDomainCapsCPUModelsPtr -virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old, - const char **models, - const char **blacklist) -{ - virDomainCapsCPUModelsPtr cpuModels; - size_t i; - - if (!(cpuModels =3D virDomainCapsCPUModelsNew(0))) - return NULL; - - for (i =3D 0; i < old->nmodels; i++) { - if (models && !virStringListHasString(models, old->models[i].name)) - continue; - - if (blacklist && virStringListHasString(blacklist, old->models[i].= name)) - continue; - - if (virDomainCapsCPUModelsAdd(cpuModels, - old->models[i].name, - old->models[i].usable, - old->models[i].blockers) < 0) - goto error; - } - - return cpuModels; - - error: - virObjectUnref(cpuModels); - return NULL; -} - - int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, char **name, diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 7ff2181eda..ad5b22ca9a 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -192,9 +192,6 @@ virDomainCapsPtr virDomainCapsNew(const char *path, =20 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels); virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModel= sPtr old); -virDomainCapsCPUModelsPtr virDomainCapsCPUModelsFilter(virDomainCapsCPUMod= elsPtr old, - const char **models, - const char **blackl= ist); int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, char **name, virDomainCapsCPUUsable usable, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index b8e118db0d..6069a3efd4 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -192,7 +192,6 @@ virDomainAuditVcpu; virDomainCapsCPUModelsAdd; virDomainCapsCPUModelsAddSteal; virDomainCapsCPUModelsCopy; -virDomainCapsCPUModelsFilter; virDomainCapsCPUModelsGet; virDomainCapsCPUModelsNew; virDomainCapsCPUUsableTypeFromString; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111736; cv=none; d=zoho.com; s=zohoarc; b=AEslaiCH0B/lUOf324dcrNTl/5pxoau2NORXPbamaUIjd5qOHLJJ4McBsQNuS22nGwZa02zGbTcvE1z/YkFWlEE0KCYVTod2OVm6VlJRIidhbc7BtSoSnqUc8nfMaHYqYvM2AUecDowSHEFKSELuNMFVE0AXAkjSaBiDAmrACbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111736; 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:ARC-Authentication-Results; bh=MAcnjzDozm2YUhb94Gica8aB/wIyNfbsRkzXzbXP6kA=; b=lkQJfaRWdDbC8EPGtCcQMNT2aip2NzYSehtJDjzi0/dZC0TF5slC5ZgjplrRmFZein+MXnOTaKePu2HDAVOrH8gveXJIFRCieVaIodq+LHLzUQMF55SCqaCBd/lf/ujlVMJF8JkfBkg4sb7ib8Ui+RJHhlxoffWnXqJTmUSuFRk= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111736022395.1880388847412; Thu, 3 Oct 2019 07:08:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6203C2100; Thu, 3 Oct 2019 14:08:54 +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 369595C226; Thu, 3 Oct 2019 14:08:54 +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 6CE74180B761; Thu, 3 Oct 2019 14:08:52 +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 x93E5qcB021152 for ; Thu, 3 Oct 2019 10:05:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 846F5194B2; Thu, 3 Oct 2019 14:05:52 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A3AD19D70 for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 7B7C7100605; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:33 +0200 Message-Id: <50a965fba6e5a8257ef14b03cac7abf6766ae302.1570111135.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 Subject: [libvirt] [PATCH 15/22] conf: Drop virDomainCapsCPUModelsAddSteal 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-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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Thu, 03 Oct 2019 14:08:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Both virDomainCapsCPUModelsAdd and virDomainCapsCPUModelsAddSteal are so simple we can just squash the code in a single function. Signed-off-by: Jiri Denemark --- src/conf/domain_capabilities.c | 33 ++++++++++----------------------- src/conf/domain_capabilities.h | 4 ---- src/libvirt_private.syms | 1 - 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index e3bed42e59..8536fa7bfa 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -185,27 +185,6 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr o= ld) } =20 =20 -int -virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, - char **name, - virDomainCapsCPUUsable usable, - char ***blockers) -{ - if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max, - cpuModels->nmodels, 1) < 0) - return -1; - - cpuModels->models[cpuModels->nmodels].usable =3D usable; - VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].name, *name); - - if (blockers) - VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].blockers, *blo= ckers); - - cpuModels->nmodels++; - return 0; -} - - int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, @@ -214,6 +193,7 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpu= Models, { VIR_AUTOFREE(char *) nameCopy =3D NULL; VIR_AUTOSTRINGLIST blockersCopy =3D NULL; + virDomainCapsCPUModelPtr cpu; =20 if (VIR_STRDUP(nameCopy, name) < 0) return -1; @@ -221,10 +201,17 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr c= puModels, if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) return -1; =20 - if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy, - usable, &blockersCopy) < 0) + if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max, + cpuModels->nmodels, 1) < 0) return -1; =20 + cpu =3D cpuModels->models + cpuModels->nmodels; + cpuModels->nmodels++; + + cpu->usable =3D usable; + VIR_STEAL_PTR(cpu->name, nameCopy); + VIR_STEAL_PTR(cpu->blockers, blockersCopy); + return 0; } =20 diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index ad5b22ca9a..ed47a81772 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -192,10 +192,6 @@ virDomainCapsPtr virDomainCapsNew(const char *path, =20 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels); virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModel= sPtr old); -int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, - char **name, - virDomainCapsCPUUsable usable, - char ***blockers); int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, virDomainCapsCPUUsable usable, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6069a3efd4..4b28ee4b28 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -190,7 +190,6 @@ virDomainAuditVcpu; =20 # conf/domain_capabilities.h virDomainCapsCPUModelsAdd; -virDomainCapsCPUModelsAddSteal; virDomainCapsCPUModelsCopy; virDomainCapsCPUModelsGet; virDomainCapsCPUModelsNew; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111961; cv=none; d=zoho.com; s=zohoarc; b=RMQy0ig/vyr7tR0DZFjpzSJlRzogPswWyf5BurEvGAGFXt9rtb3xBKkDsBBaz2yKre/aF1uZrg1Vs2RSjxLswcZAtdhkn4hRvCga0YyNtGI8uuuifOVEebW6hz4e8DB7svgxoGYPVnq/AhjmdbBS02Jr5QUQb7Uvf7n3A5wU5Is= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111961; 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:ARC-Authentication-Results; bh=8qARbheMTkxaCXG2KEKpCUnR9xANXlMZvnTRd/StDts=; b=TKZGYK682YG3ypYeP2QtIWeBOvxckvTi6+IvVvPtPFvcVYq6fluD2SsRYeC2F+eZHGA2OBoSZc97EZamXIcsQhXFsaV3Sl9yfaM4tq2r3tN+PpUIZ6Jj+q6CI+gmU8C6nrvJjgQWGkw4Pb57idBOFtVrMe9KloVWGjE+CPG4zxo= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111961208662.9527119594818; Thu, 3 Oct 2019 07:12:41 -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 29A0E10C094E; Thu, 3 Oct 2019 14:12:39 +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 C56CF1001B13; Thu, 3 Oct 2019 14:12:38 +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 039754E58A; Thu, 3 Oct 2019 14:12:38 +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 x93E5qwE021140 for ; Thu, 3 Oct 2019 10:05:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D83B196B2; Thu, 3 Oct 2019 14:05:52 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6131C19D70 for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 8F72B10060D; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:34 +0200 Message-Id: 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-Mailman-Approved-At: Thu, 03 Oct 2019 10:12:36 -0400 Subject: [libvirt] [PATCH 16/22] qemu: Store typename from query-cpu-definitions in qemuCaps 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-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.6.2 (mx1.redhat.com [10.5.110.66]); Thu, 03 Oct 2019 14:12:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We need to create a mapping between CPU model names and their corresponding QOM types. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 4 + src/qemu/qemu_monitor.c | 2 + src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 4 + .../caps_2.10.0.aarch64.xml | 126 +- .../caps_2.10.0.ppc64.xml | 1734 ++++++++-------- .../caps_2.10.0.s390x.xml | 264 +-- .../caps_2.10.0.x86_64.xml | 132 +- .../caps_2.11.0.s390x.xml | 264 +-- .../caps_2.11.0.x86_64.xml | 136 +- .../caps_2.12.0.aarch64.xml | 136 +- .../caps_2.12.0.ppc64.xml | 1750 ++++++++--------- .../caps_2.12.0.s390x.xml | 264 +-- .../caps_2.12.0.x86_64.xml | 180 +- .../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1734 ++++++++-------- .../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 256 +-- .../caps_2.9.0.x86_64.xml | 128 +- .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1750 ++++++++--------- .../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 272 +-- .../caps_3.0.0.x86_64.xml | 184 +- .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1750 ++++++++--------- .../caps_3.1.0.x86_64.xml | 196 +- .../caps_4.0.0.aarch64.xml | 148 +- .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1750 ++++++++--------- .../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 284 +-- .../caps_4.0.0.x86_64.xml | 196 +- .../caps_4.1.0.x86_64.xml | 400 ++-- .../caps_4.2.0.x86_64.xml | 400 ++-- 28 files changed, 7228 insertions(+), 7217 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 94d9cc3e32..24ef623458 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3480,6 +3480,8 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, return -1; } =20 + cpu->type =3D virXMLPropString(nodes[i], "typename"); + node =3D ctxt->node; ctxt->node =3D nodes[i]; nblockers =3D virXPathNodeSet("./blocker", ctxt, &blockerNodes); @@ -3942,6 +3944,8 @@ virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps, =20 virBufferAsprintf(buf, "name); + if (cpu->type) + virBufferEscapeString(buf, " typename=3D'%s'", cpu->type); if (cpu->usable) { virBufferAsprintf(buf, " usable=3D'%s'", virDomainCapsCPUUsableTypeToString(cpu->usab= le)); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ebd7eaa1a9..3bc97b8142 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3542,6 +3542,7 @@ qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs) for (i =3D 0; i < defs->ncpus; i++) { virStringListFree(defs->cpus[i].blockers); VIR_FREE(defs->cpus[i].name); + VIR_FREE(defs->cpus[i].type); } =20 VIR_FREE(defs->cpus); @@ -3588,6 +3589,7 @@ qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst, cpuDst->usable =3D cpuSrc->usable; =20 if (VIR_STRDUP(cpuDst->name, cpuSrc->name) < 0 || + VIR_STRDUP(cpuDst->type, cpuSrc->type) < 0 || virStringListCopy(&cpuDst->blockers, (const char **)cpuSrc->blockers) < 0) return -1; diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 0b6d4848a0..416bbb1cba 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1098,6 +1098,7 @@ typedef qemuMonitorCPUDefInfo *qemuMonitorCPUDefInfoP= tr; struct _qemuMonitorCPUDefInfo { virTristateBool usable; char *name; + char *type; char **blockers; /* NULL-terminated string list */ }; =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index c2a2f6eee6..c0cd195496 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5571,6 +5571,10 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, if (VIR_STRDUP(cpu->name, tmp) < 0) return -1; =20 + if ((tmp =3D virJSONValueObjectGetString(child, "typename")) && + VIR_STRDUP(cpu->type, tmp) < 0) + return -1; + if (virJSONValueObjectHasKey(child, "unavailable-features")) { virJSONValuePtr blockers; size_t j; diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml b/tests/qem= ucapabilitiesdata/caps_2.10.0.aarch64.xml index 9404e66144..cc849ba708 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml @@ -144,69 +144,69 @@ 61700805 (v2.10.0) aarch64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.10.0.ppc64.xml index 162fb1f035..523b8abd11 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml @@ -143,873 +143,873 @@ 42900805 (v2.10.0) ppc64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemuc= apabilitiesdata/caps_2.10.0.s390x.xml index 21b918f8d4..236589f90f 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml @@ -139,73 +139,73 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -221,7 +221,7 @@ - + @@ -231,7 +231,7 @@ - + @@ -253,20 +253,20 @@ - - + + - + - - + + - + @@ -297,12 +297,12 @@ - + - + @@ -327,7 +327,7 @@ - + @@ -367,7 +367,7 @@ - + @@ -388,10 +388,10 @@ - + - + @@ -412,7 +412,7 @@ - + @@ -443,7 +443,7 @@ - + @@ -456,12 +456,12 @@ - + - + @@ -482,8 +482,8 @@ - - + + @@ -493,12 +493,12 @@ - + - + @@ -519,7 +519,7 @@ - + @@ -532,7 +532,7 @@ - + @@ -553,12 +553,12 @@ - + - + @@ -615,7 +615,7 @@ - + @@ -659,7 +659,7 @@ - + @@ -675,7 +675,7 @@ - + @@ -698,12 +698,12 @@ - + - + @@ -716,12 +716,12 @@ - + - + @@ -765,7 +765,7 @@ - + @@ -790,7 +790,7 @@ - + @@ -820,7 +820,7 @@ - + @@ -833,12 +833,12 @@ - + - + @@ -861,7 +861,7 @@ - + @@ -871,7 +871,7 @@ - + @@ -911,7 +911,7 @@ - + @@ -942,25 +942,25 @@ - + - + - + - + - + @@ -976,17 +976,17 @@ - + - + - + @@ -1009,10 +1009,10 @@ - + - + @@ -1052,7 +1052,7 @@ - + @@ -1062,7 +1062,7 @@ - + @@ -1075,7 +1075,7 @@ - + @@ -1091,13 +1091,13 @@ - + - - + + @@ -1113,7 +1113,7 @@ - + @@ -1123,15 +1123,15 @@ - + - + - + @@ -1175,7 +1175,7 @@ - + @@ -1197,7 +1197,7 @@ - + @@ -1219,7 +1219,7 @@ - + @@ -1244,7 +1244,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.10.0.x86_64.xml index 2788fd9afe..1d49903ab6 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml @@ -654,12 +654,12 @@ - - - - - - + + + + + + @@ -667,21 +667,21 @@ - - - - - - - - - + + + + + + + + + - - + + @@ -703,7 +703,7 @@ - + @@ -716,9 +716,9 @@ - - - + + + @@ -726,28 +726,28 @@ - + - + - - - - - + + + + + - - - + + + @@ -755,35 +755,35 @@ - + - - - + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -804,7 +804,7 @@ - + @@ -820,13 +820,13 @@ - + - - + + @@ -836,27 +836,27 @@ - + - + - - - - + + + + - + @@ -869,7 +869,7 @@ - + @@ -880,8 +880,8 @@ - - + + @@ -896,7 +896,7 @@ - + @@ -909,7 +909,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml b/tests/qemuc= apabilitiesdata/caps_2.11.0.s390x.xml index 6cb997d299..62d6ea4774 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml @@ -145,73 +145,73 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -226,7 +226,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -271,7 +271,7 @@ - + @@ -393,7 +393,7 @@ - + @@ -540,7 +540,7 @@ - + @@ -559,7 +559,7 @@ - + @@ -591,7 +591,7 @@ - + @@ -622,7 +622,7 @@ - + @@ -656,7 +656,7 @@ - + @@ -671,8 +671,8 @@ - - + + @@ -694,7 +694,7 @@ - + @@ -825,7 +825,7 @@ - + @@ -847,7 +847,7 @@ - + @@ -878,8 +878,8 @@ - - + + @@ -911,10 +911,10 @@ - + - + @@ -936,13 +936,13 @@ - + - + - + @@ -957,7 +957,7 @@ - + @@ -972,7 +972,7 @@ - + @@ -987,7 +987,7 @@ - + @@ -1012,10 +1012,10 @@ - + - + @@ -1034,10 +1034,10 @@ - + - + @@ -1159,7 +1159,7 @@ - + @@ -1294,7 +1294,7 @@ - + @@ -1309,7 +1309,7 @@ - + @@ -1343,7 +1343,7 @@ - + @@ -1358,7 +1358,7 @@ - + @@ -1397,7 +1397,7 @@ - + @@ -1412,7 +1412,7 @@ - + @@ -1534,7 +1534,7 @@ - + @@ -1564,7 +1564,7 @@ - + @@ -1699,8 +1699,8 @@ - - + + @@ -1730,7 +1730,7 @@ - + @@ -1755,7 +1755,7 @@ - + @@ -1786,7 +1786,7 @@ - + @@ -1801,7 +1801,7 @@ - + @@ -1820,7 +1820,7 @@ - + @@ -1835,10 +1835,10 @@ - + - + @@ -1860,7 +1860,7 @@ - + @@ -1890,7 +1890,7 @@ - + @@ -1905,7 +1905,7 @@ - + @@ -2036,7 +2036,7 @@ - + @@ -2061,7 +2061,7 @@ - + @@ -2080,7 +2080,7 @@ - + @@ -2099,7 +2099,7 @@ - + @@ -2230,7 +2230,7 @@ - + @@ -2245,7 +2245,7 @@ - + @@ -2270,8 +2270,8 @@ - - + + @@ -2406,7 +2406,7 @@ - + @@ -2438,7 +2438,7 @@ - + @@ -2472,7 +2472,7 @@ - + @@ -2487,7 +2487,7 @@ - + @@ -2502,7 +2502,7 @@ - + @@ -2532,7 +2532,7 @@ - + @@ -2554,7 +2554,7 @@ - + @@ -2579,7 +2579,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.11.0.x86_64.xml index 69f7fc2e4a..6c79481ec7 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml @@ -664,12 +664,12 @@ - - - - - - + + + + + + @@ -677,21 +677,21 @@ - - - - - - - - - + + + + + + + + + - - + + @@ -702,33 +702,33 @@ - - - - + + + + - + - + - - - - - - - + + + + + + + @@ -737,32 +737,32 @@ - - - - - - + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -783,7 +783,7 @@ - + @@ -799,13 +799,13 @@ - + - - + + @@ -815,27 +815,27 @@ - + - + - - - - + + + + - + @@ -848,7 +848,7 @@ - + @@ -859,7 +859,7 @@ - + @@ -873,8 +873,8 @@ - - + + @@ -889,7 +889,7 @@ - + @@ -902,7 +902,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml b/tests/qem= ucapabilitiesdata/caps_2.12.0.aarch64.xml index 614fd14fb1..956ae1055f 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml @@ -158,74 +158,74 @@ 61700807 v2.12.0 aarch64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml index fd9ae0bcb8..08a7c2cf11 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -156,881 +156,881 @@ 42900807 v2.12.0-rc0 ppc64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.s390x.xml index 2930381068..482a52da24 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml @@ -155,75 +155,75 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -237,7 +237,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -397,7 +397,7 @@ - + @@ -539,7 +539,7 @@ - + @@ -557,7 +557,7 @@ - + @@ -585,7 +585,7 @@ - + @@ -612,7 +612,7 @@ - + @@ -643,7 +643,7 @@ - + @@ -657,8 +657,8 @@ - - + + @@ -679,7 +679,7 @@ - + @@ -804,7 +804,7 @@ - + @@ -825,7 +825,7 @@ - + @@ -852,8 +852,8 @@ - - + + @@ -881,8 +881,8 @@ - - + + @@ -903,9 +903,9 @@ - - - + + + @@ -919,7 +919,7 @@ - + @@ -933,7 +933,7 @@ - + @@ -947,7 +947,7 @@ - + @@ -970,8 +970,8 @@ - - + + @@ -989,8 +989,8 @@ - - + + @@ -1108,7 +1108,7 @@ - + @@ -1238,7 +1238,7 @@ - + @@ -1269,7 +1269,7 @@ - + @@ -1283,7 +1283,7 @@ - + @@ -1297,7 +1297,7 @@ - + @@ -1333,7 +1333,7 @@ - + @@ -1347,7 +1347,7 @@ - + @@ -1465,7 +1465,7 @@ - + @@ -1493,7 +1493,7 @@ - + @@ -1623,8 +1623,8 @@ - - + + @@ -1652,7 +1652,7 @@ - + @@ -1675,7 +1675,7 @@ - + @@ -1702,7 +1702,7 @@ - + @@ -1716,7 +1716,7 @@ - + @@ -1734,7 +1734,7 @@ - + @@ -1748,8 +1748,8 @@ - - + + @@ -1770,7 +1770,7 @@ - + @@ -1798,7 +1798,7 @@ - + @@ -1812,7 +1812,7 @@ - + @@ -1937,7 +1937,7 @@ - + @@ -1960,7 +1960,7 @@ - + @@ -1978,7 +1978,7 @@ - + @@ -1996,7 +1996,7 @@ - + @@ -2121,7 +2121,7 @@ - + @@ -2135,7 +2135,7 @@ - + @@ -2158,8 +2158,8 @@ - - + + @@ -2289,7 +2289,7 @@ - + @@ -2303,7 +2303,7 @@ - + @@ -2331,7 +2331,7 @@ - + @@ -2362,7 +2362,7 @@ - + @@ -2376,7 +2376,7 @@ - + @@ -2404,7 +2404,7 @@ - + @@ -2425,7 +2425,7 @@ - + @@ -2448,7 +2448,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.12.0.x86_64.xml index 61b3602c48..897962bde3 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -692,12 +692,12 @@ - - - - - - + + + + + + @@ -705,24 +705,24 @@ - - - - - - - - - + + + + + + + + + - - + + - + @@ -745,7 +745,7 @@ - + @@ -768,7 +768,7 @@ - + @@ -781,7 +781,7 @@ - + @@ -795,12 +795,12 @@ - - + + - - + + @@ -808,41 +808,41 @@ - + - + - - - - + + + + - - + + - + - - + + - + - + @@ -858,7 +858,7 @@ - + @@ -875,8 +875,8 @@ - - + + @@ -884,20 +884,20 @@ - + - + - + @@ -906,32 +906,32 @@ - - - + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - + @@ -952,7 +952,7 @@ - + @@ -974,7 +974,7 @@ - + @@ -990,7 +990,7 @@ - + @@ -1007,19 +1007,19 @@ - + - + - - + + @@ -1029,30 +1029,30 @@ - + - + - - - - + + + + - + - + @@ -1060,7 +1060,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1084,7 +1084,7 @@ - + @@ -1096,7 +1096,7 @@ - + @@ -1110,7 +1110,7 @@ - + @@ -1124,7 +1124,7 @@ - + @@ -1139,8 +1139,8 @@ - - + + @@ -1155,7 +1155,7 @@ - + @@ -1168,7 +1168,7 @@ - + @@ -1182,7 +1182,7 @@ - + @@ -1198,7 +1198,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_2.9.0.ppc64.xml index 17c2c8e12e..8972ebcfa3 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml @@ -135,873 +135,873 @@ 42900765 (v2.9.0) ppc64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_2.9.0.s390x.xml index 72ae100a76..6b8757c32d 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml @@ -120,134 +120,134 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 0c2586e0e5..e9b1cbc87c 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -644,12 +644,12 @@ - - - - - - + + + + + + @@ -657,72 +657,72 @@ - - - - - - - - - + + + + + + + + + - - - - - + + + + + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -738,13 +738,13 @@ - + - - + + @@ -754,27 +754,27 @@ - + - + - - - - + + + + - + @@ -787,7 +787,7 @@ - + @@ -798,8 +798,8 @@ - - + + @@ -814,7 +814,7 @@ - + @@ -827,7 +827,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.0.0.ppc64.xml index 61be1df782..3ff4694ff8 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml @@ -157,881 +157,881 @@ 42900757 v2.12.0-1689-g518d23a ppc64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_3.0.0.s390x.xml index d511377262..1241a2fe5c 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml @@ -161,77 +161,77 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -245,7 +245,7 @@ - + @@ -259,7 +259,7 @@ - + @@ -403,7 +403,7 @@ - + @@ -431,7 +431,7 @@ - + @@ -551,7 +551,7 @@ - + @@ -695,7 +695,7 @@ - + @@ -713,7 +713,7 @@ - + @@ -741,7 +741,7 @@ - + @@ -768,7 +768,7 @@ - + @@ -799,7 +799,7 @@ - + @@ -813,8 +813,8 @@ - - + + @@ -835,7 +835,7 @@ - + @@ -962,7 +962,7 @@ - + @@ -983,7 +983,7 @@ - + @@ -1010,8 +1010,8 @@ - - + + @@ -1039,8 +1039,8 @@ - - + + @@ -1061,8 +1061,8 @@ - - + + @@ -1098,8 +1098,8 @@ - - + + @@ -1113,7 +1113,7 @@ - + @@ -1127,7 +1127,7 @@ - + @@ -1141,7 +1141,7 @@ - + @@ -1164,8 +1164,8 @@ - - + + @@ -1183,8 +1183,8 @@ - - + + @@ -1304,7 +1304,7 @@ - + @@ -1436,7 +1436,7 @@ - + @@ -1467,7 +1467,7 @@ - + @@ -1481,7 +1481,7 @@ - + @@ -1495,7 +1495,7 @@ - + @@ -1531,7 +1531,7 @@ - + @@ -1545,7 +1545,7 @@ - + @@ -1665,7 +1665,7 @@ - + @@ -1693,7 +1693,7 @@ - + @@ -1825,8 +1825,8 @@ - - + + @@ -1854,7 +1854,7 @@ - + @@ -1877,7 +1877,7 @@ - + @@ -1904,7 +1904,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1936,7 +1936,7 @@ - + @@ -1950,8 +1950,8 @@ - - + + @@ -1972,7 +1972,7 @@ - + @@ -2000,7 +2000,7 @@ - + @@ -2014,7 +2014,7 @@ - + @@ -2141,7 +2141,7 @@ - + @@ -2164,7 +2164,7 @@ - + @@ -2182,7 +2182,7 @@ - + @@ -2200,7 +2200,7 @@ - + @@ -2327,7 +2327,7 @@ - + @@ -2341,7 +2341,7 @@ - + @@ -2364,8 +2364,8 @@ - - + + @@ -2497,7 +2497,7 @@ - + @@ -2525,7 +2525,7 @@ - + @@ -2556,7 +2556,7 @@ - + @@ -2570,7 +2570,7 @@ - + @@ -2584,7 +2584,7 @@ - + @@ -2612,7 +2612,7 @@ - + @@ -2633,7 +2633,7 @@ - + @@ -2656,7 +2656,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.0.0.x86_64.xml index 7a322030bd..1cf9189efd 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -712,12 +712,12 @@ - - - - - - + + + + + + @@ -725,22 +725,22 @@ - - - - - - - - - + + + + + + + + + - - - + + + @@ -751,7 +751,7 @@ - + @@ -762,33 +762,33 @@ - - - - - - + + + + + + - + - + - - - - - + + + + + @@ -800,13 +800,13 @@ - - - - - - - + + + + + + + @@ -816,7 +816,7 @@ - + @@ -825,36 +825,36 @@ - - - - - - - - + + + + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - + + @@ -876,7 +876,7 @@ - + @@ -897,7 +897,7 @@ - + @@ -914,7 +914,7 @@ - + @@ -930,19 +930,19 @@ - + - + - - + + @@ -952,23 +952,23 @@ - + - + - - - + + + - - + + @@ -986,7 +986,7 @@ - + @@ -994,14 +994,14 @@ - + - + @@ -1013,7 +1013,7 @@ - + @@ -1024,7 +1024,7 @@ - + @@ -1038,7 +1038,7 @@ - + @@ -1051,7 +1051,7 @@ - + @@ -1067,7 +1067,7 @@ - + @@ -1082,8 +1082,8 @@ - - + + @@ -1097,7 +1097,7 @@ - + @@ -1110,7 +1110,7 @@ - + @@ -1126,7 +1126,7 @@ - + @@ -1141,7 +1141,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.1.0.ppc64.xml index 400dc45be4..85f44edbb4 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -162,881 +162,881 @@ 42900758 v3.1.0-rc1-74-g3c035a41dc ppc64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.1.0.x86_64.xml index 434c644ad4..ef39245a47 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -739,12 +739,12 @@ - - - - - - + + + + + + @@ -752,22 +752,22 @@ - - - - - - - - - + + + + + + + + + - - - + + + @@ -780,7 +780,7 @@ - + @@ -793,33 +793,33 @@ - - - - - - + + + + + + - + - + - - - - - + + + + + @@ -831,9 +831,9 @@ - - - + + + @@ -860,7 +860,7 @@ - + @@ -876,11 +876,11 @@ - - - - - + + + + + @@ -890,7 +890,7 @@ - + @@ -899,8 +899,8 @@ - - + + @@ -917,35 +917,35 @@ - - - - - - - + + + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - + + @@ -967,7 +967,7 @@ - + @@ -988,7 +988,7 @@ - + @@ -1005,7 +1005,7 @@ - + @@ -1021,19 +1021,19 @@ - + - + - - + + @@ -1043,23 +1043,23 @@ - + - + - - - + + + - - + + @@ -1077,7 +1077,7 @@ - + @@ -1085,14 +1085,14 @@ - + - + @@ -1128,7 +1128,7 @@ - + @@ -1158,7 +1158,7 @@ - + @@ -1170,7 +1170,7 @@ - + @@ -1181,7 +1181,7 @@ - + @@ -1195,7 +1195,7 @@ - + @@ -1208,7 +1208,7 @@ - + @@ -1224,7 +1224,7 @@ - + @@ -1239,8 +1239,8 @@ - - + + @@ -1266,7 +1266,7 @@ - + @@ -1280,7 +1280,7 @@ - + @@ -1293,7 +1293,7 @@ - + @@ -1309,7 +1309,7 @@ - + @@ -1324,7 +1324,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml b/tests/qemu= capabilitiesdata/caps_4.0.0.aarch64.xml index 20f119665b..bf5d1ad81b 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml @@ -170,80 +170,80 @@ 61700758 v4.0.0 aarch64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_4.0.0.ppc64.xml index 9ea6f4d046..ab865688ce 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml @@ -175,881 +175,881 @@ 42900758 v4.0.0 ppc64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_4.0.0.s390x.xml index ef802f3d1f..147b070b06 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.s390x.xml @@ -207,80 +207,80 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -425,7 +425,7 @@ - + @@ -439,7 +439,7 @@ - + @@ -453,7 +453,7 @@ - + @@ -598,7 +598,7 @@ - + @@ -626,7 +626,7 @@ - + @@ -745,7 +745,7 @@ - + @@ -890,7 +890,7 @@ - + @@ -908,7 +908,7 @@ - + @@ -935,7 +935,7 @@ - + @@ -961,7 +961,7 @@ - + @@ -991,7 +991,7 @@ - + @@ -1005,8 +1005,8 @@ - - + + @@ -1027,7 +1027,7 @@ - + @@ -1153,7 +1153,7 @@ - + @@ -1174,7 +1174,7 @@ - + @@ -1200,8 +1200,8 @@ - - + + @@ -1228,8 +1228,8 @@ - - + + @@ -1250,8 +1250,8 @@ - - + + @@ -1286,8 +1286,8 @@ - - + + @@ -1301,7 +1301,7 @@ - + @@ -1315,7 +1315,7 @@ - + @@ -1329,7 +1329,7 @@ - + @@ -1352,8 +1352,8 @@ - - + + @@ -1371,8 +1371,8 @@ - - + + @@ -1491,7 +1491,7 @@ - + @@ -1622,7 +1622,7 @@ - + @@ -1636,7 +1636,7 @@ - + @@ -1666,7 +1666,7 @@ - + @@ -1680,7 +1680,7 @@ - + @@ -1715,7 +1715,7 @@ - + @@ -1750,7 +1750,7 @@ - + @@ -1764,7 +1764,7 @@ - + @@ -1883,7 +1883,7 @@ - + @@ -1911,7 +1911,7 @@ - + @@ -2042,8 +2042,8 @@ - - + + @@ -2071,7 +2071,7 @@ - + @@ -2094,7 +2094,7 @@ - + @@ -2120,7 +2120,7 @@ - + @@ -2134,7 +2134,7 @@ - + @@ -2152,7 +2152,7 @@ - + @@ -2166,8 +2166,8 @@ - - + + @@ -2188,7 +2188,7 @@ - + @@ -2216,7 +2216,7 @@ - + @@ -2230,7 +2230,7 @@ - + @@ -2356,7 +2356,7 @@ - + @@ -2379,7 +2379,7 @@ - + @@ -2397,7 +2397,7 @@ - + @@ -2415,7 +2415,7 @@ - + @@ -2541,7 +2541,7 @@ - + @@ -2555,7 +2555,7 @@ - + @@ -2578,9 +2578,9 @@ - - - + + + @@ -2711,7 +2711,7 @@ - + @@ -2738,7 +2738,7 @@ - + @@ -2768,7 +2768,7 @@ - + @@ -2782,7 +2782,7 @@ - + @@ -2796,7 +2796,7 @@ - + @@ -2824,7 +2824,7 @@ - + @@ -2845,7 +2845,7 @@ - + @@ -2868,7 +2868,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.0.0.x86_64.xml index 87c95f4d18..b0e1855240 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -752,12 +752,12 @@ - - - - - - + + + + + + @@ -765,22 +765,22 @@ - - - - - - - - - + + + + + + + + + - - - + + + @@ -793,7 +793,7 @@ - + @@ -806,12 +806,12 @@ - - - - - - + + + + + + @@ -820,7 +820,7 @@ - + @@ -828,15 +828,15 @@ - + - - - - - + + + + + @@ -848,9 +848,9 @@ - - - + + + @@ -873,7 +873,7 @@ - + @@ -886,11 +886,11 @@ - - - - - + + + + + @@ -902,7 +902,7 @@ - + @@ -913,8 +913,8 @@ - - + + @@ -928,35 +928,35 @@ - - - - - - - + + + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - + + @@ -978,7 +978,7 @@ - + @@ -999,7 +999,7 @@ - + @@ -1016,7 +1016,7 @@ - + @@ -1032,19 +1032,19 @@ - + - + - - + + @@ -1055,7 +1055,7 @@ - + @@ -1063,16 +1063,16 @@ - + - - - + + + - - + + @@ -1090,7 +1090,7 @@ - + @@ -1098,14 +1098,14 @@ - + - + @@ -1138,7 +1138,7 @@ - + @@ -1166,7 +1166,7 @@ - + @@ -1178,7 +1178,7 @@ - + @@ -1189,7 +1189,7 @@ - + @@ -1203,7 +1203,7 @@ - + @@ -1216,7 +1216,7 @@ - + @@ -1233,7 +1233,7 @@ - + @@ -1249,8 +1249,8 @@ - - + + @@ -1274,7 +1274,7 @@ - + @@ -1288,7 +1288,7 @@ - + @@ -1301,7 +1301,7 @@ - + @@ -1317,7 +1317,7 @@ - + @@ -1332,7 +1332,7 @@ - + diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.1.0.x86_64.xml index 660ead8555..39f6f51684 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -614,14 +614,14 @@ - - - - - - - - + + + + + + + + @@ -629,7 +629,7 @@ - + @@ -637,37 +637,37 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - - - - - + + + + + @@ -677,7 +677,7 @@ - + @@ -687,7 +687,7 @@ - + @@ -700,7 +700,7 @@ - + @@ -713,7 +713,7 @@ - + @@ -726,7 +726,7 @@ - + @@ -739,17 +739,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -758,7 +758,7 @@ - + @@ -767,7 +767,7 @@ - + @@ -775,7 +775,7 @@ - + @@ -783,23 +783,23 @@ - + - + - - - - - - - - - + + + + + + + + + @@ -811,7 +811,7 @@ - + @@ -823,11 +823,11 @@ - - - - - + + + + + @@ -850,7 +850,7 @@ - + @@ -873,7 +873,7 @@ - + @@ -886,7 +886,7 @@ - + @@ -899,15 +899,15 @@ - - - - - - - - - + + + + + + + + + @@ -919,7 +919,7 @@ - + @@ -930,7 +930,7 @@ - + @@ -942,7 +942,7 @@ - + @@ -954,7 +954,7 @@ - + @@ -965,7 +965,7 @@ - + @@ -976,9 +976,9 @@ - - - + + + @@ -995,7 +995,7 @@ - + @@ -1009,7 +1009,7 @@ - + @@ -1026,60 +1026,60 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + - + - + @@ -1097,7 +1097,7 @@ - + @@ -1115,7 +1115,7 @@ - + @@ -1136,7 +1136,7 @@ - + @@ -1156,7 +1156,7 @@ - + @@ -1177,7 +1177,7 @@ - + @@ -1198,7 +1198,7 @@ - + @@ -1214,7 +1214,7 @@ - + @@ -1229,7 +1229,7 @@ - + @@ -1245,7 +1245,7 @@ - + @@ -1261,32 +1261,32 @@ - + - + - + - + - - - + + + @@ -1297,7 +1297,7 @@ - + @@ -1308,7 +1308,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1324,27 +1324,27 @@ - + - + - - - - - + + + + + - - + + - + - + @@ -1361,7 +1361,7 @@ - + @@ -1378,34 +1378,34 @@ - + - + - + - + - + @@ -1437,7 +1437,7 @@ - + @@ -1469,7 +1469,7 @@ - + @@ -1496,7 +1496,7 @@ - + @@ -1523,7 +1523,7 @@ - + @@ -1534,7 +1534,7 @@ - + @@ -1547,7 +1547,7 @@ - + @@ -1557,7 +1557,7 @@ - + @@ -1569,7 +1569,7 @@ - + @@ -1580,7 +1580,7 @@ - + @@ -1590,7 +1590,7 @@ - + @@ -1603,7 +1603,7 @@ - + @@ -1614,7 +1614,7 @@ - + @@ -1630,7 +1630,7 @@ - + @@ -1645,7 +1645,7 @@ - + @@ -1661,7 +1661,7 @@ - + @@ -1677,7 +1677,7 @@ - + @@ -1692,7 +1692,7 @@ - + @@ -1707,9 +1707,9 @@ - - - + + + @@ -1737,7 +1737,7 @@ - + @@ -1760,7 +1760,7 @@ - + @@ -1788,7 +1788,7 @@ - + @@ -1801,7 +1801,7 @@ - + @@ -1816,7 +1816,7 @@ - + @@ -1828,7 +1828,7 @@ - + @@ -1842,7 +1842,7 @@ - + @@ -1855,7 +1855,7 @@ - + @@ -1867,7 +1867,7 @@ - + @@ -1882,7 +1882,7 @@ - + @@ -1895,8 +1895,8 @@ - - + + diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.2.0.x86_64.xml index 4d43632ced..d08e4bebde 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -620,14 +620,14 @@ - - - - - - - - + + + + + + + + @@ -635,7 +635,7 @@ - + @@ -643,37 +643,37 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - - - - - + + + + + @@ -683,7 +683,7 @@ - + @@ -693,7 +693,7 @@ - + @@ -706,7 +706,7 @@ - + @@ -719,7 +719,7 @@ - + @@ -732,7 +732,7 @@ - + @@ -745,17 +745,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -764,7 +764,7 @@ - + @@ -773,7 +773,7 @@ - + @@ -781,7 +781,7 @@ - + @@ -789,23 +789,23 @@ - + - + - - - - - - - - - + + + + + + + + + @@ -817,7 +817,7 @@ - + @@ -829,11 +829,11 @@ - - - - - + + + + + @@ -856,7 +856,7 @@ - + @@ -879,7 +879,7 @@ - + @@ -892,7 +892,7 @@ - + @@ -905,15 +905,15 @@ - - - - - - - - - + + + + + + + + + @@ -925,7 +925,7 @@ - + @@ -936,7 +936,7 @@ - + @@ -948,7 +948,7 @@ - + @@ -960,7 +960,7 @@ - + @@ -971,7 +971,7 @@ - + @@ -982,9 +982,9 @@ - - - + + + @@ -1001,7 +1001,7 @@ - + @@ -1015,7 +1015,7 @@ - + @@ -1032,60 +1032,60 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + - + - + @@ -1103,7 +1103,7 @@ - + @@ -1121,7 +1121,7 @@ - + @@ -1142,7 +1142,7 @@ - + @@ -1162,7 +1162,7 @@ - + @@ -1183,7 +1183,7 @@ - + @@ -1204,7 +1204,7 @@ - + @@ -1220,7 +1220,7 @@ - + @@ -1235,7 +1235,7 @@ - + @@ -1251,7 +1251,7 @@ - + @@ -1267,32 +1267,32 @@ - + - + - + - + - - - + + + @@ -1303,7 +1303,7 @@ - + @@ -1314,7 +1314,7 @@ - + @@ -1322,7 +1322,7 @@ - + @@ -1330,27 +1330,27 @@ - + - + - - - - - + + + + + - - + + - + - + @@ -1367,7 +1367,7 @@ - + @@ -1384,34 +1384,34 @@ - + - + - + - + - + @@ -1443,7 +1443,7 @@ - + @@ -1475,7 +1475,7 @@ - + @@ -1502,7 +1502,7 @@ - + @@ -1529,7 +1529,7 @@ - + @@ -1540,7 +1540,7 @@ - + @@ -1553,7 +1553,7 @@ - + @@ -1563,7 +1563,7 @@ - + @@ -1575,7 +1575,7 @@ - + @@ -1586,7 +1586,7 @@ - + @@ -1596,7 +1596,7 @@ - + @@ -1609,7 +1609,7 @@ - + @@ -1620,7 +1620,7 @@ - + @@ -1636,7 +1636,7 @@ - + @@ -1651,7 +1651,7 @@ - + @@ -1667,7 +1667,7 @@ - + @@ -1683,7 +1683,7 @@ - + @@ -1698,7 +1698,7 @@ - + @@ -1713,9 +1713,9 @@ - - - + + + @@ -1743,7 +1743,7 @@ - + @@ -1766,7 +1766,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1807,7 +1807,7 @@ - + @@ -1822,7 +1822,7 @@ - + @@ -1834,7 +1834,7 @@ - + @@ -1848,7 +1848,7 @@ - + @@ -1861,7 +1861,7 @@ - + @@ -1873,7 +1873,7 @@ - + @@ -1888,7 +1888,7 @@ - + @@ -1901,8 +1901,8 @@ - - + + --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111720; cv=none; d=zoho.com; s=zohoarc; b=JxpvrSzobiYCjURhd9tZQoXhOUZqn6VAlYw1fdnxdmRURkHKY17KrrjUU/uPxWM0t+qx/xiP/8rdxOOw86SDRqATb0/n7KNtrREGRZTTKoTbBFh95L0rur59+liO6zitrDTrqY7sod29aUiS2VOm19KCMUiaAKGRULjZltw8A6k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111720; 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:ARC-Authentication-Results; bh=IVW8oXdyB+Hb7XIVs9BqNeQH+mOy2roZY1CCXgwN6oA=; b=mnazkhT7Saftgn/tzstYng6ZXzKwCxtc6G7kNDOqn8GFEFjJ/1S+cPzqNLlppF47Pb2F9TtzHNax5AWb88C5XtPDTJfA2RaCdWOabo+vY6TyL9R3ARJO3gtze98dmV3+cm2cAdrFl7HDcjYfBJ7HNvTxEJfuFV+EKnSaSJR58tI= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111720500669.1633081034986; Thu, 3 Oct 2019 07:08:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C44E30ADBA7; Thu, 3 Oct 2019 14:08:38 +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 31F1960C5D; Thu, 3 Oct 2019 14:08:38 +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 DDE726B4A9; Thu, 3 Oct 2019 14:08:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5o1Q021079 for ; Thu, 3 Oct 2019 10:05:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id D8A116013A; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 620F56012C for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 917CE1005D4; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:35 +0200 Message-Id: <44212728ca730497a011fc0314e4ebeb8d6bfa13.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/22] qemu: Probe for default CPU types 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-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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 03 Oct 2019 14:08:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" QEMU 4.2.0 will report default CPU types used by each machine type and we will want to start using it. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 15 ++- src/qemu/qemu_monitor.c | 1 + src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 12 +++ .../caps_4.2.0.x86_64.xml | 92 +++++++++---------- 5 files changed, 73 insertions(+), 48 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 24ef623458..802d3f7e1a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -552,6 +552,7 @@ struct virQEMUCapsMachineType { unsigned int maxCpus; bool hotplugCpus; bool qemuDefault; + char *defaultCPU; }; =20 typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData; @@ -1630,7 +1631,8 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemu= Caps) ret->nmachineTypes =3D qemuCaps->nmachineTypes; for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { if (VIR_STRDUP(ret->machineTypes[i].name, qemuCaps->machineTypes[i= ].name) < 0 || - VIR_STRDUP(ret->machineTypes[i].alias, qemuCaps->machineTypes[= i].alias) < 0) + VIR_STRDUP(ret->machineTypes[i].alias, qemuCaps->machineTypes[= i].alias) < 0 || + VIR_STRDUP(ret->machineTypes[i].defaultCPU, qemuCaps->machineT= ypes[i].defaultCPU) < 0) goto error; ret->machineTypes[i].maxCpus =3D qemuCaps->machineTypes[i].maxCpus; ret->machineTypes[i].hotplugCpus =3D qemuCaps->machineTypes[i].hot= plugCpus; @@ -1665,6 +1667,7 @@ void virQEMUCapsDispose(void *obj) for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { VIR_FREE(qemuCaps->machineTypes[i].name); VIR_FREE(qemuCaps->machineTypes[i].alias); + VIR_FREE(qemuCaps->machineTypes[i].defaultCPU); } VIR_FREE(qemuCaps->machineTypes); =20 @@ -2398,7 +2401,8 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCa= ps, mach =3D &(qemuCaps->machineTypes[qemuCaps->nmachineTypes++]); =20 if (VIR_STRDUP(mach->alias, machines[i]->alias) < 0 || - VIR_STRDUP(mach->name, machines[i]->name) < 0) + VIR_STRDUP(mach->name, machines[i]->name) < 0 || + VIR_STRDUP(mach->defaultCPU, machines[i]->defaultCPU) < 0) goto cleanup; =20 mach->maxCpus =3D machines[i]->maxCpus; @@ -3775,6 +3779,8 @@ virQEMUCapsLoadCache(virArch hostArch, if (STREQ_NULLABLE(str, "yes")) qemuCaps->machineTypes[i].qemuDefault =3D true; VIR_FREE(str); + + qemuCaps->machineTypes[i].defaultCPU =3D virXMLPropString(node= s[i], "defaultCPU"); } } VIR_FREE(nodes); @@ -4049,6 +4055,11 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) qemuCaps->machineTypes[i].maxCpus); if (qemuCaps->machineTypes[i].qemuDefault) virBufferAddLit(&buf, " default=3D'yes'"); + + if (qemuCaps->machineTypes[i].defaultCPU) + virBufferEscapeString(&buf, " defaultCPU=3D'%s'", + qemuCaps->machineTypes[i].defaultCPU); + virBufferAddLit(&buf, "/>\n"); } =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 3bc97b8142..08ce5db2a1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3515,6 +3515,7 @@ qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPtr = machine) return; VIR_FREE(machine->name); VIR_FREE(machine->alias); + VIR_FREE(machine->defaultCPU); VIR_FREE(machine); } =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 416bbb1cba..e82c9f2ba4 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1085,6 +1085,7 @@ struct _qemuMonitorMachineInfo { char *alias; unsigned int maxCpus; bool hotplugCpus; + char *defaultCPU; }; =20 int qemuMonitorGetMachines(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index c0cd195496..008e9a0600 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5504,6 +5504,18 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, =20 ignore_value(virJSONValueObjectGetBoolean(child, "hotpluggable-cpu= s", &info->hotplugCpus)); + + if (virJSONValueObjectHasKey(child, "default-cpu-type")) { + if (!(tmp =3D virJSONValueObjectGetString(child, "default-cpu-= type"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("query-machines reply has malformed " + "'default-cpu-type' data")); + goto cleanup; + } + + if (VIR_STRDUP(info->defaultCPU, tmp) < 0) + goto cleanup; + } } =20 ret =3D n; diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.2.0.x86_64.xml index d08e4bebde..8e37f27c59 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -1903,50 +1903,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111564; cv=none; d=zoho.com; s=zohoarc; b=FSQl5VaoSIwE83r+0IWpLGtTlJo27J0+eCrafyb4W9zoaAVqMZBgzV0pJb1132lo/MkxXf3E18fRjV24gIUfnNRXKjQ/+5whoMsGukgC4fTTYmZlqpjQdKZ+sASiqMP8pX/o/dEF1q9bFm3yPpMGgf81ijYkKRWJREMi5aZPv88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111564; 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:ARC-Authentication-Results; bh=QhMhSqBKR4D0gTD306AviSghSWGTfEymCuXrhoOeDnI=; b=LDJ7Rcf51IB4zQlmALLXajpY8huZG6DqM++blULQkwQlVSlfeSl6frVZH9cGdpOwQuDPQ1fGjdxJKjFxW+W6m2Dk4zigUtwliN46Pz0c5KOQbftpfjs+wleLCipRDC+MorlZr1fpTWv/Z0XR2ZwqnUqSekR3adkI0TrUDDlWsA8= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111564893948.5063577550521; Thu, 3 Oct 2019 07:06:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2BE3B10C0515; Thu, 3 Oct 2019 14:06:02 +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 EDD1519C7F; Thu, 3 Oct 2019 14:06:01 +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 7BEDE62CF9; Thu, 3 Oct 2019 14:06:01 +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 x93E5odp021069 for ; Thu, 3 Oct 2019 10:05:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8CB834503; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6272A196B2 for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 94F25100690; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:36 +0200 Message-Id: <73c49a650b08b28f412a32f778e27558b7899173.1570111135.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 Subject: [libvirt] [PATCH 18/22] qemu: Introduce virQEMUCapsGetMachineDefaultCPU 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-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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Thu, 03 Oct 2019 14:06:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 36 ++++++++++++++++++++++++++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ 2 files changed, 39 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 802d3f7e1a..9d5eaf0c1a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2171,6 +2171,42 @@ bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr= qemuCaps, } =20 =20 +const char * +virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps, + const char *name, + virDomainVirtType type) +{ + qemuMonitorCPUDefsPtr defs; + const char *cpuType =3D NULL; + size_t i; + + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + defs =3D qemuCaps->kvmCPUModels; + else + defs =3D qemuCaps->tcgCPUModels; + + if (!name || !defs) + return NULL; + + for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { + if (STREQ(qemuCaps->machineTypes[i].name, name)) { + cpuType =3D qemuCaps->machineTypes[i].defaultCPU; + break; + } + } + + if (!cpuType) + return NULL; + + for (i =3D 0; i < defs->ncpus; i++) { + if (STREQ(defs->cpus[i].type, cpuType)) + return defs->cpus[i].name; + } + + return NULL; +} + + /** * virQEMUCapsSetGICCapabilities: * @qemuCaps: QEMU capabilities diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index f1510f3a7b..beed927f06 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -599,6 +599,9 @@ int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCap= s, const char *name); bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps, const char *name); +const char *virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps, + const char *name, + virDomainVirtType type); int virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps, size_t *nmachines, virCapsGuestMachinePtr **machines); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111568; cv=none; d=zoho.com; s=zohoarc; b=UwkWMeAZC9+rHaT9hHRCE0cNdN9pW5PkzeXr/31NwlPi2PFe16WhjdTrrSxDC2qCRct29IFL86EkBnXUsl0FKicglIbbFX/Edd0WX/AdxYqxPGm0XhXiD5nWFtupD2/4DadKHXfby8HnyT77uMU7x0gou3cImP4EO505NxsNp/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111568; 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:ARC-Authentication-Results; bh=HHjUe9UxlobS4sABikFH3ZQZqe7k1gwoSycAvno4H8s=; b=PDNe6dKjs9XDHgKt5DvLYD44zKZcv4Z+Xkj/9xutdYcx2jN/xsaZPpCbgINPBP3nSKqwtDZfy705Rpr5Cj1e+i7bSXYt2LjaheOMavkEJ8p15tLET5WquA/49rklQ2DEIDGNBbld5A0n23aEq37dd/yG+T0tn+PnTPxFskVxFc0= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111568610396.5054864059575; Thu, 3 Oct 2019 07:06:08 -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 97FC02DD3B; Thu, 3 Oct 2019 14:06:06 +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 608881001DC2; Thu, 3 Oct 2019 14:06:06 +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 150F56B49C; Thu, 3 Oct 2019 14:06:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5oDT021074 for ; Thu, 3 Oct 2019 10:05:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id C3F181001B28; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95ED11001B23 for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 9AE011008B4; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:37 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 19/22] qemu: Drop unused virQEMUCapsGetDefaultMachine 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-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.38]); Thu, 03 Oct 2019 14:06:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 12 ------------ src/qemu/qemu_capabilities.h | 1 - 2 files changed, 13 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 9d5eaf0c1a..51de44260d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2125,18 +2125,6 @@ const char *virQEMUCapsGetCanonicalMachine(virQEMUCa= psPtr qemuCaps, return name; } =20 -const char * -virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps) -{ - size_t i; - - for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { - if (qemuCaps->machineTypes[i].qemuDefault) - return qemuCaps->machineTypes[i].name; - } - - return NULL; -} =20 int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps, const char *name) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index beed927f06..335b43639d 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -594,7 +594,6 @@ bool virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuC= aps, virCPUMode mode); const char *virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps, const char *name); -const char *virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps); int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps, const char *name); bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111731; cv=none; d=zoho.com; s=zohoarc; b=Gb+XloFuhHwWkK6N+Dblf+X+J0SNIfcDigdvk4kHV7RXMZkpwgdzx/2b+tMFfzvRHw9mmClKtYD7R2Q6wj1+8jvbmvtYc/ypD45Jk5uXy1qpROn/2RFGfsoC0odjg6GRjniqWFpOQmDGdVvZa/hOcJprw7BqfXhFKn2qSWdEG40= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111731; 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:ARC-Authentication-Results; bh=UAOOJZghOqwWOANeIDKPeUC9BFbDSh8SYWiDv3G04SM=; b=oqO5q5ZClHvVasfWlNCaAJZXcdR+RzBT5NOYOif4+gGHsvE/4YEPfDJr7JqzOCFtcx11nI+guXFAZKjnSk9cOdkGwE4daJO7VQ/joU25Ucg+juehzdtXPhv7lAjuUbKm5IsjlExMSp52pHY7bp4Hp/2JMoxWEef/lzBAaaaV7q4= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111731086190.2167879145286; Thu, 3 Oct 2019 07:08:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 603C9308C1E6; Thu, 3 Oct 2019 14:08:49 +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 35A0B608A5; Thu, 3 Oct 2019 14:08:49 +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 E75896B4A9; Thu, 3 Oct 2019 14:08:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5pdW021122 for ; Thu, 3 Oct 2019 10:05:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4F59614C1; Thu, 3 Oct 2019 14:05:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87B68608C0 for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id A0D11100926; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:38 +0200 Message-Id: <3640de4a0b9865549384eafe3226b33870521b23.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 20/22] qemu: Use VIR_AUTOUNREF in qemuDomainDefPostParse 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-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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 03 Oct 2019 14:08:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b4175a846e..1d7772ee01 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4619,55 +4619,51 @@ qemuDomainDefPostParse(virDomainDefPtr def, void *parseOpaque) { virQEMUDriverPtr driver =3D opaque; - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg =3D virQEMUDriverGetConfig(d= river); /* Note that qemuCaps may be NULL when this function is called. This * function shall not fail in that case. It will be re-run on VM start= up * with the capabilities populated. */ virQEMUCapsPtr qemuCaps =3D parseOpaque; - int ret =3D -1; =20 if (def->os.bootloader || def->os.bootloaderArgs) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("bootloader is not supported by QEMU")); - goto cleanup; + return -1; } =20 if (!def->os.machine) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing machine type")); - goto cleanup; + return -1; } =20 if (qemuDomainNVRAMPathGenerate(cfg, def) < 0) - goto cleanup; + return -1; =20 if (qemuDomainDefAddDefaultDevices(def, qemuCaps) < 0) - goto cleanup; + return -1; =20 if (qemuCanonicalizeMachine(def, qemuCaps) < 0) - goto cleanup; + return -1; =20 qemuDomainDefEnableDefaultFeatures(def, qemuCaps); =20 if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0) - goto cleanup; + return -1; =20 if (qemuSecurityVerify(driver->securityManager, def) < 0) - goto cleanup; + return -1; =20 if (qemuDomainDefVcpusPostParse(def) < 0) - goto cleanup; + return -1; =20 if (qemuDomainDefCPUPostParse(def) < 0) - goto cleanup; + return -1; =20 if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0) - goto cleanup; + return -1; =20 - ret =3D 0; - cleanup: - virObjectUnref(cfg); - return ret; + return 0; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111723; cv=none; d=zoho.com; s=zohoarc; b=cj69TDYVvoaiq1sd5/ESOJRbhC3hnuEmqWtsDzOfPjzYMbtbxB7aDKBYbff7d7pmy4e8mzBZUDmyxhGB6fP0O6DPpxPj4GIdH9Q+OQTyELDj19yG5sJdvzIGGahrTWw4vJllckzs5vMXC4Rp5URKk8AXSmfu6+4mXYycJP8dTnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111723; 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:ARC-Authentication-Results; bh=5+pZUj69JH8V/acUsw2frQw7s1ss0jl7iHYxsbtbto8=; b=GmAs/D3vAX1H+Ej2kbgnZM0vfghc2uh70YNGLsgDRfoDZf7dxEPj3WSmfpy9nS3t24EzZnE+G4/cRMbIeAVKv7q2/dG4KzCKnXhNqc0qyoFr/3D8ghQYCpV3pUoT3LlJQ9iezBGxCDuIc9rNmgzyeYlAX+XrrU7hMdIlqObC6Mg= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111723376206.0935742523077; Thu, 3 Oct 2019 07:08:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1EFD10F2E89; Thu, 3 Oct 2019 14:08:41 +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 BF16C5D9E1; Thu, 3 Oct 2019 14:08:41 +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 80295180B76F; Thu, 3 Oct 2019 14:08:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5p9s021106 for ; Thu, 3 Oct 2019 10:05:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C3185D6A9; Thu, 3 Oct 2019 14:05:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51A895D772 for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id A6D77100A38; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:39 +0200 Message-Id: <9613aac53a11db7692b7640b340c591ee80e0c55.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 21/22] conf: Define VIR_AUTOPTR for virCPUDef 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-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Thu, 03 Oct 2019 14:08:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/conf/cpu_conf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index 19ce816ec2..f26f29d9fc 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -151,6 +151,7 @@ virCPUDefFreeModel(virCPUDefPtr def); =20 void virCPUDefFree(virCPUDefPtr def); +VIR_DEFINE_AUTOPTR_FUNC(virCPUDef, virCPUDefFree); =20 int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) virCPUDefCopyModel(virCPUDefPtr dst, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 19:51:56 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.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 ARC-Seal: i=1; a=rsa-sha256; t=1570111727; cv=none; d=zoho.com; s=zohoarc; b=PP+g5VaCXNPcn/lsU/Hmc/cUtRZ9+6l+6xKgipGHILrl70f2ry+GUY0FZKHTZNpHUTTmbk1NIdIGnJ3xMx7VTYJSXxtcDuTJdI2fto+1xbL6Oco6vl/Ki7kFUuYM9Te2p6GFAk8JxVCPVlbj1XpM5OrGTN/boMF8+nTAMgieEQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111727; 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:ARC-Authentication-Results; bh=h5sVbZjenQnVtWgPZqQ9fKfpokoVXEESaBQppEDEEiQ=; b=SMkCpFyLnbdsZDP5Cu7bCJCD5yTZPUz0vd3VlbtsuB6hb7qJRm47aaU7iXf5SKqLlY4gOZT4C3KAeM0GqS5tN7zgcaZdMvyaf4uaXXg4MnB4DerZuIS7pGmyTKZlY5thNfoXZlDgTBKaVddJgrD8zY05dzd/pQUHCqnU30XNpIU= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111727551119.91357779227314; Thu, 3 Oct 2019 07:08:47 -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 0149B30BC58B; Thu, 3 Oct 2019 14:08:46 +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 A0A836CA49; Thu, 3 Oct 2019 14:08:45 +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 462726B49E; Thu, 3 Oct 2019 14:08:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5pZe021113 for ; Thu, 3 Oct 2019 10:05:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 98EBB5D6A9; Thu, 3 Oct 2019 14:05:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 212695D721 for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id ADBE9100B8D; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:40 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 22/22] qemu: Store default CPU in domain XML 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-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.49]); Thu, 03 Oct 2019 14:08:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When starting a domain without a CPU model specified in the domain XML, QEMU will choose a default one. Which is fine unless the domain gets migrated to another host because libvirt doesn't perform any CPU ABI checks and the virtual CPU provided by QEMU on the destination host can differ from the one on the source host. With QEMU 4.2.0 we can probe for the default CPU model used by QEMU for a particular machine type and store it in the domain XML. This way the chosen CPU model is more visible to users and libvirt will make sure the guest will see the exact same CPU after migration. https://bugzilla.redhat.com/show_bug.cgi?id=3D1598151 https://bugzilla.redhat.com/show_bug.cgi?id=3D1598162 Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 51 +++++++++++++++++++ .../disk-cache.x86_64-latest.args | 1 + .../disk-cdrom-network.x86_64-latest.args | 1 + .../disk-cdrom-tray.x86_64-latest.args | 1 + .../disk-copy_on_read.x86_64-latest.args | 1 + .../disk-detect-zeroes.x86_64-latest.args | 1 + .../disk-floppy-q35-2_11.x86_64-latest.args | 1 + .../disk-floppy-q35-2_9.x86_64-latest.args | 1 + .../os-firmware-bios.x86_64-latest.args | 1 + ...os-firmware-efi-secboot.x86_64-latest.args | 1 + .../os-firmware-efi.x86_64-latest.args | 1 + .../tpm-emulator-tpm2-enc.x86_64-latest.args | 1 + .../tpm-emulator-tpm2.x86_64-latest.args | 1 + .../tpm-emulator.x86_64-latest.args | 1 + .../tseg-explicit-size.x86_64-latest.args | 1 + .../vhost-vsock-auto.x86_64-latest.args | 1 + .../vhost-vsock.x86_64-latest.args | 1 + .../os-firmware-bios.x86_64-latest.xml | 3 ++ .../os-firmware-efi-secboot.x86_64-latest.xml | 3 ++ .../os-firmware-efi.x86_64-latest.xml | 3 ++ .../tpm-emulator-tpm2-enc.x86_64-latest.xml | 3 ++ .../tpm-emulator-tpm2.x86_64-latest.xml | 3 ++ .../tpm-emulator.x86_64-latest.xml | 3 ++ .../tpm-passthrough-crb.x86_64-latest.xml | 3 ++ .../tpm-passthrough.x86_64-latest.xml | 3 ++ 25 files changed, 91 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1d7772ee01..1d10490059 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4472,6 +4472,54 @@ qemuDomainDefVcpusPostParse(virDomainDefPtr def) } =20 =20 +static int +qemuDomainDefSetDefaultCPU(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps) +{ + VIR_AUTOPTR(virCPUDef) newCPU =3D NULL; + virCPUDefPtr cpu =3D def->cpu; + const char *model; + + if (cpu && + (cpu->mode !=3D VIR_CPU_MODE_CUSTOM || + cpu->model)) + return 0; + + model =3D virQEMUCapsGetMachineDefaultCPU(qemuCaps, def->os.machine, d= ef->virtType); + if (!model) { + VIR_DEBUG("Unknown default CPU model for domain '%s'", def->name); + return 0; + } + + VIR_DEBUG("Setting default CPU model for domain '%s' to %s", + def->name, model); + + if (!cpu) { + if (VIR_ALLOC(newCPU) < 0) + return -1; + cpu =3D newCPU; + } + + /* We need to turn off all CPU checks when the domain is started becau= se + * the default CPU (e.g., qemu64) may not be runnable on any host. QEMU + * will just disable the unavailable features and we will update the C= PU + * definition accordingly and set check to FULL when starting the doma= in. */ + cpu->type =3D VIR_CPU_TYPE_GUEST; + cpu->mode =3D VIR_CPU_MODE_CUSTOM; + cpu->match =3D VIR_CPU_MATCH_EXACT; + cpu->check =3D VIR_CPU_CHECK_NONE; + cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; + + if (VIR_STRDUP(cpu->model, model) < 0) + return -1; + + if (newCPU) + VIR_STEAL_PTR(def->cpu, newCPU); + + return 0; +} + + static int qemuDomainDefCPUPostParse(virDomainDefPtr def) { @@ -4646,6 +4694,9 @@ qemuDomainDefPostParse(virDomainDefPtr def, if (qemuCanonicalizeMachine(def, qemuCaps) < 0) return -1; =20 + if (qemuDomainDefSetDefaultCPU(def, qemuCaps) < 0) + return -1; + qemuDomainDefEnableDefaultFeatures(def, qemuCaps); =20 if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0) diff --git a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args b/tests/q= emuxml2argvdata/disk-cache.x86_64-latest.args index 7ea6d5b4d5..01d3b9d490 100644 --- a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-i440fx-2.6,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args b= /tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args index cf711c0a3f..e0d2eb049d 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-1.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args b/te= sts/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args index ad17416851..21542db4c2 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args b/= tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args index 1f1d37c957..8552f9f00e 100644 --- a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args b= /tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args index b48c0f8d43..2a01647e50 100644 --- a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args= b/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args index 02e2b1e76c..fadd5a6d7e 100644 --- a/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-q35-2.11,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args = b/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args index a158e8e3d3..4c932a7365 100644 --- a/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-q35-2.9,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args b/t= ests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args index 7d6108ec24..4391c6eda2 100644 --- a/tests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args +++ b/tests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-fedora/master-key.aes \ -machine pc-q35-4.0,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -bios /usr/share/seabios/bios-256k.bin \ -m 8 \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.a= rgs b/tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.args index d8f356ea07..4de135beb8 100644 --- a/tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.args +++ b/tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-fedora/master-key.aes \ -machine pc-q35-4.0,accel=3Dkvm,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ +-cpu qemu64 \ -global driver=3Dcfi.pflash01,property=3Dsecure,value=3Don \ -drive file=3D/usr/share/OVMF/OVMF_CODE.secboot.fd,if=3Dpflash,format=3Dra= w,unit=3D0,\ readonly=3Don \ diff --git a/tests/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args b/te= sts/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args index e4dda734b0..7eba20e443 100644 --- a/tests/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args +++ b/tests/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-fedora/master-key.aes \ -machine pc-q35-4.0,accel=3Dkvm,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ +-cpu qemu64 \ -drive file=3D/usr/share/OVMF/OVMF_CODE.secboot.fd,if=3Dpflash,format=3Dra= w,unit=3D0,\ readonly=3Don \ -drive file=3D/var/lib/libvirt/qemu/nvram/fedora_VARS.fd,if=3Dpflash,forma= t=3Draw,\ diff --git a/tests/qemuxml2argvdata/tpm-emulator-tpm2-enc.x86_64-latest.arg= s b/tests/qemuxml2argvdata/tpm-emulator-tpm2-enc.x86_64-latest.args index 3c8dc8e483..2455e14cfe 100644 --- a/tests/qemuxml2argvdata/tpm-emulator-tpm2-enc.x86_64-latest.args +++ b/tests/qemuxml2argvdata/tpm-emulator-tpm2-enc.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-TPM-VM/master-key.aes \ -machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 2048 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/tpm-emulator-tpm2.x86_64-latest.args b/= tests/qemuxml2argvdata/tpm-emulator-tpm2.x86_64-latest.args index 3c8dc8e483..2455e14cfe 100644 --- a/tests/qemuxml2argvdata/tpm-emulator-tpm2.x86_64-latest.args +++ b/tests/qemuxml2argvdata/tpm-emulator-tpm2.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-TPM-VM/master-key.aes \ -machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 2048 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/tpm-emulator.x86_64-latest.args b/tests= /qemuxml2argvdata/tpm-emulator.x86_64-latest.args index 3c8dc8e483..2455e14cfe 100644 --- a/tests/qemuxml2argvdata/tpm-emulator.x86_64-latest.args +++ b/tests/qemuxml2argvdata/tpm-emulator.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-TPM-VM/master-key.aes \ -machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 2048 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/tseg-explicit-size.x86_64-latest.args b= /tests/qemuxml2argvdata/tseg-explicit-size.x86_64-latest.args index 2fece310e7..53dab283cc 100644 --- a/tests/qemuxml2argvdata/tseg-explicit-size.x86_64-latest.args +++ b/tests/qemuxml2argvdata/tseg-explicit-size.x86_64-latest.args @@ -14,6 +14,7 @@ QEMU_AUDIO_DRV=3Dnone \ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-q35-2.10,accel=3Dtcg,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ -global mch.extended-tseg-mbytes=3D48 \ +-cpu qemu64 \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/vhost-vsock-auto.x86_64-latest.args b/t= ests/qemuxml2argvdata/vhost-vsock-auto.x86_64-latest.args index b5d3ff2204..e083b872c5 100644 --- a/tests/qemuxml2argvdata/vhost-vsock-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/vhost-vsock-auto.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-i440fx-2.9,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/vhost-vsock.x86_64-latest.args b/tests/= qemuxml2argvdata/vhost-vsock.x86_64-latest.args index 76df9d2d4d..1b0ffee6e8 100644 --- a/tests/qemuxml2argvdata/vhost-vsock.x86_64-latest.args +++ b/tests/qemuxml2argvdata/vhost-vsock.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml b/= tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml index 63886666dd..60d3498765 100644 --- a/tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml @@ -16,6 +16,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest= .xml b/tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest.xml index a285e06334..938da73711 100644 --- a/tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest.xml @@ -16,6 +16,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml b/t= ests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml index 46a7b1b780..97ce8a75c7 100644 --- a/tests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml @@ -16,6 +16,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.x= ml b/tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.xml index dcd504310f..8a842e4d22 100644 --- a/tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml b= /tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml index 625aaa5f60..9143a1dde1 100644 --- a/tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml b/test= s/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml index 002af76c21..ff4006b2e3 100644 --- a/tests/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml= b/tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml index ef68c2d0d7..b8be67acfd 100644 --- a/tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml b/t= ests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml index 2a99f35cf8..669992bcf6 100644 --- a/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list