Skip to content
  • Marc-André Lureau's avatar
    5923f85f
    qapi: update the qobject visitor to use QNUM_U64 · 5923f85f
    Marc-André Lureau authored
    
    
    Switch to use QNum/uint where appropriate to remove i64 limitation.
    
    The input visitor will cast i64 input to u64 for compatibility
    reasons (existing json QMP client already use negative i64 for large
    u64, and expect an implicit cast in qemu).
    
    Note: before the patch, uint64_t values above INT64_MAX are sent over
    json QMP as negative values, e.g. UINT64_MAX is sent as -1. After the
    patch, they are sent unmodified.  Clearly a bug fix, but we have to
    consider compatibility issues anyway.  libvirt should cope fine,
    because its parsing of unsigned integers accepts negative values
    modulo 2^64.  There's hope that other clients will, too.
    
    Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20170607163635.17635-12-marcandre.lureau@redhat.com>
    [check_native_list() tweaked for consistency with signed case]
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    5923f85f
    qapi: update the qobject visitor to use QNUM_U64
    Marc-André Lureau authored
    
    
    Switch to use QNum/uint where appropriate to remove i64 limitation.
    
    The input visitor will cast i64 input to u64 for compatibility
    reasons (existing json QMP client already use negative i64 for large
    u64, and expect an implicit cast in qemu).
    
    Note: before the patch, uint64_t values above INT64_MAX are sent over
    json QMP as negative values, e.g. UINT64_MAX is sent as -1. After the
    patch, they are sent unmodified.  Clearly a bug fix, but we have to
    consider compatibility issues anyway.  libvirt should cope fine,
    because its parsing of unsigned integers accepts negative values
    modulo 2^64.  There's hope that other clients will, too.
    
    Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20170607163635.17635-12-marcandre.lureau@redhat.com>
    [check_native_list() tweaked for consistency with signed case]
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Loading