qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 8f3a73: block: Add blk_dev_has_tray()


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 8f3a73: block: Add blk_dev_has_tray()
Date: Tue, 02 Feb 2016 12:30:04 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 8f3a73bc57ea83e5b3930d14fc596ea51859987a
      
https://github.com/qemu/qemu/commit/8f3a73bc57ea83e5b3930d14fc596ea51859987a
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/block-backend.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Add blk_dev_has_tray()

Pull out the check whether a block device has a tray from
blk_dev_is_tray_open() into its own function so both attributes (whether
there is a tray vs. whether that tray is open) can be queried
independently.

Cc: qemu-stable <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden


  Commit: 12c7ec87a7d88919b23736176eba3118d1521372
      
https://github.com/qemu/qemu/commit/12c7ec87a7d88919b23736176eba3118d1521372
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

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

  Log Message:
  -----------
  blockdev: Fix 'change' for slot devices

'change' and related operations did not work when used on guest devices
featuring removable media but no actual tray, because
blk_dev_is_tray_open() always returned false for them and the
blockdev-{insert,remove}-medium commands required it to return true.

Fix this by making blockdev-{insert,remove}-medium work on tray-less
devices. Also, blockdev-{open,close}-tray are now explicitly no-ops when
invoked on such devices, and blk_dev_change_media_cb() is instead
called by blockdev-{insert,remove}-medium (for tray-less devices only).

Reported-by: Peter Maydell <address@hidden>
Cc: qemu-stable <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>


  Commit: abb3e55b5b718d6392441f56ba0729a62105ac56
      
https://github.com/qemu/qemu/commit/abb3e55b5b718d6392441f56ba0729a62105ac56
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M hw/block/fdc.c
    M tests/fdc-test.c
    M tests/qemu-iotests/118

  Log Message:
  -----------
  Revert "hw/block/fdc: Implement tray status"

This reverts the changes that commit
2e1280e8ff95b3145bc6262accc9d447718e5318 applied to hw/block/fdc.c;
also, an additional case of drv->media_inserted use has crept in since,
which is replaced by a call to blk_is_inserted().

That commit changed tests/fdc-test.c, too, because after it, one less
TRAY_MOVED event would be emitted when executing 'change' on an empty
drive. However, now, no TRAY_MOVED events will be emitted at all, and
the tray_open status returned by query-block will always be false,
necessitating (different) changes to tests/fdc-test.c and iotest 118,
which is why this patch is not a pure revert of said commit.

Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>


  Commit: 327032ce74d0d9fbd4e18528d0f124b68bc56cea
      
https://github.com/qemu/qemu/commit/327032ce74d0d9fbd4e18528d0f124b68bc56cea
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/qapi.c
    M qapi/block-core.json
    M tests/qemu-iotests/067.out

  Log Message:
  -----------
  block/qapi: Emit tray_open only if there is a tray

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden


  Commit: 3db1d98a20262228373bb973ca62b1ab64b29af4
      
https://github.com/qemu/qemu/commit/3db1d98a20262228373bb973ca62b1ab64b29af4
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Fix converting to streamOptimized

Commit d62d9dc4b8 lifted streamOptimized images's version to 3, but we
now refuse to open version 3 images read-write.  We need to make
streamOptimized an exception to allow converting to it. This fixes the
accidentally broken iotests case 059 for the same reason.

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


  Commit: cc8c46b7c5fffd6b6ca099799be0af224c589603
      
https://github.com/qemu/qemu/commit/cc8c46b7c5fffd6b6ca099799be0af224c589603
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M tests/qemu-iotests/118

  Log Message:
  -----------
  iotests: Limit supported formats for 118

Image formats used in test 118 need to support image creation.

Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: d3780c2dce2c452759ee9d94f9d824cf14cc3ab8
      
https://github.com/qemu/qemu/commit/d3780c2dce2c452759ee9d94f9d824cf14cc3ab8
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd: client_close on error in nbd_co_client_start

Use client_close() if an error in nbd_co_client_start() occurs instead
of manually inlining parts of it. This fixes an assertion error on the
server side if nbd_negotiate() fails.

