Re: [Qemu-block] [PATCH v8 12/16] blockdev: Keep track of monitor-owned BDS

2016-01-29 Thread Max Reitz
On 28.01.2016 04:33, Fam Zheng wrote: > On Wed, 01/27 18:59, Max Reitz wrote: >> Signed-off-by: Max Reitz >> --- >> blockdev.c | 26 ++ >> include/block/block_int.h | 4 >> stubs/Makefile.objs

[Qemu-block] [PATCH v10 19/25] qom: Swap 'name' next to visitor in ObjectPropertyAccessor

2016-01-29 Thread Eric Blake
Similar to the previous patch, it's nice to have all functions in the tree that involve a visitor and a name for conversion to or from QAPI to consistently stick the 'name' parameter next to the Visitor parameter. Done by manually changing include/qom/object.h and qom/object.c, then running this

Re: [Qemu-block] [PATCH v8 06/16] nbd: Switch from close to eject notifier

2016-01-29 Thread Max Reitz
On 28.01.2016 04:26, Fam Zheng wrote: > On Wed, 01/27 18:59, Max Reitz wrote: >> 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

Re: [Qemu-block] [PATCH v8 14/16] block: Rewrite bdrv_close_all()

2016-01-29 Thread Max Reitz
On 28.01.2016 05:17, Fam Zheng wrote: > On Wed, 01/27 18:59, Max Reitz wrote: >> 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

Re: [Qemu-block] [PATCH v8 05/16] virtio-scsi: Catch BDS-BB removal/insertion

2016-01-29 Thread Max Reitz
On 29.01.2016 13:41, Kevin Wolf wrote: > Am 27.01.2016 um 18:59 hat Max Reitz geschrieben: >> 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 >> --- >> hw/scsi/virtio-scsi.c

Re: [Qemu-block] [PATCH v8 12/16] blockdev: Keep track of monitor-owned BDS

2016-01-29 Thread Kevin Wolf
Am 29.01.2016 um 14:44 hat Max Reitz geschrieben: > On 28.01.2016 04:33, Fam Zheng wrote: > > On Wed, 01/27 18:59, Max Reitz wrote: > >> Signed-off-by: Max Reitz > >> --- > >> blockdev.c | 26 ++ > >>

[Qemu-block] [PATCH v10 18/25] qapi: Swap visit_* arguments for consistent 'name' placement

2016-01-29 Thread Eric Blake
JSON uses "name":value, but many of our visitor interfaces were called with visit_type_FOO(v, , name, errp). This can be a bit confusing to have to mentally swap the parameter order to match JSON order. It's particularly bad for visit_start_struct(), where the 'name' parameter is smack in the

Re: [Qemu-block] [PATCH v5 2/5] util: Use new error_report_fatal/abort instead of error_setg(_fatal/abort)

2016-01-29 Thread David Gibson
On Thu, Jan 28, 2016 at 10:53:43PM +0100, Lluís Vilanova wrote: > Replaces all direct uses of 'error_setg(_fatal/abort)' with > 'error_report_fatal/abort'. Also reimplements the former on top of the > latter. > > Signed-off-by: Lluís Vilanova I think the spapr parts of this

Re: [Qemu-block] [PATCH v13 00/10] Block replication for continuous checkpoints

2016-01-29 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > On 01/29/2016 06:07 PM, Dr. David Alan Gilbert wrote: > > * Wen Congyang (we...@cn.fujitsu.com) wrote: > >> On 01/27/2016 07:03 PM, Dr. David Alan Gilbert wrote: > >>> Hi, > >>> I've got a block error if I kill the secondary. > >>> > >>> Start both

Re: [Qemu-block] [PATCH v13 00/10] Block replication for continuous checkpoints

