From nobody Thu Nov 6 18:12:53 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; 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 1542287055778479.3102947792396; Thu, 15 Nov 2018 05:04:15 -0800 (PST) Received: from localhost ([::1]:38686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNHJb-00009I-1f for importer@patchew.org; Thu, 15 Nov 2018 08:04:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNHHB-00075h-Oz for qemu-devel@nongnu.org; Thu, 15 Nov 2018 08:01:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNHH6-0003bm-4D for qemu-devel@nongnu.org; Thu, 15 Nov 2018 08:01:41 -0500 Received: from zucker2.schokokeks.org ([178.63.68.90]:54899) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNHH5-0003Wr-Sy for qemu-devel@nongnu.org; Thu, 15 Nov 2018 08:01:36 -0500 Received: from blood-stain-child.lan.ruderich.org (localhost [::1]) (AUTH: PLAIN simon@ruderich.org, TLS: TLSv1/SSLv3, 128bits, ECDHE-RSA-AES128-GCM-SHA256) by zucker.schokokeks.org with ESMTPSA; Thu, 15 Nov 2018 14:01:17 +0100 id 0000000000000108.000000005BED6E1D.00001988 From: Simon Ruderich To: qemu-devel@nongnu.org Date: Thu, 15 Nov 2018 14:01:11 +0100 Message-Id: <796b3cef2ba2340b973a887c801cfd79e9ee8908.1542285958.git.simon@ruderich.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: <0e59c79ddc01e195ddc59d77d9df2b95bf89b600.1523395243.git.simon@ruderich.org> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mime-Autoconverted: from 8bit to 7bit by courier 0.75 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 178.63.68.90 Subject: [Qemu-devel] [PATCH v6 3/6] hmp: use l for size argument in memsave/pmemsave 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: Simon Ruderich , David Alan Gilbert , Markus Armbruster , Peter Crosthwaite , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" i is only 32-bit. To prevent possible truncation when dumping large memory regions use l which is target long. Suggested-by: Dr. David Alan Gilbert Signed-off-by: Simon Ruderich Reviewed-by: Dr. David Alan Gilbert --- hmp-commands.hx | 4 ++-- hmp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index db0c681f74..ff96c3ad24 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -833,7 +833,7 @@ ETEXI =20 { .name =3D "memsave", - .args_type =3D "val:l,size:i,filename:s", + .args_type =3D "val:l,size:l,filename:s", .params =3D "addr size file", .help =3D "save to disk virtual memory dump starting at 'add= r' of size 'size'", .cmd =3D hmp_memsave, @@ -847,7 +847,7 @@ ETEXI =20 { .name =3D "pmemsave", - .args_type =3D "val:l,size:i,filename:s", + .args_type =3D "val:l,size:l,filename:s", .params =3D "addr size file", .help =3D "save to disk physical memory dump starting at 'ad= dr' of size 'size'", .cmd =3D hmp_pmemsave, diff --git a/hmp.c b/hmp.c index 7828f93a39..42a5d163cd 100644 --- a/hmp.c +++ b/hmp.c @@ -1143,7 +1143,7 @@ void hmp_cpu(Monitor *mon, const QDict *qdict) =20 void hmp_memsave(Monitor *mon, const QDict *qdict) { - uint32_t size =3D qdict_get_int(qdict, "size"); + uint64_t size =3D qdict_get_int(qdict, "size"); const char *filename =3D qdict_get_str(qdict, "filename"); uint64_t addr =3D qdict_get_int(qdict, "val"); Error *err =3D NULL; @@ -1160,7 +1160,7 @@ void hmp_memsave(Monitor *mon, const QDict *qdict) =20 void hmp_pmemsave(Monitor *mon, const QDict *qdict) { - uint32_t size =3D qdict_get_int(qdict, "size"); + uint64_t size =3D qdict_get_int(qdict, "size"); const char *filename =3D qdict_get_str(qdict, "filename"); uint64_t addr =3D qdict_get_int(qdict, "val"); Error *err =3D NULL; --=20 2.19.1