qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 139/147] meson: replace create-config with meson configure_fi


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 139/147] meson: replace create-config with meson configure_file
Date: Tue, 11 Aug 2020 18:20:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 8/10/20 7:08 PM, Paolo Bonzini wrote:
> Move the create-config logic to meson.build; create a
> configuration_data object and let meson handle the
> quoting and output.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  Makefile                       |   2 +-
>  block.c                        |   4 +-
>  configure                      |   9 ++-
>  meson.build                    | 100 ++++++++++++++++++++++---------
>  scripts/create_config          | 131 
> -----------------------------------------
>  tests/qtest/bios-tables-test.c |   2 +-
>  6 files changed, 80 insertions(+), 168 deletions(-)
>  delete mode 100755 scripts/create_config
> 
> diff --git a/Makefile b/Makefile
> index cd4eeb5..1eec727 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -189,7 +189,7 @@ clean: recurse-clean
>       rm -f fsdev/*.pod scsi/*.pod
>       rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
>  
> -VERSION ?= $(shell cat VERSION)
> +VERSION = $(shell cat $(SRC_PATH)/VERSION)
>  
>  dist: qemu-$(VERSION).tar.bz2
>  
> diff --git a/block.c b/block.c
> index 67c5028..67ca543 100644
> --- a/block.c
> +++ b/block.c
> @@ -443,13 +443,13 @@ static int bdrv_format_is_whitelisted(const char 
> *format_name, bool read_only)
>          return 1;               /* no whitelist, anything goes */
>      }
>  
> -    for (p = whitelist_rw; *p; p++) {
> +    for (p = whitelist_rw; p < &whitelist_rw[ARRAY_SIZE(whitelist_rw)]; p++) 
> {

Alexander reported [*] a problem when ARRAY_SIZE(whitelist_rw) == 0 you
access an undefined address:

block.c:442:10: runtime error: index 0 out of bounds for type 'const
char *[0]'

[*] https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg02066.html

>          if (!strcmp(format_name, *p)) {
>              return 1;
>          }
>      }
>      if (read_only) {
> -        for (p = whitelist_ro; *p; p++) {
> +        for (p = whitelist_ro; p < &whitelist_ro[ARRAY_SIZE(whitelist_ro)]; 
> p++) {

Ditto.

>              if (!strcmp(format_name, *p)) {
>                  return 1;
>              }
[...]




reply via email to

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