Signed-off-by: Max Reitz <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 05d0fce49722dd18803a70f00a2ecb1ae92d98d3
      
https://github.com/qemu/qemu/commit/05d0fce49722dd18803a70f00a2ecb1ae92d98d3
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M tests/qemu-iotests/083

  Log Message:
  -----------
  iotests: Rename filter_nbd to _filter_nbd in 083

In the patch after the next, this function is moved to common.filter.
Therefore, its name should be preceded by an underscore to signify its
global availability.

To keep the code motion patch clean, we cannot rename it in the same
patch, so we need to choose some order of renaming vs. motion. It is
better to keep a supposedly global function used by only a single test
in that test than to keep a supposedly local function in a common* file
and use it from a test, so we should rename the function before moving
it.

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


  Commit: d1f9cd70843f9d66948da46744b656babcc964f8
      
https://github.com/qemu/qemu/commit/d1f9cd70843f9d66948da46744b656babcc964f8
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M tests/qemu-iotests/083

  Log Message:
  -----------
  iotests: Change coding style of _filter_nbd in 083

In order to be able to move _filter_nbd to common.filter in the next
patch, its coding style needs to be adapted to that of common.filter.
That means, we have to convert tabs to four spaces, adjust the alignment
of the last line (done with spaces already, assuming one tab equals
eight spaces), fix the line length of the comment, and add a line break
before the opening brace.

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


  Commit: 60d446881deefc280e60c195009f7f07ac50eeac
      
https://github.com/qemu/qemu/commit/60d446881deefc280e60c195009f7f07ac50eeac
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M tests/qemu-iotests/083
    M tests/qemu-iotests/common.filter

  Log Message:
  -----------
  iotests: Move _filter_nbd into common.filter

_filter_nbd can be useful for other NBD tests, too, therefore it should
reside in common.filter.

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


  Commit: dd170c06777d11ecee2d4f4977398068b9b38f03
      
https://github.com/qemu/qemu/commit/dd170c06777d11ecee2d4f4977398068b9b38f03
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M tests/qemu-iotests/083.out
    M tests/qemu-iotests/common.filter

  Log Message:
  -----------
  iotests: Make _filter_nbd drop log lines

The NBD log lines ("/your/source/dir/nbd/xyz.c:function():line: error")
should not be converted to empty lines but removed altogether.

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


  Commit: 4a940d14b3000bee4826f6938e6e0dd67393cf35
      
https://github.com/qemu/qemu/commit/4a940d14b3000bee4826f6938e6e0dd67393cf35
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M tests/qemu-iotests/common.filter

  Log Message:
  -----------
  iotests: Make _filter_nbd support more URL types

This function should support URLs of the "nbd://" format (without
swallowing the export name), and for "nbd:///" URLs it should replace
"?socket=$TEST_DIR" by "?socket=TEST_DIR" because putting the Unix
socket files into the test directory makes sense.

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


  Commit: 15cfba693b8a828315618b8df41acfb79017acf3
      
https://github.com/qemu/qemu/commit/15cfba693b8a828315618b8df41acfb79017acf3
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M tests/qemu-iotests/common.qemu

  Log Message:
  -----------
  iotests: Make redirecting qemu's stderr optional

Redirecting qemu's stderr to stdout makes working with the stderr output
difficult due to the other file descriptor magic performed in
_launch_qemu ("ambiguous redirect").

Add an option which specifies whether stderr should be redirected to
stdout or not (allowing for other modes to be added in the future).

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


  Commit: 34250395fe8f31efee5a736ced9c3b8e33e0dfa3
      
https://github.com/qemu/qemu/commit/34250395fe8f31efee5a736ced9c3b8e33e0dfa3
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

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

  Log Message:
  -----------
  iotests: Add test for a nonexistent NBD export

Trying to connect to a nonexistent NBD export should not crash the
server.

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


  Commit: e43f7f6f46fdf518de1bea6646455d91495a58c3
      
