qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 1ba4b6: block: Prevent coroutine stack overfl


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 1ba4b6: block: Prevent coroutine stack overflow when recur...
Date: Mon, 28 Apr 2014 05:00:10 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 1ba4b6a553ad9ff4645af7fab8adfc6e810fcc69
      
https://github.com/qemu/qemu/commit/1ba4b6a553ad9ff4645af7fab8adfc6e810fcc69
  Author: BenoƮt Canet <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Prevent coroutine stack overflow when recursing in 
bdrv_open_backing_file.

In 1.7.1 qcow2_create2 reopen the file for flushing without the 
BDRV_O_NO_BACKING
flags.

As a consequence the code would recursively open the whole backing chain.

These three stack arrays would pile up through the recursion and lead to a 
coroutine
stack overflow.

Convert these array to malloced buffers in order to streamline the coroutine
footprint.

Symptoms where freezes or segfaults on production machines while taking QMP 
externals
snapshots. The overflow disturbed coroutine switching.

[Resolved conflicts on qemu.git/master since the patch was against v1.7.1
--Stefan]

Signed-off-by: Benoit Canet <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d1db760d7be664c1345670637ba0c5accbf73710
      
https://github.com/qemu/qemu/commit/d1db760d7be664c1345670637ba0c5accbf73710
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M qemu-options.hx

  Log Message:
  -----------
  doc: add -drive rerror=,werror= to qemu --help output

These options are already documented on the man page but missing from
qemu --help.

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


  Commit: 9974ad40bf36d605f1134b94e51fd53e9970f46a
      
https://github.com/qemu/qemu/commit/9974ad40bf36d605f1134b94e51fd53e9970f46a
  Author: Fam Zheng <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M tests/qemu-iotests/030
    M tests/qemu-iotests/056
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  qemu-iotests: Improve and make use of QMPTestCase.wait_until_completed()

This eliminates code duplication.

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 460787605e59526bb5c47002b512028ea1f63ac3
      
https://github.com/qemu/qemu/commit/460787605e59526bb5c47002b512028ea1f63ac3
  Author: Kevin Wolf <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Add qemu-img/io to block subsystem

qemu-img and qemu-io were not covered by any MAINTAINERS entry so far.

Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a28315ebaf3910b65ef51abefc4ef040265afc19
      
https://github.com/qemu/qemu/commit/a28315ebaf3910b65ef51abefc4ef040265afc19
  Author: Kevin Wolf <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M qapi-schema.json

  Log Message:
  -----------
  block: Expose host_* drivers in blockdev-add

All the functionality to use the host_device, host_cdrom and host_floppy
drivers is already there, they just need to be added to the schema.

The block driver names containing underscores are preexisting and cannot
be changed without breaking command line compatibility.

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


  Commit: 0fb6395c0cb5046432a80d608ddde7a3b2f8a9ae
      
https://github.com/qemu/qemu/commit/0fb6395c0cb5046432a80d608ddde7a3b2f8a9ae
  Author: Markus Armbruster <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M block.c
    M block/mirror.c
    M block/nfs.c
    M block/quorum.c
    M docs/writing-qmp-commands.txt
    M tests/test-qmp-input-strict.c

  Log Message:
  -----------
  Use error_is_set() only when necessary (again)

error_is_set(&var) is the same as var != NULL, but it takes
whole-program analysis to figure that out.  Unnecessarily hard for
optimizers, static checkers, and human readers.  Commit 84d18f0 dumbed
it down to obvious, but a few more have crept in since, and
documentation was overlooked.  Dumb these down, too.

Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 4399c438a431effbb785c6c7314b748a4e13734a
      
https://github.com/qemu/qemu/commit/4399c438a431effbb785c6c7314b748a4e13734a
  Author: Markus Armbruster <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Consistently name Error * objects err, and not errp

Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 92de9012904cd6ada47565f48db545d53069d933
      
https://github.com/qemu/qemu/commit/92de9012904cd6ada47565f48db545d53069d933
  Author: Markus Armbruster <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M block/nbd.c

  Log Message:
  -----------
  nbd: Use return values instead of error_is_set(errp)

Using error_is_set(errp) to check whether a function call failed is
fragile: it breaks when errp is null.  Check perfectly suitable return
values instead when possible.  errp can't be null there now, but this
is more robust and more obviously correct

Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f70edf99483e7ee5f89d69fd0c51d04a35f03932
      
https://github.com/qemu/qemu/commit/f70edf99483e7ee5f89d69fd0c51d04a35f03932
  Author: Markus Armbruster <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: Clean up fragile use of error_is_set()

Using error_is_set(ERRP) to find out whether a function failed is
either wrong, fragile, or unnecessarily opaque.  It's wrong when ERRP
may be null, because errors go undetected when it is.  It's fragile
when proving ERRP non-null involves a non-local argument.  Else, it's
unnecessarily opaque (see commit 84d18f0).

The error_is_set(errp) in internal_snapshot_prepare() is merely
fragile, because the caller never passes a null errp argument.

Make the code more robust and more obviously correct: receive the
error in a local variable, then propagate it through the parameter.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 172fc4dd33e604dcf868c28e73398c19e161708b
      
https://github.com/qemu/qemu/commit/172fc4dd33e604dcf868c28e73398c19e161708b
  Author: Markus Armbruster <address@hidden>
  Date:   2014-04-25 (Fri, 25 Apr 2014)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  iscsi: Don't use error_is_set() to suppress additional errors

Using error_is_set(errp) that way can sweep programming errors under
the carpet when we get called incorrectly with an error set.

Commit 24d3bd6 added a broken error path to iscsi_do_inquiry(): it
first calls error_setg(), then jumps to the preexisting error label,
where error_setg() gets called again, triggering an assertion failure.

Commit cbee81f fixed this by guarding the second error_setg() with an
error_is_set().

Replace this fix by a simpler and safer one: jump right behind the
second error_setg().

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a41b2c995b52b2ce26c171c52ac7dc11c7dccd99
      
https://github.com/qemu/qemu/commit/a41b2c995b52b2ce26c171c52ac7dc11c7dccd99
  Author: Peter Maydell <address@hidden>
  Date:   2014-04-28 (Mon, 28 Apr 2014)

  Changed paths:
    M MAINTAINERS
    M block.c
    M block/iscsi.c
    M block/mirror.c
    M block/nbd.c
    M block/nfs.c
    M block/quorum.c
    M blockdev.c
    M docs/writing-qmp-commands.txt
    M qapi-schema.json
    M qemu-img.c
    M qemu-options.hx
    M tests/qemu-iotests/030
    M tests/qemu-iotests/056
    M tests/qemu-iotests/iotests.py
    M tests/test-qmp-input-strict.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into 
staging

Block pull request

# gpg: Signature made Fri 25 Apr 2014 17:05:13 BST using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"

* remotes/stefanha/tags/block-pull-request:
  iscsi: Don't use error_is_set() to suppress additional errors
  blockdev: Clean up fragile use of error_is_set()
  nbd: Use return values instead of error_is_set(errp)
  qemu-img: Consistently name Error * objects err, and not errp
  Use error_is_set() only when necessary (again)
  block: Expose host_* drivers in blockdev-add
  MAINTAINERS: Add qemu-img/io to block subsystem
  qemu-iotests: Improve and make use of QMPTestCase.wait_until_completed()
  doc: add -drive rerror=,werror= to qemu --help output
  block: Prevent coroutine stack overflow when recursing in 
bdrv_open_backing_file.

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


Compare: https://github.com/qemu/qemu/compare/d09a18d44d5b...a41b2c995b52

reply via email to

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