Skip to content
  • Eric Blake's avatar
    a73049b2
    numa: Check for qemu_strtosz_MiB error · a73049b2
    Eric Blake authored
    
    
    As shown in the previous commit, qemu_strtosz_MiB sometimes leaves the
    result value untouched (we have to audit further to learn that in that
    case, the QAPI generator says that visit_type_NumaOptions() will have
    zero-initialized it), and sometimes leaves it with the value of a
    partial parse before -EINVAL occurs because of trailing garbage.
    Rather than blindly treating any string the user may throw at us as
    valid, we should check for parse failures.
    
    Fixes: cc001888 ("numa: fixup parsed NumaNodeOptions earlier", v2.11.0)
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarHanna Czenczek <hreitz@redhat.com>
    Message-Id: <20230522190441.64278-14-eblake@redhat.com>
    a73049b2
    numa: Check for qemu_strtosz_MiB error
    Eric Blake authored
    
    
    As shown in the previous commit, qemu_strtosz_MiB sometimes leaves the
    result value untouched (we have to audit further to learn that in that
    case, the QAPI generator says that visit_type_NumaOptions() will have
    zero-initialized it), and sometimes leaves it with the value of a
    partial parse before -EINVAL occurs because of trailing garbage.
    Rather than blindly treating any string the user may throw at us as
    valid, we should check for parse failures.
    
    Fixes: cc001888 ("numa: fixup parsed NumaNodeOptions earlier", v2.11.0)
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarHanna Czenczek <hreitz@redhat.com>
    Message-Id: <20230522190441.64278-14-eblake@redhat.com>
Loading