https://github.com/qemu/qemu/commit/e43f7f6f46fdf518de1bea6646455d91495a58c3
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M blockjob.c

  Log Message:
  -----------
  block: Remove unused struct definition BlockFinishData

Unused since 94db6d2d3.

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


  Commit: c5acdc9ab4e6aa9b05e6242114479333b15d496b
      
https://github.com/qemu/qemu/commit/c5acdc9ab4e6aa9b05e6242114479333b15d496b
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Release named dirty bitmaps in bdrv_close()

bdrv_delete() is not very happy about deleting BlockDriverStates with
dirty bitmaps still attached to them. In the past, we got around that
very easily by relying on bdrv_close_all() bypassing bdrv_delete(), and
bdrv_close() simply ignoring that condition. We should fix that by
releasing all named dirty bitmaps in bdrv_close() (there should not be
any unnamed bitmaps left) and moving the assertion from bdrv_delete()
there.

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


  Commit: 16dee4183acb3755b8d2e76e6466a6fec5f1350e
      
https://github.com/qemu/qemu/commit/16dee4183acb3755b8d2e76e6466a6fec5f1350e
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

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

  Log Message:
  -----------
  iotests: Add test for eject under NBD server

This patch adds a test for ejecting the BlockBackend an NBD server is
connected to (the NBD server is supposed to stop).

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


  Commit: 3301f6c6e9b52e370b07b3a08fd11735d0f0f292
      
https://github.com/qemu/qemu/commit/3301f6c6e9b52e370b07b3a08fd11735d0f0f292
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend.h

  Log Message:
  -----------
  block: Add BB-BDS remove/insert notifiers

bdrv_close() no longer signifies ejection of a medium, this is now done
by removing the BDS from the BB. Therefore, we want to have a notifier
for that in the BB instead of a close notifier in the BDS. The former is
added now, the latter is removed later.

Symmetrically, another notifier list is added that is invoked whenever a
BDS is inserted. We will need that for virtio-blk and virtio-scsi, which
can then remove their op blockers on BDS ejection and set them up on
insertion.

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


  Commit: 1b1e0659a4c8888fba559e8d41051339e0a3cd8a
      
https://github.com/qemu/qemu/commit/1b1e0659a4c8888fba559e8d41051339e0a3cd8a
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M hw/block/dataplane/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: Functions for op blocker management

Put the code for setting up and removing op blockers into an own
function, respectively. Then, we can invoke those functions whenever a
BDS is removed from an virtio-blk BB or inserted into it.

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


  Commit: 5b9e0e46935538bf2b24fcb70b65477f758413fd
      
https://github.com/qemu/qemu/commit/5b9e0e46935538bf2b24fcb70b65477f758413fd
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M hw/scsi/virtio-scsi.c
    M include/hw/virtio/virtio-scsi.h

  Log Message:
  -----------
  virtio-scsi: Catch BDS-BB removal/insertion

Make use of the BDS-BB removal and insertion notifiers to remove or set
up, respectively, virtio-scsi's op blockers.

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


  Commit: 741cc431337891e0c1d69fcba6574aa8df3e4822
      
https://github.com/qemu/qemu/commit/741cc431337891e0c1d69fcba6574aa8df3e4822
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M blockdev-nbd.c
    M nbd/server.c

  Log Message:
  -----------
  nbd: Switch from close to eject notifier

The NBD code uses the BDS close notifier to determine when a medium is
ejected. However, now it should use the BB's BDS removal notifier for
that instead of the BDS's close notifier.

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


  Commit: 033cb5659a1dce15643d2d5123615c26e24298ce
      
https://github.com/qemu/qemu/commit/033cb5659a1dce15643d2d5123615c26e24298ce
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block.c
    M block/block-backend.c
    M include/block/block.h
    M include/block/block_int.h
    M include/sysemu/block-backend.h

  Log Message:
  -----------
  block: Remove BDS close notifier

It is unused now, so we can remove it.

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


  Commit: 13855c6b9fa7f9d9e6d1f90377be0f678671073a
      
