diff mbox series

[v2] fuzz: Display hexadecimal value with '0x' prefix

Message ID 20210612195842.1595999-1-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series [v2] fuzz: Display hexadecimal value with '0x' prefix | expand

Commit Message

Philippe Mathieu-Daudé June 12, 2021, 7:58 p.m. UTC
Use memory_region_size() to get the MemoryRegion size,
and display it with the '0x' prefix.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2:
- Use PRIx64 (lvivier)
- Use memory_region_size()
---
 tests/qtest/fuzz/generic_fuzz.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Richard Henderson June 12, 2021, 8:36 p.m. UTC | #1
On 6/12/21 12:58 PM, Philippe Mathieu-Daudé wrote:
> Use memory_region_size() to get the MemoryRegion size,
> and display it with the '0x' prefix.
> 
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
> v2:
> - Use PRIx64 (lvivier)
> - Use memory_region_size()
> ---
>   tests/qtest/fuzz/generic_fuzz.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Alexander Bulekov June 13, 2021, 2:23 a.m. UTC | #2
On 210612 2158, Philippe Mathieu-Daudé wrote:
> Use memory_region_size() to get the MemoryRegion size,
> and display it with the '0x' prefix.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> - Use PRIx64 (lvivier)
> - Use memory_region_size()
> ---
>  tests/qtest/fuzz/generic_fuzz.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Alexander Bulekov <alxndr@bu.edu>

Thanks!
Thomas Huth June 13, 2021, 6 a.m. UTC | #3
On 12/06/2021 21.58, Philippe Mathieu-Daudé wrote:
> Use memory_region_size() to get the MemoryRegion size,
> and display it with the '0x' prefix.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> - Use PRIx64 (lvivier)
> - Use memory_region_size()
> ---
>   tests/qtest/fuzz/generic_fuzz.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c
> index cea7d4058e8..6c675227174 100644
> --- a/tests/qtest/fuzz/generic_fuzz.c
> +++ b/tests/qtest/fuzz/generic_fuzz.c
> @@ -841,9 +841,9 @@ static void generic_pre_fuzz(QTestState *s)
>   
>       g_hash_table_iter_init(&iter, fuzzable_memoryregions);
>       while (g_hash_table_iter_next(&iter, (gpointer)&mr, NULL)) {
> -        printf("  * %s (size %lx)\n",
> +        printf("  * %s (size 0x%" PRIx64 ")\n",
>                  object_get_canonical_path_component(&(mr->parent_obj)),
> -               (uint64_t)mr->size);
> +               memory_region_size(mr));
>       }
>   
>       if (!g_hash_table_size(fuzzable_memoryregions)) {
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Laurent Vivier June 13, 2021, 12:47 p.m. UTC | #4
Le 12/06/2021 à 21:58, Philippe Mathieu-Daudé a écrit :
> Use memory_region_size() to get the MemoryRegion size,
> and display it with the '0x' prefix.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> - Use PRIx64 (lvivier)
> - Use memory_region_size()
> ---
>  tests/qtest/fuzz/generic_fuzz.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c
> index cea7d4058e8..6c675227174 100644
> --- a/tests/qtest/fuzz/generic_fuzz.c
> +++ b/tests/qtest/fuzz/generic_fuzz.c
> @@ -841,9 +841,9 @@ static void generic_pre_fuzz(QTestState *s)
>  
>      g_hash_table_iter_init(&iter, fuzzable_memoryregions);
>      while (g_hash_table_iter_next(&iter, (gpointer)&mr, NULL)) {
> -        printf("  * %s (size %lx)\n",
> +        printf("  * %s (size 0x%" PRIx64 ")\n",
>                 object_get_canonical_path_component(&(mr->parent_obj)),
> -               (uint64_t)mr->size);
> +               memory_region_size(mr));
>      }
>  
>      if (!g_hash_table_size(fuzzable_memoryregions)) {
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox series

Patch

diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c
index cea7d4058e8..6c675227174 100644
--- a/tests/qtest/fuzz/generic_fuzz.c
+++ b/tests/qtest/fuzz/generic_fuzz.c
@@ -841,9 +841,9 @@  static void generic_pre_fuzz(QTestState *s)
 
     g_hash_table_iter_init(&iter, fuzzable_memoryregions);
     while (g_hash_table_iter_next(&iter, (gpointer)&mr, NULL)) {
-        printf("  * %s (size %lx)\n",
+        printf("  * %s (size 0x%" PRIx64 ")\n",
                object_get_canonical_path_component(&(mr->parent_obj)),
-               (uint64_t)mr->size);
+               memory_region_size(mr));
     }
 
     if (!g_hash_table_size(fuzzable_memoryregions)) {