From nobody Fri Nov 7 15:21:32 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548274259659208.63187748085193; Wed, 23 Jan 2019 12:10:59 -0800 (PST) Received: from localhost ([127.0.0.1]:41082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmOrS-0005M4-EC for importer@patchew.org; Wed, 23 Jan 2019 15:10:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmOjm-00079o-TO for qemu-devel@nongnu.org; Wed, 23 Jan 2019 15:03:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmOd8-0002Wu-73 for qemu-devel@nongnu.org; Wed, 23 Jan 2019 14:56:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49052) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gmOd7-0002WA-Ti; Wed, 23 Jan 2019 14:56:10 -0500 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 B843EA08E2; Wed, 23 Jan 2019 19:56:08 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F6ED5D6A6; Wed, 23 Jan 2019 19:56:05 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Wed, 23 Jan 2019 20:55:25 +0100 Message-Id: <20190123195527.29575-8-david@redhat.com> In-Reply-To: <20190123195527.29575-1-david@redhat.com> References: <20190123195527.29575-1-david@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.39]); Wed, 23 Jan 2019 19:56:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFCv2 7/9] hmp: Handle virtio-pmem when printing memory device infos X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Murilo Opsfelder Araujo , Collin Walling , Eduardo Habkost , "Michael S . Tsirkin" , Cornelia Huck , David Hildenbrand , "Dr . David Alan Gilbert" , Markus Armbruster , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Print the memory device info just like for PCDIMM/NVDIMM. Signed-off-by: David Hildenbrand Reviewed-by: Dr. David Alan Gilbert --- hmp.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/hmp.c b/hmp.c index 8da5fd8760..25c32e0810 100644 --- a/hmp.c +++ b/hmp.c @@ -2553,6 +2553,7 @@ void hmp_info_memory_devices(Monitor *mon, const QDic= t *qdict) Error *err =3D NULL; MemoryDeviceInfoList *info_list =3D qmp_query_memory_devices(&err); MemoryDeviceInfoList *info; + VirtioPMEMDeviceInfo *vpi; MemoryDeviceInfo *value; PCDIMMDeviceInfo *di; =20 @@ -2562,19 +2563,9 @@ void hmp_info_memory_devices(Monitor *mon, const QDi= ct *qdict) if (value) { switch (value->type) { case MEMORY_DEVICE_INFO_KIND_DIMM: - di =3D value->u.dimm.data; - break; - case MEMORY_DEVICE_INFO_KIND_NVDIMM: - di =3D value->u.nvdimm.data; - break; - - default: - di =3D NULL; - break; - } - - if (di) { + di =3D value->type =3D=3D MEMORY_DEVICE_INFO_KIND_DIMM ? + value->u.dimm.data : value->u.nvdimm.data; monitor_printf(mon, "Memory device [%s]: \"%s\"\n", MemoryDeviceInfoKind_str(value->type), di->id ? di->id : ""); @@ -2587,6 +2578,18 @@ void hmp_info_memory_devices(Monitor *mon, const QDi= ct *qdict) di->hotplugged ? "true" : "false"); monitor_printf(mon, " hotpluggable: %s\n", di->hotpluggable ? "true" : "false"); + break; + case MEMORY_DEVICE_INFO_KIND_VIRTIO_PMEM: + vpi =3D value->u.virtio_pmem.data; + monitor_printf(mon, "Memory device [%s]: \"%s\"\n", + MemoryDeviceInfoKind_str(value->type), + vpi->id ? vpi->id : ""); + monitor_printf(mon, " memaddr: 0x%" PRIx64 "\n", vpi->mem= addr); + monitor_printf(mon, " size: %" PRIu64 "\n", vpi->size); + monitor_printf(mon, " memdev: %s\n", vpi->memdev); + break; + default: + g_assert_not_reached(); } } } --=20 2.17.2