From nobody Mon Feb 9 12:28:44 2026 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 1526917143880593.9245351629819; Mon, 21 May 2018 08:39:03 -0700 (PDT) Received: from localhost ([::1]:51210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKmtp-00040w-DA for importer@patchew.org; Mon, 21 May 2018 11:39:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKmrj-0001rH-02 for qemu-devel@nongnu.org; Mon, 21 May 2018 11:36:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKmrg-0005KW-Bx for qemu-devel@nongnu.org; Mon, 21 May 2018 11:36:51 -0400 Received: from zucker2.schokokeks.org ([178.63.68.90]:51641) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fKmrg-0005J6-5a for qemu-devel@nongnu.org; Mon, 21 May 2018 11:36:48 -0400 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; Mon, 21 May 2018 17:37:07 +0200 id 00000000000000A4.000000005B02E7A3.0000090A From: Simon Ruderich To: qemu-devel@nongnu.org Date: Mon, 21 May 2018 17:36:43 +0200 Message-Id: X-Mailer: git-send-email 2.17.0 In-Reply-To: References: <0e59c79ddc01e195ddc59d77d9df2b95bf89b600.1523395243.git.simon@ruderich.org> In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.63.68.90 Subject: [Qemu-devel] [PATCH v3 4/5] hmp: don't truncate size in hmp_memsave/hmp_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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The called function takes an uint64_t as size parameter and qdict_get_int() returns an uint64_t. Don't truncate it needlessly to an uint32_t. Signed-off-by: Simon Ruderich Reviewed-by: Eric Blake --- hmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmp.c b/hmp.c index ef93f4878b..a4d28913bb 100644 --- a/hmp.c +++ b/hmp.c @@ -1079,7 +1079,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; @@ -1096,7 +1096,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.15.0