2016-01-29 Thread Wen Congyang
On 01/29/2016 06:07 PM, Dr. David Alan Gilbert wrote: > * Wen Congyang (we...@cn.fujitsu.com) wrote: >> On 01/27/2016 07:03 PM, Dr. David Alan Gilbert wrote: >>> Hi, >>> I've got a block error if I kill the secondary. >>> >>> Start both primary & secondary >>> kill -9 secondary qemu >>>

Re: [Qemu-block] [PATCH v13 00/10] Block replication for continuous checkpoints

2016-01-29 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > On 01/27/2016 07:03 PM, Dr. David Alan Gilbert wrote: > > Hi, > > I've got a block error if I kill the secondary. > > > > Start both primary & secondary > > kill -9 secondary qemu > > x_colo_lost_heartbeat on primary > > > > The guest sees a block

[Qemu-block] [PATCH v9 01/16] block: Release named dirty bitmaps in bdrv_close()

2016-01-29 Thread Max Reitz
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

[Qemu-block] [PATCH v9 08/16] block: Use blk_remove_bs() in blk_delete()

2016-01-29 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Reviewed-by: Fam Zheng --- block/block-backend.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index

[Qemu-block] [PATCH v9 09/16] blockdev: Use blk_remove_bs() in do_drive_del()

2016-01-29 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Reviewed-by: Fam Zheng --- blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 1044a6a..09d4621 100644 --- a/blockdev.c +++

[Qemu-block] [PATCH v9 10/16] block: Make bdrv_close() static

2016-01-29 Thread Max Reitz
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 Reviewed-by: Eric

[Qemu-block] [PATCH v9 07/16] block: Remove BDS close notifier

2016-01-29 Thread Max Reitz
It is unused now, so we can remove it. Signed-off-by: Max Reitz Reviewed-by: Fam Zheng Reviewed-by: Kevin Wolf --- block.c| 8 block/block-backend.c | 7 --- include/block/block.h | 1

[Qemu-block] [PATCH v9 16/16] iotests: Add test for block jobs and BDS ejection

2016-01-29 Thread Max Reitz
Suggested-by: Paolo Bonzini Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- tests/qemu-iotests/141 | 186 + tests/qemu-iotests/141.out | 59 ++ tests/qemu-iotests/group

[Qemu-block] [PATCH v9 00/16] block: Rework bdrv_close_all()

2016-01-29 Thread Max Reitz
Currently, bdrv_close_all() force-closes all BDSs with a BlockBackend, which can lead to data corruption (see the iotest added in the final patch of this series) and is most certainly very ugly. This series reworks bdrv_close_all() to instead eject the BDS trees from all BlockBackends and then

[Qemu-block] [PATCH v9 04/16] virtio-blk: Functions for op blocker management

2016-01-29 Thread Max Reitz
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 Reviewed-by: Fam Zheng Reviewed-by:

[Qemu-block] [PATCH v9 03/16] block: Add BB-BDS remove/insert notifiers

2016-01-29 Thread Max Reitz
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

[Qemu-block] [PATCH v9 06/16] nbd: Switch from close to eject notifier

2016-01-29 Thread Max Reitz
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 Reviewed-by: Fam Zheng Reviewed-by: Kevin Wolf

[Qemu-block] [PATCH v9 11/16] block: Add list of all BlockDriverStates

2016-01-29 Thread Max Reitz
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 Reviewed-by: Kevin Wolf Reviewed-by: Fam Zheng

[Qemu-block] [PATCH v9 13/16] block: Add blk_remove_all_bs()

2016-01-29 Thread Max Reitz
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

[Qemu-block] [PATCH v9 02/16] iotests: Add test for eject under NBD server

2016-01-29 Thread Max Reitz
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 Reviewed-by: Fam Zheng Reviewed-by: Kevin Wolf --- tests/qemu-iotests/140 | 92

[Qemu-block] [PATCH v9 05/16] virtio-scsi: Catch BDS-BB removal/insertion

2016-01-29 Thread Max Reitz
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 --- hw/scsi/virtio-scsi.c | 55 + include/hw/virtio/virtio-scsi.h | 10 2