https://github.com/qemu/qemu/commit/13855c6b9fa7f9d9e6d1f90377be0f678671073a
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/block-backend.c

  Log Message:
  -----------
  block: Use blk_remove_bs() in blk_delete()

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


  Commit: 938abd4325951f94e87765b7daea61bf0bf71a5e
      
https://github.com/qemu/qemu/commit/938abd4325951f94e87765b7daea61bf0bf71a5e
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: Use blk_remove_bs() in do_drive_del()

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


  Commit: 64dff52019367194699a772e3cc31941fd9752a8
      
https://github.com/qemu/qemu/commit/64dff52019367194699a772e3cc31941fd9752a8
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block.c
    M include/block/block.h

  Log Message:
  -----------
  block: Make bdrv_close() static

There are no users of bdrv_close() left, except for one of bdrv_open()'s
failure paths, bdrv_close_all() and bdrv_delete(), and that is good.
Make bdrv_close() static so nobody makes the mistake of directly using
bdrv_close() again.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 2c1d04e002dc91a6f34e8e683ea6b84f61a0b9fd
      
https://github.com/qemu/qemu/commit/2c1d04e002dc91a6f34e8e683ea6b84f61a0b9fd
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block.c
    M include/block/block_int.h

  Log Message:
  -----------
  block: Add list of all BlockDriverStates

We need this list so that bdrv_close_all() can keep track of which BDSs
are still open after having removed the BDSs from all of the BBs and
having released all monitor BDS references.

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


  Commit: 9c4218e957331e1ba0ba7565730b0b71c49b8d70
      
https://github.com/qemu/qemu/commit/9c4218e957331e1ba0ba7565730b0b71c49b8d70
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M blockdev.c
    M include/block/block_int.h
    M stubs/Makefile.objs
    A stubs/blockdev-close-all-bdrv-states.c

  Log Message:
  -----------
  blockdev: Keep track of monitor-owned BDS

As a side effect, we can now make x-blockdev-del's check whether a BDS
is actually owned by the monitor explicit.

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


  Commit: d8da3cef3bc649492d190e029343293df1386027
      
https://github.com/qemu/qemu/commit/d8da3cef3bc649492d190e029343293df1386027
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/block-backend.c
    M include/sysemu/block-backend.h

  Log Message:
  -----------
  block: Add blk_remove_all_bs()

When bdrv_close_all() is called, instead of force-closing all root
BlockDriverStates, it is better to just drop the reference from all
BlockBackends and let them be closed automatically. This prevents BDS
from getting closed that are still referenced by other BDS, which may
result in loss of cached data.

This patch adds a function for doing that, but does not yet incorporate
it in bdrv_close_all().

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


  Commit: ca9bd24cf1d53775169ba9adc17e265554d1afed
      
https://github.com/qemu/qemu/commit/ca9bd24cf1d53775169ba9adc17e265554d1afed
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Rewrite bdrv_close_all()

This patch rewrites bdrv_close_all(): Until now, all root BDSs have been
force-closed. This is bad because it can lead to cached data not being
flushed to disk.

Instead, try to make all reference holders relinquish their reference
voluntarily:

1. All BlockBackend users are handled by making all BBs simply eject
   their BDS tree. Since a BDS can never be on top of a BB, this will
   not cause any of the issues as seen with the force-closing of BDSs.
   The references will be relinquished and any further access to the BB
   will fail gracefully.
2. All BDSs which are owned by the monitor itself (because they do not
   have a BB) are relinquished next.
3. Besides BBs and the monitor, block jobs and other BDSs are the only
   things left that can hold a reference to BDSs. After every remaining
   block job has been canceled, there should not be any BDSs left (and
   the loop added here will always terminate (as long as NDEBUG is not
   defined), because either all_bdrv_states will be empty or there will
   not be any block job left to cancel, failing the assertion).

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


  Commit: 15a2b18fe5824388debe958e21c5dfa51457c7b6
      
https://github.com/qemu/qemu/commit/15a2b18fe5824388debe958e21c5dfa51457c7b6
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

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

  Log Message:
  -----------
  iotests: Add test for multiple BB on BDS tree

