[libvirt] [PATCH] qemu_monitor: s/size_t/ULL/ in qemuMonitorSave{Virtual, Physical}Memory

Peter Krempa pkrempa at redhat.com
Fri Sep 27 12:18:02 UTC 2019


On Fri, Sep 27, 2019 at 13:57:26 +0200, Michal Privoznik wrote:
> As it turns out, on my 32bit ARM machine size_t is not the same
> size as ULL. However, @length argument for both functions is type
> of size_t but it's treated as ULL - for instance when passed to
> qemuMonitorJSONMakeCommand(). The problem is that because of
> "U:size" the virJSONValueObjectAddVArgs() expects an ULL argument
> but on the stack there are size_t and char * arguments (which
> coincidentally add up to size of ULL). So the created command has
> only two arguments "val" and incorrect "size" and no "path" which
> is required.
> 
> I've tried to find other occurrences of this pattern but at the
> rest of places where size_t is used it tracks size of an array so
> that's safe.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/qemu/qemu_monitor.c      | 8 ++++----
>  src/qemu/qemu_monitor.h      | 4 ++--
>  src/qemu/qemu_monitor_json.c | 6 +++---
>  src/qemu/qemu_monitor_json.h | 4 ++--
>  4 files changed, 11 insertions(+), 11 deletions(-)

ACK




More information about the libvir-list mailing list