[Qemu-block] [PATCH v9 14/16] block: Rewrite bdrv_close_all()

2016-01-29 Thread Max Reitz
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

[Qemu-block] [PATCH v9 15/16] iotests: Add test for multiple BB on BDS tree

2016-01-29 Thread Max Reitz
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;

[Qemu-block] [PULL 27/48] blockdev: Keep track of monitor-owned BDS

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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 Signed-off-by: Kevin Wolf --- blockdev.c | 28

[Qemu-block] [PULL 21/48] nbd: Switch from close to eject notifier

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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 Reviewed-by: Fam Zheng

[Qemu-block] [PULL 37/48] iscsi: Assign bs to file in iscsi_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-6-git-send-email-f...@redhat.com Signed-off-by: Max Reitz --- block/iscsi.c

[Qemu-block] [PULL 46/48] qemu-img: In "map", use the returned "file" from bdrv_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng 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 Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng

[Qemu-block] [PULL 45/48] block: Use returned *file in bdrv_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Now that all drivers return the right "file" pointer, we can use it. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz Message-id: 1453780743-16806-14-git-send-email-f...@redhat.com Signed-off-by: Max Reitz

[Qemu-block] [PULL 43/48] vmdk: Fix calculation of block status's offset

2016-01-29 Thread Kevin Wolf
From: Fam Zheng "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 Message-id: 1453780743-16806-12-git-send-email-f...@redhat.com Reviewed-by: Max Reitz

[Qemu-block] [PULL 38/48] parallels: Assign bs->file->bs to file in parallels_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-7-git-send-email-f...@redhat.com Signed-off-by: Max Reitz ---

[Qemu-block] [PULL 47/48] qemu-img: Make MapEntry a QAPI struct

2016-01-29 Thread Kevin Wolf
From: Fam Zheng 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 Reviewed-by: Stefan Hajnoczi

[Qemu-block] [PULL 36/48] raw: Assign bs to file in raw_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 1453780743-16806-5-git-send-email-f...@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- block/raw-posix.c | 1 + block/raw_bsd.c | 1 + 2 files

[Qemu-block] [PULL 30/48] iotests: Add test for multiple BB on BDS tree

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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

[Qemu-block] [PULL 06/48] iotests: Limit supported formats for 118

2016-01-29 Thread Kevin Wolf
From: Max Reitz Image formats used in test 118 need to support image creation. Reported-by: Markus Armbruster Signed-off-by: Max Reitz Reviewed-by: Markus Armbruster Signed-off-by: Kevin Wolf ---

[Qemu-block] [PULL 14/48] iotests: Add test for a nonexistent NBD export

2016-01-29 Thread Kevin Wolf
From: Max Reitz Trying to connect to a nonexistent NBD export should not crash the server. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tests/qemu-iotests/143 | 73

[Qemu-block] [PULL 12/48] iotests: Make _filter_nbd support more URL types

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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.

[Qemu-block] [PULL 02/48] blockdev: Fix 'change' for slot devices

2016-01-29 Thread Kevin Wolf
From: Max Reitz '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

[Qemu-block] [PULL 16/48] block: Release named dirty bitmaps in bdrv_close()

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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

[Qemu-block] [PULL 09/48] iotests: Change coding style of _filter_nbd in 083

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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,

[Qemu-block] [PULL 10/48] iotests: Move _filter_nbd into common.filter

2016-01-29 Thread Kevin Wolf
From: Max Reitz _filter_nbd can be useful for other NBD tests, too, therefore it should reside in common.filter. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tests/qemu-iotests/083

[Qemu-block] [PULL 19/48] virtio-blk: Functions for op blocker management

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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 Reviewed-by: Fam

[Qemu-block] [PULL 26/48] block: Add list of all BlockDriverStates

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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 Reviewed-by: Kevin Wolf

