qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 41b651: qcow: fix a reference leak


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 41b651: qcow: fix a reference leak
Date: Tue, 31 Jul 2018 01:56:40 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 41b6513436d2ebb64c7df8f009f630922a8e8990
      
https://github.com/qemu/qemu/commit/41b6513436d2ebb64c7df8f009f630922a8e8990
  Author: KONRAD Frederic <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M block/qcow.c

  Log Message:
  -----------
  qcow: fix a reference leak

Since 42a3e1ab367cdf38cce093de24eb406b99a4ef96 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: KONRAD Frederic <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 308999e9d46c7db062d314df98295a38e5732d01
      
https://github.com/qemu/qemu/commit/308999e9d46c7db062d314df98295a38e5732d01
  Author: Leonid Bloch <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M block/qcow2.c
    M tests/qemu-iotests/103.out
    M tests/qemu-iotests/137.out

  Log Message:
  -----------
  qcow2: A grammar fix in conflicting cache sizing error message

Signed-off-by: Leonid Bloch <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: a1c81f4f16a74d0d544f5d3ac405bcaad83541fd
      
https://github.com/qemu/qemu/commit/a1c81f4f16a74d0d544f5d3ac405bcaad83541fd
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  file-posix: Handle EINTR in preallocation=full write

Cc: address@hidden
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: f4a1b6536f70d33caa9da6c091b98038943998c9
      
https://github.com/qemu/qemu/commit/f4a1b6536f70d33caa9da6c091b98038943998c9
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M docs/devel/testing.rst

  Log Message:
  -----------
  docs: Describe using images in writing iotests

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: ac49c189b4fd48251314a2b5d5a251bcc1687d66
      
https://github.com/qemu/qemu/commit/ac49c189b4fd48251314a2b5d5a251bcc1687d66
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M tests/qemu-iotests/226

  Log Message:
  -----------
  iotests: Don't lock /dev/null in 226

On my system (Fedora 28), this script reports a 'failed to get
"consistent read" lock' error. Following docs/devel/testing.rst, it's
better to add locking=off here.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: b85504314ffb0b33707559b483143b7e8121e003
      
https://github.com/qemu/qemu/commit/b85504314ffb0b33707559b483143b7e8121e003
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M qemu-img.texi

  Log Message:
  -----------
  Revert "qemu-img: Document copy offloading implications with -S and -c"

This reverts commit eb461485f4558e362fab905735b50987505bca44.

Now that we introduce an explicit option, these implicit rules are not
used.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: e11ce12f5eb26438419e486a3ae2c9bb58a23c1f
      
https://github.com/qemu/qemu/commit/e11ce12f5eb26438419e486a3ae2c9bb58a23c1f
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M qemu-img-cmds.hx
    M qemu-img.c
    M qemu-img.texi

  Log Message:
  -----------
  qemu-img: Add -C option for convert with copy offloading

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 8ba4f10fa689251facd483c3ee0ef4dd4e9bec53
      
https://github.com/qemu/qemu/commit/8ba4f10fa689251facd483c3ee0ef4dd4e9bec53
  Author: Fam Zheng <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M tests/qemu-iotests/082
    M tests/qemu-iotests/082.out

  Log Message:
  -----------
  iotests: Add test for 'qemu-img convert -C' compatibility

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 52ebcb268273de217510bc9ed688c23894ae32a2
      
https://github.com/qemu/qemu/commit/52ebcb268273de217510bc9ed688c23894ae32a2
  Author: Kevin Wolf <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M include/block/block.h

  Log Message:
  -----------
  block: Fix documentation for BDRV_REQ_MAY_UNMAP

BDRV_REQ_MAY_UNMAP in a write_zeroes request does not only allow the
driver to unmap the blocks, but it actively requests that the blocks be
unmapped afterwards if at all possible.

Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 34fa110e424e9a6a9b7e0274c3d4bfee766eb7ed
      
https://github.com/qemu/qemu/commit/34fa110e424e9a6a9b7e0274c3d4bfee766eb7ed
  Author: Kevin Wolf <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  file-posix: Fix write_zeroes with unmap on block devices

