From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6b2-0001eP-PX for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:39:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6b1-0003Zp-LF for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:39:04 -0400 From: Markus Armbruster References: <1502117160-24655-1-git-send-email-armbru@redhat.com> <1502117160-24655-8-git-send-email-armbru@redhat.com> <20170808143101.GJ2081@work-vm> Date: Tue, 08 Aug 2017 17:37:37 +0200 In-Reply-To: <20170808143101.GJ2081@work-vm> (David Alan Gilbert's message of "Tue, 8 Aug 2017 15:31:02 +0100") Message-ID: <87fud26pfi.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RFC PATCH 07/56] cpus: Make memsave, pmemsave sizes, addresses unsigned in QAPI/QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org, quintela@redhat.com, jsnow@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com "Dr. David Alan Gilbert" writes: > * Markus Armbruster (armbru@redhat.com) wrote: >> Sizes, virtual and physical addresses should use QAPI type 'size' >> (uint64_t). memsave, pmemsave parameters @val, @size are 'int' >> (int64_t). qmp_memsave() and qmp_pmemsave() implicitly convert to >> target_ulong or hwaddr. >> >> Change the parameters to 'size'. >> >> Both commands now accept size and address values between 2^63 and >> 2^64-1. They accept negative values as before, because that's how the >> QObject input visitor works for backward compatibility. >> >> The HMP commands' size parameters remain uint32_t, as HMP args_type >> strings can't do uint64_t byte counts: 'l' is signed, and 'o' >> multiplies by 2^20. Their address parameters remain int64_t for the >> same reason. >> >> Signed-off-by: Markus Armbruster >> --- >> cpus.c | 6 +++--- >> qapi-schema.json | 5 +++-- >> 2 files changed, 6 insertions(+), 5 deletions(-) >> >> diff --git a/cpus.c b/cpus.c >> index 9bed61e..8c5ee05 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -1947,14 +1947,14 @@ CpuInfoList *qmp_query_cpus(Error **errp) >> return head; >> } >> >> -void qmp_memsave(int64_t addr, int64_t size, const char *filename, >> +void qmp_memsave(uint64_t addr, uint64_t size, const char *filename, >> bool has_cpu, int64_t cpu_index, Error **errp) >> { >> FILE *f; >> uint32_t l; >> CPUState *cpu; >> uint8_t buf[1024]; >> - int64_t orig_addr = addr, orig_size = size; >> + uint64_t orig_addr = addr, orig_size = size; >> >> if (!has_cpu) { >> cpu_index = 0; > > a little bit further down is a: > error_setg(errp, "Invalid addr 0x%016" PRIx64 "/size %" PRId64 > " specified", orig_addr, orig_size); > > that PRId64 should be a PRIu64 now Will fix. > However, other than that; > > > Reviewed-by: Dr. David Alan Gilbert Thanks!