From nobody Mon Feb 9 01:51:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1672907770; cv=none; d=zohomail.com; s=zohoarc; b=DxCvCeiRhQPXwCFn5SDGB2IQ1UIQqQ6/m09JqEXKTUSvRhIE7N/DSvqHhbC8uqawbFwuEdL2UIQt1Co8Gm5lXlY1x5JLMConHn5EQiTUNDArzS7jYw/Ze6kkT1Kx0okqcnKEaKLT41/ZM+si19EApenPLxxepLLzQfYoaU7jpbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672907770; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r9GIlddRrVUTkvDpMf8SYwMBT+rWfzHyExHqAZDbOSo=; b=EnWleVBVTohaw8O97JhjGQelbUGDEuU7wj5QZQm0bV2e7wmUaWU4HaOSCOV+xIPTXRVqiq0ZCk2K9lDEH1wlzjJ/LClRg6p/npuQs2YTBq07kZaAbE/7Y7hgrXIBFGZpBGTq5YXyMvTK4U/HHPIxjKrFpSalVi//yXKmJ1cDGYQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1672907770148757.1442556025839; Thu, 5 Jan 2023 00:36:10 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-166-xVWv6YRDNRGqThNFQ2rd3A-1; Thu, 05 Jan 2023 03:35:12 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 799082806042; Thu, 5 Jan 2023 08:35:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64C09492D8B; Thu, 5 Jan 2023 08:35:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 598C2194658C; Thu, 5 Jan 2023 08:35:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D5CA71946586 for ; Thu, 5 Jan 2023 08:35:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CB88D492B08; Thu, 5 Jan 2023 08:35:05 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74154492B07 for ; Thu, 5 Jan 2023 08:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672907768; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=r9GIlddRrVUTkvDpMf8SYwMBT+rWfzHyExHqAZDbOSo=; b=NB+v4Rl+4Epthtj8u/y6dCOZiZiR3JDG3CrtmYf9g0VoYwpShG7sDbc10f/OugRBmq1p/7 1zc7dj5NSEMGLsljVbRWCgnwBqWYMSwD8aGd194ww+N3/HooVKURzCEn+GSFCFC5Lhr6SE jOZiEoK/ubNa2pf9zkpwQeISxq9Rr9g= X-MC-Unique: xVWv6YRDNRGqThNFQ2rd3A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 4/7] qemuMonitorJSONMakeCPUModel: Introduce @hv_passthrough argument Date: Thu, 5 Jan 2023 09:34:58 +0100 Message-Id: <90b84576d4b7b99274e827d75577acc0b4b125ad.1672907604.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672907771931100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Apart from setting @migratable prop to the query-cpu-model-expansion command, we will need @hv-passthrough so that we can query for expansion of Hyper-V Enlightenments supported on the current host. The idea is to run: { "execute": "query-cpu-model-expansion", "arguments": { "type": "full", "model": { "name": "host", "props": { "hv-passthrough": true } } } } Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 9822097bd7..f9928b0393 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4921,7 +4921,8 @@ qemuMonitorJSONParseCPUModelProperty(const char *key, =20 static virJSONValue * qemuMonitorJSONMakeCPUModel(virCPUDef *cpu, - bool migratable) + bool migratable, + bool hv_passthrough) { g_autoptr(virJSONValue) model =3D virJSONValueNewObject(); size_t i; @@ -4929,7 +4930,7 @@ qemuMonitorJSONMakeCPUModel(virCPUDef *cpu, if (virJSONValueObjectAppendString(model, "name", cpu->model) < 0) return NULL; =20 - if (cpu->nfeatures || !migratable) { + if (cpu->nfeatures || !migratable || hv_passthrough) { g_autoptr(virJSONValue) props =3D virJSONValueNewObject(); =20 for (i =3D 0; i < cpu->nfeatures; i++) { @@ -4951,6 +4952,11 @@ qemuMonitorJSONMakeCPUModel(virCPUDef *cpu, return NULL; } =20 + if (hv_passthrough && + virJSONValueObjectAppendBoolean(props, "hv-passthrough", true)= < 0) { + return NULL; + } + if (virJSONValueObjectAppend(model, "props", &props) < 0) return NULL; } @@ -5079,7 +5085,7 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon, =20 *model_info =3D NULL; =20 - if (!(model =3D qemuMonitorJSONMakeCPUModel(cpu, migratable))) + if (!(model =3D qemuMonitorJSONMakeCPUModel(cpu, migratable, false))) return -1; =20 if ((rc =3D qemuMonitorJSONQueryCPUModelExpansionOne(mon, type, &model= , &data)) <=3D 0) @@ -5128,8 +5134,8 @@ qemuMonitorJSONGetCPUModelBaseline(qemuMonitor *mon, virJSONValue *cpu_props =3D NULL; const char *cpu_name =3D ""; =20 - if (!(model_a =3D qemuMonitorJSONMakeCPUModel(cpu_a, true)) || - !(model_b =3D qemuMonitorJSONMakeCPUModel(cpu_b, true))) + if (!(model_a =3D qemuMonitorJSONMakeCPUModel(cpu_a, true, false)) || + !(model_b =3D qemuMonitorJSONMakeCPUModel(cpu_b, true, false))) return -1; =20 if (!(cmd =3D qemuMonitorJSONMakeCommand("query-cpu-model-baseline", @@ -5166,8 +5172,8 @@ qemuMonitorJSONGetCPUModelComparison(qemuMonitor *mon, const char *data_result; virJSONValue *data; =20 - if (!(model_a =3D qemuMonitorJSONMakeCPUModel(cpu_a, true)) || - !(model_b =3D qemuMonitorJSONMakeCPUModel(cpu_b, true))) + if (!(model_a =3D qemuMonitorJSONMakeCPUModel(cpu_a, true, false)) || + !(model_b =3D qemuMonitorJSONMakeCPUModel(cpu_b, true, false))) return -1; =20 if (!(cmd =3D qemuMonitorJSONMakeCommand("query-cpu-model-comparison", --=20 2.38.2