[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [RFC PATCH 07/56] cpus: Make memsave, pmemsave sizes, a
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-block] [RFC PATCH 07/56] cpus: Make memsave, pmemsave sizes, addresses unsigned in QAPI/QMP |
Date: |
Tue, 8 Aug 2017 15:31:02 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
* Markus Armbruster (address@hidden) 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 <address@hidden>
> ---
> 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
However, other than that;
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> @@ -1994,7 +1994,7 @@ exit:
> fclose(f);
> }
>
> -void qmp_pmemsave(int64_t addr, int64_t size, const char *filename,
> +void qmp_pmemsave(uint64_t addr, uint64_t size, const char *filename,
> Error **errp)
> {
> FILE *f;
> diff --git a/qapi-schema.json b/qapi-schema.json
> index f4a71df..80458fa 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -2460,7 +2460,8 @@
> #
> ##
> { 'command': 'memsave',
> - 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index':
> 'int'} }
> + 'data': {'val': 'size', 'size': 'size', 'filename': 'str',
> + '*cpu-index': 'int'} }
>
> ##
> # @pmemsave:
> @@ -2489,7 +2490,7 @@
> #
> ##
> { 'command': 'pmemsave',
> - 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
> + 'data': {'val': 'size', 'size': 'size', 'filename': 'str'} }
>
> ##
> # @cont:
> --
> 2.7.5
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- [Qemu-block] [RFC PATCH 15/56] migration: Make XBZRLE cache size unsigned in QAPI/QMP, (continued)
- [Qemu-block] [RFC PATCH 15/56] migration: Make XBZRLE cache size unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 08/56] dump: Make sizes and addresses unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 24/56] block/qcow2: Change align_offset() to operate on uint64_t, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 10/56] hmp: Make balloon's argument unsigned, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 23/56] option: Fix type of qemu_opt_set_number() parameter @val, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 07/56] cpus: Make memsave, pmemsave sizes, addresses unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- Re: [Qemu-block] [RFC PATCH 07/56] cpus: Make memsave, pmemsave sizes, addresses unsigned in QAPI/QMP,
Dr. David Alan Gilbert <=
- [Qemu-block] [RFC PATCH 12/56] pc-dimm: Make size and address unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 29/56] block: Make BlockDirtyInfo byte count unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
[Qemu-block] [RFC PATCH 35/56] blockjob: Lift speed sign conversion into block_job_set_speed(), Markus Armbruster, 2017/08/07