[Qemu-block] [PULL 13/48] iotests: Make redirecting qemu's stderr optional

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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

[Qemu-block] [PULL 23/48] block: Use blk_remove_bs() in blk_delete()

2016-01-29 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- block/block-backend.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-)

[Qemu-block] [PULL 20/48] virtio-scsi: Catch BDS-BB removal/insertion

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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 Signed-off-by: Kevin Wolf --- hw/scsi/virtio-scsi.c | 55

[Qemu-block] [PULL 48/48] iotests: Add "qemu-img map" test for VMDK extents

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 1453780743-16806-17-git-send-email-f...@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- tests/qemu-iotests/059 | 10 ++

[Qemu-block] [PULL 41/48] vdi: Assign bs->file->bs to file in vdi_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-10-git-send-email-f...@redhat.com Signed-off-by: Max Reitz --- block/vdi.c | 1 + 1 file changed, 1 insertion(+) diff

[Qemu-block] [PULL 42/48] vpc: Assign bs->file->bs to file in vpc_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-11-git-send-email-f...@redhat.com Signed-off-by: Max Reitz --- block/vpc.c | 2 ++ 1 file changed, 2 insertions(+)

[Qemu-block] [PULL 31/48] iotests: Add test for block jobs and BDS ejection

2016-01-29 Thread Kevin Wolf
From: Max Reitz Suggested-by: Paolo Bonzini Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/141 | 186

[Qemu-block] [PULL 29/48] block: Rewrite bdrv_close_all()

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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

Re: [Qemu-block] [Qemu-devel] [PULL 00/48] Block patches

2016-01-29 Thread Peter Maydell
On 29 January 2016 at 17:37, Kevin Wolf wrote: > The following changes since commit 047e363b05679724d6b784c6ec6310697fe48ba0: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-softfloat-20160122' into staging (2016-01-22 > 15:19:21 +) > > are available in

[Qemu-block] [PULL 44/48] vmdk: Return extent's file in bdrv_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 1453780743-16806-13-git-send-email-f...@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- block/vmdk.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[Qemu-block] [PULL 22/48] block: Remove BDS close notifier

2016-01-29 Thread Kevin Wolf
From: Max Reitz It is unused now, so we can remove it. Signed-off-by: Max Reitz Reviewed-by: Fam Zheng Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block.c| 8

[Qemu-block] [PULL 24/48] blockdev: Use blk_remove_bs() in do_drive_del()

2016-01-29 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-block] [PULL 15/48] block: Remove unused struct definition BlockFinishData

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Unused since 94db6d2d3. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- blockjob.c | 8 1 file changed, 8 deletions(-) diff --git a/blockjob.c b/blockjob.c

[Qemu-block] [PULL 28/48] block: Add blk_remove_all_bs()

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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

[Qemu-block] [PULL 34/48] qcow: Assign bs->file->bs to file in qcow_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-3-git-send-email-f...@redhat.com Signed-off-by: Max Reitz --- block/qcow.c

[Qemu-block] [PULL 17/48] iotests: Add test for eject under NBD server

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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 Reviewed-by: Fam Zheng Reviewed-by: Kevin Wolf

[Qemu-block] [PULL 35/48] qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-4-git-send-email-f...@redhat.com Signed-off-by: Max Reitz --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff

[Qemu-block] [PULL 40/48] sheepdog: Assign bs to file in sd_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-9-git-send-email-f...@redhat.com Signed-off-by: Max Reitz --- block/sheepdog.c | 3 +++ 1 file changed, 3 insertions(+)

[Qemu-block] [PULL 25/48] block: Make bdrv_close() static

2016-01-29 Thread Kevin Wolf
From: Max Reitz 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

[Qemu-block] [PULL 39/48] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status

2016-01-29 Thread Kevin Wolf
From: Fam Zheng Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-8-git-send-email-f...@redhat.com Signed-off-by: Max Reitz --- block/qed.c |

