qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 01/13] fuzz: use qemu_get_exec_dir


From: Alexander Bulekov
Subject: Re: [PATCH 01/13] fuzz: use qemu_get_exec_dir
Date: Tue, 1 Sep 2020 10:36:13 -0400

On 200901 0220, Paolo Bonzini wrote:
> Make things consistent with how softmmu/vl.c uses os_find_datadir.
> Initializing the path to the executables will also be needed for
> get_relocatable_path to work.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tests/qtest/fuzz/fuzz.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
> index 1ceea84702..391223219d 100644
> --- a/tests/qtest/fuzz/fuzz.c
> +++ b/tests/qtest/fuzz/fuzz.c
> @@ -152,6 +152,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char 
> ***envp)
>      module_call_init(MODULE_INIT_QOM);
>      module_call_init(MODULE_INIT_LIBQOS);
>  
> +    qemu_init_exec_dir(**argv);
>      target_name = strstr(**argv, "-target-");
>      if (target_name) {        /* The binary name specifies the target */
>          target_name += strlen("-target-");
> @@ -164,7 +165,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char 
> ***envp)
>           * location of the executable. Using this we add exec_dir/pc-bios to
>           * the datadirs.
>           */
> -        bindir = g_path_get_dirname(**argv);
> +        bindir = qemu_get_exec_dir();
>          datadir = g_build_filename(bindir, "pc-bios", NULL);
>          g_free(bindir);
>          if (g_file_test(datadir, G_FILE_TEST_IS_DIR)) {
> -- 
> 2.26.2
> 
> 
> 

Thanks.

I think this should be applied after
[PATCH 02/13] oslib: do not call g_strdup from qemu_get_exec_dir
for bisectability, since before 02/13, calling qemu_init_exec_dir
twice causes an assertion failure.

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



reply via email to

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