Skip to content
  • KONRAD Frederic's avatar
    41b65134
    qcow: fix a reference leak · 41b65134
    KONRAD Frederic authored
    Since 42a3e1ab qemu asserts when using the
    vvfat driver:
    
    git clone git://qemu.org/qemu.git
    
    
    cd qemu
    ./configure --target-list=ppc-softmmu --enable-debug
    make -j8
    mkdir foo
    touch foo/hello
    ./ppc-softmmu/qemu-system-ppc -M prep --nographic --monitor null             \
                                  -hda fat:rw:./foo
    
    "Ctrl-C"
    
    qemu-system-ppc: block.c:3368: bdrv_close_all: Assertion                     \
       `((&all_bdrv_states)->tqh_first == ((void *)0))' failed.
    
    This is because we reference bs twice in qcow_co_create(..) one time in
    bdrv_open_blockdev_ref(..) and in blk_insert_bs(..) but we unref it only once
    in blk_unref which leads to the reference leak.
    
    Note that I didn't tested much QCOW after this change as I don't use it much.
    
    Signed-off-by: default avatarKONRAD Frederic <frederic.konrad@adacore.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    41b65134
    qcow: fix a reference leak
    KONRAD Frederic authored
    Since 42a3e1ab qemu asserts when using the
    vvfat driver:
    
    git clone git://qemu.org/qemu.git
    
    
    cd qemu
    ./configure --target-list=ppc-softmmu --enable-debug
    make -j8
    mkdir foo
    touch foo/hello
    ./ppc-softmmu/qemu-system-ppc -M prep --nographic --monitor null             \
                                  -hda fat:rw:./foo
    
    "Ctrl-C"
    
    qemu-system-ppc: block.c:3368: bdrv_close_all: Assertion                     \
       `((&all_bdrv_states)->tqh_first == ((void *)0))' failed.
    
    This is because we reference bs twice in qcow_co_create(..) one time in
    bdrv_open_blockdev_ref(..) and in blk_insert_bs(..) but we unref it only once
    in blk_unref which leads to the reference leak.
    
    Note that I didn't tested much QCOW after this change as I don't use it much.
    
    Signed-off-by: default avatarKONRAD Frederic <frederic.konrad@adacore.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading