From patchwork Thu Apr 12 12:50:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Ruderich X-Patchwork-Id: 10338475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C127A60153 for ; Thu, 12 Apr 2018 12:55:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE6D62888B for ; Thu, 12 Apr 2018 12:55:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0D8A2888E; Thu, 12 Apr 2018 12:55:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 329CE2888B for ; Thu, 12 Apr 2018 12:55:35 +0000 (UTC) Received: from localhost ([::1]:37510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6blG-0007j7-4e for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 Apr 2018 08:55:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6bgZ-0004AE-22 for qemu-devel@nongnu.org; Thu, 12 Apr 2018 08:50:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6bgW-0005mc-6E for qemu-devel@nongnu.org; Thu, 12 Apr 2018 08:50:43 -0400 Received: from zucker2.schokokeks.org ([178.63.68.90]:55003) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f6bgW-0005ls-0D for qemu-devel@nongnu.org; Thu, 12 Apr 2018 08:50:40 -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; Thu, 12 Apr 2018 14:50:43 +0200 id 000000000000003B.000000005ACF5623.00002A99 From: Simon Ruderich To: qemu-devel@nongnu.org Date: Thu, 12 Apr 2018 14:50:37 +0200 Message-Id: <510ceca2c869bb1e8d4bdd87986f23170b779047.1523537181.git.simon@ruderich.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <68c390f22ae2afc6539cd7b127063e3d9534d50b.1523537181.git.simon@ruderich.org> References: <20180412124834.GA2025@ruderich.org> <68c390f22ae2afc6539cd7b127063e3d9534d50b.1523537181.git.simon@ruderich.org> In-Reply-To: <68c390f22ae2afc6539cd7b127063e3d9534d50b.1523537181.git.simon@ruderich.org> References: <68c390f22ae2afc6539cd7b127063e3d9534d50b.1523537181.git.simon@ruderich.org> 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 v2 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 a25c7bd9a8..1e392055f7 100644 --- a/hmp.c +++ b/hmp.c @@ -1064,7 +1064,7 @@ void hmp_cpu(Monitor *mon, const QDict *qdict) void hmp_memsave(Monitor *mon, const QDict *qdict) { - uint32_t size = qdict_get_int(qdict, "size"); + uint64_t size = qdict_get_int(qdict, "size"); const char *filename = qdict_get_str(qdict, "filename"); uint64_t addr = qdict_get_int(qdict, "val"); Error *err = NULL; @@ -1081,7 +1081,7 @@ void hmp_memsave(Monitor *mon, const QDict *qdict) void hmp_pmemsave(Monitor *mon, const QDict *qdict) { - uint32_t size = qdict_get_int(qdict, "size"); + uint64_t size = qdict_get_int(qdict, "size"); const char *filename = qdict_get_str(qdict, "filename"); uint64_t addr = qdict_get_int(qdict, "val"); Error *err = NULL;