The BLKDISCARD ioctl doesn't guarantee that the discarded blocks read as
all-zero afterwards, so don't try to abuse it for zero writing. We try
to only use this if BLKDISCARDZEROES tells us that it is safe, but this
is unreliable on older kernels and a constant 0 in newer kernels. In
other words, this code path is never actually used with newer kernels,
so we don't even try to unmap while writing zeros.

This patch removes the abuse of discard for writing zeroes from
file-posix and instead adds a new function that uses interfaces that are
actually meant to deallocate and zero out at the same time. Only if
those fail, it falls back to zeroing out without unmap. We never fall
back to a discard operation any more that may or may not result in
zeros.

Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 5a9cb5a97f1e519f249d9ec482d498b78296b51d
      
https://github.com/qemu/qemu/commit/5a9cb5a97f1e519f249d9ec482d498b78296b51d
  Author: Kevin Wolf <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M block/qapi.c
    M qapi/block-core.json

  Log Message:
  -----------
  block/qapi: Add 'qdev' field to query-blockstats result

Like for query-block, the client needs to identify which BlockBackend
the returned data is for. Anonymous BlockBackends are identified by the
device model they are attached to. Add a 'qdev' field that contains the
qdev ID or QOM path of the attached device model.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 567dcb31f23657fb71060067b0b1c9ac29110d16
      
https://github.com/qemu/qemu/commit/567dcb31f23657fb71060067b0b1c9ac29110d16
  Author: Kevin Wolf <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M block/qapi.c

  Log Message:
  -----------
  block/qapi: Include anonymous BBs in query-blockstats

Consistent with query-block, query-blockstats should not only include
named BlockBackends, but also those that are anonymous, but belong to a
device model.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 1239ac241fe170bb9fcf0be74bfff04f6f1c2560
      
https://github.com/qemu/qemu/commit/1239ac241fe170bb9fcf0be74bfff04f6f1c2560
  Author: Kevin Wolf <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    A tests/qemu-iotests/227
    A tests/qemu-iotests/227.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  qemu-iotests: Test query-blockstats with -drive and -blockdev

Make sure that query-blockstats returns information for every
BlockBackend that is named or attached to a device model (or both).

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 7b799ec696f043f3a6f25eb8ef9f009086bd58f4
      
https://github.com/qemu/qemu/commit/7b799ec696f043f3a6f25eb8ef9f009086bd58f4
  Author: Peter Maydell <address@hidden>
  Date:   2018-07-30 (Mon, 30 Jul 2018)

  Changed paths:
    M block/file-posix.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M docs/devel/testing.rst
    M include/block/block.h
    M qapi/block-core.json
    M qemu-img-cmds.hx
    M qemu-img.c
    M qemu-img.texi
    M tests/qemu-iotests/082
    M tests/qemu-iotests/082.out
    M tests/qemu-iotests/103.out
    M tests/qemu-iotests/137.out
    M tests/qemu-iotests/226
    A tests/qemu-iotests/227
    A tests/qemu-iotests/227.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- qemu-img convert -C is now required to enable copy offloading
- file-posix: Fix write_zeroes with unmap on block devices (would fall
  back to explicit writes on recent kernels)
- Fix query-blockstats interface for use with -blockdev
- Minor fixes and documentation updates

# gpg: Signature made Mon 30 Jul 2018 16:08:14 BST
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <address@hidden>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  qemu-iotests: Test query-blockstats with -drive and -blockdev
  block/qapi: Include anonymous BBs in query-blockstats
  block/qapi: Add 'qdev' field to query-blockstats result
  file-posix: Fix write_zeroes with unmap on block devices
  block: Fix documentation for BDRV_REQ_MAY_UNMAP
  iotests: Add test for 'qemu-img convert -C' compatibility
  qemu-img: Add -C option for convert with copy offloading
  Revert "qemu-img: Document copy offloading implications with -S and -c"
  iotests: Don't lock /dev/null in 226
  docs: Describe using images in writing iotests
  file-posix: Handle EINTR in preallocation=full write
  qcow2: A grammar fix in conflicting cache sizing error message
  qcow: fix a reference leak

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/7aefc145659f...7b799ec696f0
      **NOTE:** This service has been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

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