This adds a test for having multiple BlockBackends in one BDS tree. In
this case, there is one BB for the protocol BDS and one BB for the
format BDS in a simple two-BDS tree (with the protocol BDS and BB added
first).

When bdrv_close_all() is executed, no cached data from any BDS should be
lost; the protocol BDS may not be closed until the format BDS is closed.
Otherwise, metadata updates may be lost.

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


  Commit: c78dc18295cb79c36d8993f245537f997cd9f2bb
      
https://github.com/qemu/qemu/commit/c78dc18295cb79c36d8993f245537f997cd9f2bb
  Author: Max Reitz <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

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

  Log Message:
  -----------
  iotests: Add test for block jobs and BDS ejection

Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 1963f8d52e04a8f8b213e34e6a76fb286fb23ec1
      
https://github.com/qemu/qemu/commit/1963f8d52e04a8f8b213e34e6a76fb286fb23ec1
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/qapi.c

  Log Message:
  -----------
  block: acquire in bdrv_query_image_info

NFS calls aio_poll inside bdrv_get_allocated_size.  This requires
acquiring the AioContext.

Signed-off-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 67a0fd2a9bca204d2b39f910a97c7137636a0715
      
https://github.com/qemu/qemu/commit/67a0fd2a9bca204d2b39f910a97c7137636a0715
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/io.c
    M block/iscsi.c
    M block/mirror.c
    M block/parallels.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/raw-posix.c
    M block/raw_bsd.c
    M block/sheepdog.c
    M block/vdi.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M include/block/block.h
    M include/block/block_int.h
    M qemu-img.c

  Log Message:
  -----------
  block: Add "file" output parameter to block status query functions

The added parameter can be used to return the BDS pointer which the
valid offset is referring to. Its value should be ignored unless
BDRV_BLOCK_OFFSET_VALID in ret is set.

Until block drivers fill in the right value, let's clear it explicitly
right before calling .bdrv_get_block_status.

The "bs->file" condition in bdrv_co_get_block_status is kept now to keep iotest
case 102 passing, and will be fixed once all drivers return the right file
pointer.

Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 3064bf6fffe4705d983b8cecfbbe3de3e5a75312
      
https://github.com/qemu/qemu/commit/3064bf6fffe4705d983b8cecfbbe3de3e5a75312
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/qcow.c

  Log Message:
  -----------
  qcow: Assign bs->file->bs to file in qcow_co_get_block_status

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 178b4db7e5dc6c5bbaa24a72fdb232ec259c26eb
      
https://github.com/qemu/qemu/commit/178b4db7e5dc6c5bbaa24a72fdb232ec259c26eb
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/qcow2.c

  Log Message:
  -----------
  qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 02650acbc622b51b3428630b2f60ca1966caa1e8
      
https://github.com/qemu/qemu/commit/02650acbc622b51b3428630b2f60ca1966caa1e8
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/raw-posix.c
    M block/raw_bsd.c

  Log Message:
  -----------
  raw: Assign bs to file in raw_co_get_block_status

Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 3399833f1412e72e6f9e6997775dfdf12d624eaf
      
https://github.com/qemu/qemu/commit/3399833f1412e72e6f9e6997775dfdf12d624eaf
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  iscsi: Assign bs to file in iscsi_co_get_block_status

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: ddf4987d76ebc356da96f6901c1af970ef421da6
      
https://github.com/qemu/qemu/commit/ddf4987d76ebc356da96f6901c1af970ef421da6
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/parallels.c

  Log Message:
  -----------
  parallels: Assign bs->file->bs to file in parallels_co_get_block_status

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 53f1dfd1ff5a603ea1bd67b925758d22f54e1f8a
      
https://github.com/qemu/qemu/commit/53f1dfd1ff5a603ea1bd67b925758d22f54e1f8a
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/qed.c

  Log Message:
  -----------
  qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: d234c929310a322357ed4323c7014605449f5802
      
