"Dr. David Alan Gilbert" <dgilb...@redhat.com> writes:

> * Markus Armbruster (arm...@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 <arm...@redhat.com>
>> ---
>>  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 <dgilb...@redhat.com>

Thanks!

Reply via email to