[Qemu-block] [PULL 32/48] block: acquire in bdrv_query_image_info

2016-01-29 Thread Kevin Wolf
From: Paolo Bonzini NFS calls aio_poll inside bdrv_get_allocated_size. This requires acquiring the AioContext. Signed-off-by: Paolo Bonzini Message-id: 1450867706-19860-1-git-send-email-pbonz...@redhat.com Reviewed-by: Fam Zheng

[Qemu-block] [PATCH] fdc: fix detection under Linux

2016-01-29 Thread John Snow
Accidentally, I removed a "feature" where empty drives had geometry values applied to them, which allows seek on empty drives to work "by accident," as QEMU actually tries to disallow that. Seeks on empty drives should work, though, but the easiest thing is to restore the misfeature where empty

[Qemu-block] [PATCH 1/4] ahci: Do not unmap NULL addresses

2016-01-29 Thread John Snow
Definitely don't try to unmap a garbage address. Reported-by: Zuozhi fzz Signed-off-by: John Snow --- hw/ide/ahci.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 17f1cbd..cdc9299 100644 ---

[Qemu-block] [PATCH 3/4] ahci: explicitly reject bad engine states on post_load

2016-01-29 Thread John Snow
Currently, we let ahci_cond_start_engines reject weird configurations where either the DMA (CLB) or FIS engines are said to be started, but their matching on/off control bit is toggled off. There should be no way to achieve this, since any time you toggle the control bit off, the status bit

[Qemu-block] [PATCH 0/4] ahci: unmap fixes

2016-01-29 Thread John Snow
As reported by Zuozhi fzz , there's a problem you can expose in AHCI by rewriting the command list buffer and/or FIS receive buffer addresses, then re-starting the AHCI device before bringing it to a stop. Depending on the success of the remap operations, you may be

[Qemu-block] [PATCH 2/4] ahci: handle LIST_ON and FIS_ON in map helpers

2016-01-29 Thread John Snow
Instead of relying on ahci_cond_start_engines to maintain the engine status indicators itself, have the lower-layer CLB and FIS mapper helpers do it themselves. This makes the cond_start routine slightly nicer to read, and makes sure that the status indicators will always be correct.

Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/4] blockdev: Fix 'change' for slot devices

2016-01-29 Thread Eric Blake
On 01/29/2016 12:49 PM, Max Reitz wrote: > '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

[Qemu-block] [PATCH v4 2/4] blockdev: Fix 'change' for slot devices

2016-01-29 Thread Max Reitz
'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

Re: [Qemu-block] [Qemu-devel] QCOW rebases on running VMs

2016-01-29 Thread Alberto Garcia
On Thu, Jan 28, 2016 at 08:25:18AM -0700, Eric Blake wrote: > > Sadly what I need is block-stream to an intermediate layer (as I > > want to merge in the other direction); I don't think that proposal > > was ever implemented. > > > >

Re: [Qemu-block] [Qemu-devel] [PATCH v4 3/4] Revert "hw/block/fdc: Implement tray status"

2016-01-29 Thread Eric Blake
On 01/29/2016 12:49 PM, Max Reitz wrote: > 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

[Qemu-block] [PATCH v4 3/4] Revert "hw/block/fdc: Implement tray status"

2016-01-29 Thread Max Reitz
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

[Qemu-block] [PATCH v4 0/4] blockdev: Fix 'change' for slot devices

2016-01-29 Thread Max Reitz
This is a rebase of v3 (http://lists.nongnu.org/archive/html/qemu-devel/2016-01/msg04471.html) on master made necessary because of a merge conflict in patch 3. git-backport-diff against v3: Key: [] : patches are identical [] : number of functional differences between upstream/downstream

[Qemu-block] [PATCH v4 1/4] block: Add blk_dev_has_tray()

2016-01-29 Thread Max Reitz
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 Signed-off-by: Max Reitz