https://github.com/qemu/qemu/commit/d234c929310a322357ed4323c7014605449f5802
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/sheepdog.c

  Log Message:
  -----------
  sheepdog: Assign bs to file in sd_co_get_block_status

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 8bfb137152d2195c70e99ed3269a3f4825ffc614
      
https://github.com/qemu/qemu/commit/8bfb137152d2195c70e99ed3269a3f4825ffc614
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/vdi.c

  Log Message:
  -----------
  vdi: Assign bs->file->bs to file in vdi_co_get_block_status

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 7429e207883fb6f6bd46cefee4c79771e50f35f4
      
https://github.com/qemu/qemu/commit/7429e207883fb6f6bd46cefee4c79771e50f35f4
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/vpc.c

  Log Message:
  -----------
  vpc: Assign bs->file->bs to file in vpc_co_get_block_status

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: d0a18f10251f515c86dcaec5bdf979a4e07fafc5
      
https://github.com/qemu/qemu/commit/d0a18f10251f515c86dcaec5bdf979a4e07fafc5
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Fix calculation of block status's offset

"offset" is the offset of cluster and sector_num doesn't necessarily
refer to the start of it, it should add index_in_cluster.

Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: e0f100f57ceee919a7df7af316961b175ffef4e6
      
https://github.com/qemu/qemu/commit/e0f100f57ceee919a7df7af316961b175ffef4e6
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/vmdk.c

  Log Message:
  -----------
  vmdk: Return extent's file in bdrv_get_block_status

Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: ac987b30d0a97f14b82584921fc5ab3cd88c431b
      
https://github.com/qemu/qemu/commit/ac987b30d0a97f14b82584921fc5ab3cd88c431b
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Use returned *file in bdrv_co_get_block_status

Now that all drivers return the right "file" pointer, we can use it.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 9e4303400801e62e8e357decdb487834582459e8
      
https://github.com/qemu/qemu/commit/9e4303400801e62e8e357decdb487834582459e8
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: In "map", use the returned "file" from bdrv_get_block_status

Now all drivers should return a correct "file", we can make use of it,
even with the recursion into backing chain above.

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 16b0d555861b732c1dd76a986697214de1d774d5
      
https://github.com/qemu/qemu/commit/16b0d555861b732c1dd76a986697214de1d774d5
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

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

  Log Message:
  -----------
  qemu-img: Make MapEntry a QAPI struct

The "flags" bit mask is expanded to two booleans, "data" and "zero";
"bs" is replaced with "filename" string.

Refactor the merge conditions in img_map() into entry_mergeable().

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: c7fc50d37620550c52854ca15c2a18da1b8155e0
      
https://github.com/qemu/qemu/commit/c7fc50d37620550c52854ca15c2a18da1b8155e0
  Author: Fam Zheng <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

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

  Log Message:
  -----------
  iotests: Add "qemu-img map" test for VMDK extents

Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: f8aa905a4fec89863c82de4186352447d851871e
      
https://github.com/qemu/qemu/commit/f8aa905a4fec89863c82de4186352447d851871e
  Author: Jeff Cody <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block.c
    M blockdev.c
    M include/block/block.h

  Log Message:
  -----------
  block: set device_list.tqe_prev to NULL on BDS removal

This fixes a regression introduced with commit 3f09bfbc7.  Multiple
bugs arise in conjunction with live snapshots and mirroring operations
(which include active layer commit).

After a live snapshot occurs, the active layer and the base layer both
have a non-NULL tqe_prev field in the device_list, although the base
node's tqe_prev field points to a NULL entry.  This non-NULL tqe_prev
field occurs after the bdrv_append() in the external snapshot calls
change_parent_backing_link().

In change_parent_backing_link(), when the previous active layer is
removed from device_list, the device_list.tqe_prev pointer is not
set to NULL.

The operating scheme in the block layer is to indicate that a BDS belongs
in the bdrv_states device_list iff the device_list.tqe_prev pointer
is non-NULL.

This patch does two things:

1.) Introduces a new block layer helper bdrv_device_remove() to remove a
    BDS from the device_list, and
2.) uses that new API, which also fixes the regression once used in
    change_parent_backing_link().

