qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] !fixup 052f529eb3d07170b18b8d0920bc8c450e389a2f


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] !fixup 052f529eb3d07170b18b8d0920bc8c450e389a2f
Date: Mon, 2 Jul 2018 15:32:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 30/06/2018 18:50, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> This was in address@hidden but I can't
> find it on the list...
> 
>  tests/test-cutils.c    | 2 +-
>  tests/test-qemu-opts.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/test-cutils.c b/tests/test-cutils.c
> index a6e5fe4984..d85c3e0f6d 100644
> --- a/tests/test-cutils.c
> +++ b/tests/test-cutils.c
> @@ -26,7 +26,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -
> +#include "qemu/units.h"
>  #include "qemu/cutils.h"
>  #include "qemu/units.h"
>  
> diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
> index fd4d848f66..43869cb754 100644
> --- a/tests/test-qemu-opts.c
> +++ b/tests/test-qemu-opts.c
> @@ -8,7 +8,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> -#include "qemu/cutils.h"
> +#include "qemu/units.h"
>  #include "qemu/option.h"
>  #include "qemu/option_int.h"
>  #include "qapi/error.h"
> 

Not enough, this is needed too in order to avoid integer overflows in constant 
expressions:

diff --git a/tests/test-keyval.c b/tests/test-keyval.c
index dce9f7a..09b0ae3 100644
--- a/tests/test-keyval.c
+++ b/tests/test-keyval.c
@@ -462,7 +462,7 @@ static void test_keyval_visit_size(void)
     visit_type_size(v, "sz4", &sz, &error_abort);
     g_assert_cmphex(sz, ==, GiB / 10);
     visit_type_size(v, "sz5", &sz, &error_abort);
-    g_assert_cmphex(sz, ==, 16777215 * TiB);
+    g_assert_cmphex(sz, ==, 16777215ULL * TiB);
     visit_check_struct(v, &error_abort);
     visit_end_struct(v, NULL);
     visit_free(v);
Stage this hunk [y,n,q,a,d,/,e,?]? y

diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index 43869cb..ef96e84 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -709,7 +709,7 @@ static void test_opts_parse_size(void)
                            false, &error_abort);
     g_assert_cmpuint(opts_count(opts), ==, 2);
     g_assert_cmphex(qemu_opt_get_size(opts, "size1", 0), ==, GiB / 10);
-    g_assert_cmphex(qemu_opt_get_size(opts, "size2", 0), ==, 16777215U * TiB);
+    g_assert_cmphex(qemu_opt_get_size(opts, "size2", 0), ==, 16777215ULL * 
TiB);
 
     /* Beyond limit with suffix */
     opts = qemu_opts_parse(&opts_list_02, "size1=16777216T",

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]