[PATCH v4 0/7] Tighten qemu-img rules on missing backing format

Eric Blake eblake at redhat.com
Thu Mar 12 22:01:10 UTC 2020


On 3/12/20 4:39 PM, no-reply at patchew.org wrote:
> Patchew URL: https://patchew.org/QEMU/20200312192822.3739399-1-eblake@redhat.com/
> 
> 
> 
> Hi,
> 
> This series failed the asan build test. Please find the testing commands and
> their output below. If you have Docker installed, you can probably reproduce it
> locally.
> 
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> export ARCH=x86_64
> make docker-image-fedora V=1 NETWORK=1
> time make docker-test-debug at fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
> === TEST SCRIPT END ===
> 
>    CC      block/replication.o
>    CC      block/throttle.o
>    CC      block/copy-on-read.o
> /tmp/qemu-test/src/block/sheepdog.c:2174:9: error: variable 'qdict' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
>      if (backing_fmt && strcmp(backing_fmt, "sheepdog") != 0) {
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /tmp/qemu-test/src/block/sheepdog.c:2241:19: note: uninitialized use occurs here
> ---
>                  ^
>                   = NULL

Bah, real problem (and I missed it because I compiled for debug, while 
this error depends on -O2 for gcc to flag it).  Squash this in:

diff --git i/block/sheepdog.c w/block/sheepdog.c
index 376f4ef74638..e0ea335131d9 100644
--- i/block/sheepdog.c
+++ w/block/sheepdog.c
@@ -2161,9 +2161,9 @@ static int coroutine_fn sd_co_create_opts(const 
char *filename, QemuOpts *opts,
                                            Error **errp)
  {
      BlockdevCreateOptions *create_options = NULL;
-    QDict *qdict, *location_qdict;
+    QDict *qdict = NULL, *location_qdict;
      Visitor *v;
-    char *redundancy;
+    char *redundancy = NULL;
      Error *local_err = NULL;
      int ret;
      char *backing_fmt = NULL;

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the libvir-list mailing list