Signed-off-by: Jeff Cody <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 8983b670f62ab5e5e8dd2690bf8304123651bfe5
      
https://github.com/qemu/qemu/commit/8983b670f62ab5e5e8dd2690bf8304123651bfe5
  Author: Jeff Cody <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

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

  Log Message:
  -----------
  block: qemu-iotests - add test for snapshot, commit, snapshot bug

Signed-off-by: Jeff Cody <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
[Moved test number from 143 to 144]
Signed-off-by: Max Reitz <address@hidden>


  Commit: c65db7705b7926f4a084b93778e4bd5dd3990aad
      
https://github.com/qemu/qemu/commit/c65db7705b7926f4a084b93778e4bd5dd3990aad
  Author: Peter Maydell <address@hidden>
  Date:   2016-02-02 (Tue, 02 Feb 2016)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/io.c
    M block/iscsi.c
    M block/mirror.c
    M block/parallels.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/raw-posix.c
    M block/raw_bsd.c
    M block/sheepdog.c
    M block/vdi.c
    M block/vmdk.c
    M block/vpc.c
    M block/vvfat.c
    M blockdev-nbd.c
    M blockdev.c
    M blockjob.c
    M hw/block/dataplane/virtio-blk.c
    M hw/block/fdc.c
    M hw/scsi/virtio-scsi.c
    M include/block/block.h
    M include/block/block_int.h
    M include/hw/virtio/virtio-scsi.h
    M include/sysemu/block-backend.h
    M nbd/server.c
    M qapi/block-core.json
    M qemu-img.c
    M stubs/Makefile.objs
    A stubs/blockdev-close-all-bdrv-states.c
    M tests/fdc-test.c
    M tests/qemu-iotests/059
    M tests/qemu-iotests/059.out
    M tests/qemu-iotests/067.out
    M tests/qemu-iotests/083
    M tests/qemu-iotests/083.out
    A tests/qemu-iotests/117
    A tests/qemu-iotests/117.out
    M tests/qemu-iotests/118
    A tests/qemu-iotests/140
    A tests/qemu-iotests/140.out
    A tests/qemu-iotests/141
    A tests/qemu-iotests/141.out
    A tests/qemu-iotests/143
    A tests/qemu-iotests/143.out
    A tests/qemu-iotests/144
    A tests/qemu-iotests/144.out
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.qemu
    M tests/qemu-iotests/group

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/maxreitz/tags/pull-block-for-peter-2016-02-02' into staging

Block patches

# gpg: Signature made Tue 02 Feb 2016 17:23:44 GMT using RSA key ID E838ACAD
# gpg: Good signature from "Max Reitz <address@hidden>"

* remotes/maxreitz/tags/pull-block-for-peter-2016-02-02: (50 commits)
  block: qemu-iotests - add test for snapshot, commit, snapshot bug
  block: set device_list.tqe_prev to NULL on BDS removal
  iotests: Add "qemu-img map" test for VMDK extents
  qemu-img: Make MapEntry a QAPI struct
  qemu-img: In "map", use the returned "file" from bdrv_get_block_status
  block: Use returned *file in bdrv_co_get_block_status
  vmdk: Return extent's file in bdrv_get_block_status
  vmdk: Fix calculation of block status's offset
  vpc: Assign bs->file->bs to file in vpc_co_get_block_status
  vdi: Assign bs->file->bs to file in vdi_co_get_block_status
  sheepdog: Assign bs to file in sd_co_get_block_status
  qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status
  parallels: Assign bs->file->bs to file in parallels_co_get_block_status
  iscsi: Assign bs to file in iscsi_co_get_block_status
  raw: Assign bs to file in raw_co_get_block_status
  qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status
  qcow: Assign bs->file->bs to file in qcow_co_get_block_status
  block: Add "file" output parameter to block status query functions
  block: acquire in bdrv_query_image_info
  iotests: Add test for block jobs and BDS ejection
  ...

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


Compare: https://github.com/qemu/qemu/compare/3bb1e822ca7c...c65db7705b79

reply via email to

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