From nobody Tue Nov 4 16:10:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504020740813145.30202870365906; Tue, 29 Aug 2017 08:32:20 -0700 (PDT) Received: from localhost ([::1]:45515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmiV0-0002nD-PS for importer@patchew.org; Tue, 29 Aug 2017 11:32:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmiTV-0001gJ-7u for qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmiTT-0003nS-N8 for qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:30:45 -0400 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:35373) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmiTT-0003m0-Ga for qemu-devel@nongnu.org; Tue, 29 Aug 2017 11:30:43 -0400 Received: by mail-wr0-x22a.google.com with SMTP id j29so10400608wre.2 for ; Tue, 29 Aug 2017 08:30:43 -0700 (PDT) Received: from debian-jessie.pb.local ([62.217.45.26]) by smtp.gmail.com with ESMTPSA id x7sm1702459wme.34.2017.08.29.08.30.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Aug 2017 08:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RELzZxvu+LBQSggUH+W4jKAIiwQ0nsyo62XUGJR3xvI=; b=qMZHsm3dM1vBsklEK44iBgkqOZRXkeDNCIokRlBIjWDANZntb1xKRaeQUb1ovrApKx 0VPzCWTTbFjb8Rr1mox7vh1FoQXyOamKo2XWKSBKW7eIue4AXpsHU90IvbJlOawr9ZuL KIICrZ14dr6xJaSkht4/MR7JRbFZf9irPt2x+gagawFWgeoNBal0X49TxKPYsJXdgo4s hS0tf23wxD1nwTdaPKz5zqNgu8nwT7/0S/SAJsGD8MF/u915UJvffK1C2dP7fwmr9pfQ d9Bt8DPXW10POWpPelGgsUDOZVtXReH+qNTWeOxr8hQzxwaHG4v+2m3qP/H0VhdFCM+r jYSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RELzZxvu+LBQSggUH+W4jKAIiwQ0nsyo62XUGJR3xvI=; b=UHGIYZDBG02Nv4veRU+JbITxRSd5yzaSr1On7bB7k2H+Q2F1cLnVYcCc++mi4yCoQU WAzbDHE+aaNBiSg020JydJi4UHSv/skKrJ0rRbkWSIaChWF7iuwZm41BWRDdS4giFkCp vTvVfcwLaeMfBPTUatTrFhSqCkiFDA9cmLe3qf22obHKyImdG3ubkYr0g8KmBK+TYE/d qKLQUok7MvQavF5Z7vo2Nf50FqTNs8M0pqLKyrJZ7pDmxAxFUyXayXh7Bf5eNHQ5IK9d 6DQl2mZUSarSQPy05PgNZx+zzv6kdiAMwLdfzuKtniMxHB7H5cO3bGxYgJ6wTPIBDve8 Bk9A== X-Gm-Message-State: AHYfb5i9loua/cG7xxiZ74fx/OeOprdDW6rccTUIVXfdlcjz7XTmm1fR zCBFERGqEyk5Mmfs X-Received: by 10.223.160.3 with SMTP id k3mr448719wrk.198.1504020642492; Tue, 29 Aug 2017 08:30:42 -0700 (PDT) From: Vadim Galitsyn To: Eduardo Habkost , David Hildenbrand , "Dr . David Alan Gilbert" , Markus Armbruster , Igor Mammedov , Eric Blake , qemu-devel@nongnu.org Date: Tue, 29 Aug 2017 17:30:22 +0200 Message-Id: <20170829153022.27004-4-vadim.galitsyn@profitbricks.com> X-Mailer: git-send-email 2.13.1.394.g41dd433 In-Reply-To: <20170829153022.27004-1-vadim.galitsyn@profitbricks.com> References: <20170829153022.27004-1-vadim.galitsyn@profitbricks.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22a Subject: [Qemu-devel] [PATCH v7 3/3] hmp: introduce 'info memory_size_summary' command 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: Vasilis Liaskovitis , Mohammed Gamal , Eduardo Otubo , Vadim Galitsyn Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add 'info memory_size_summary' command which is a sibling of QMP command query-memory-size-summary. It provides the following memory information in bytes: * base-memory - size of "base" memory specified with command line option = -m. * plugged-memory - amount of memory that was hot-plugged. If target does not have CONFIG_MEM_HOTPLUG enabled, no value is reported. Signed-off-by: Vasilis Liaskovitis Signed-off-by: Mohammed Gamal Signed-off-by: Eduardo Otubo Signed-off-by: Vadim Galitsyn Reviewed-by: Eugene Crosser Cc: Dr. David Alan Gilbert Cc: Markus Armbruster Cc: Igor Mammedov Cc: Eric Blake Cc: qemu-devel@nongnu.org --- hmp.h | 1 + hmp.c | 18 ++++++++++++++++++ hmp-commands-info.hx | 16 ++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/hmp.h b/hmp.h index 1ff455295e..3605003e4c 100644 --- a/hmp.h +++ b/hmp.h @@ -145,5 +145,6 @@ void hmp_info_dump(Monitor *mon, const QDict *qdict); void hmp_info_ramblock(Monitor *mon, const QDict *qdict); void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict); void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict); +void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict); =20 #endif diff --git a/hmp.c b/hmp.c index fd80dce758..b718dab4df 100644 --- a/hmp.c +++ b/hmp.c @@ -2868,3 +2868,21 @@ void hmp_info_vm_generation_id(Monitor *mon, const Q= Dict *qdict) hmp_handle_error(mon, &err); qapi_free_GuidInfo(info); } + +void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict) +{ + Error *err =3D NULL; + MemoryInfo *info =3D qmp_query_memory_size_summary(&err); + if (info) { + monitor_printf(mon, "base memory: %" PRIu64 "\n", + info->base_memory); + + if (info->has_plugged_memory) { + monitor_printf(mon, "plugged memory: %" PRIu64 "\n", + info->plugged_memory); + } + + qapi_free_MemoryInfo(info); + } + hmp_handle_error(mon, &err); +} diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index d9df238a5f..04c9db81f6 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -849,6 +849,22 @@ ETEXI .cmd =3D hmp_info_vm_generation_id, }, =20 +STEXI +@item info memory_size_summary +@findex memory_size_summary +Display the amount of initially allocated and hot-plugged (if +enabled) memory in bytes. +ETEXI + + { + .name =3D "memory_size_summary", + .args_type =3D "", + .params =3D "", + .help =3D "show the amount of initially allocated and " + "hot-plugged (if enabled) memory in bytes.", + .cmd =3D hmp_info_memory_size_summary, + }, + STEXI @end table ETEXI --=20 2.13.1.394.g41dd433