Re: [Qemu-block] [Qemu-devel] [PATCH v7 00/20] block: Image locking series for 2.8

2016-09-05 Thread Fam Zheng
On Mon, 08/08 21:13, Fam Zheng wrote: > v7: - Rebase. > - Address comments from Kevin and Max. > - Option rename: "exclusive" -> "auto". [Kevin] > - Option placement: "root BDS" -> "node". > It's still a bit controversy where the option should go, but so far it > seems per n

[Qemu-block] [PULL 42/42] coroutine: reduce stack size to 64kB

2016-09-05 Thread Kevin Wolf
From: Peter Lieven evaluation with the recently introduced maximum stack usage monitoring revealed that the actual used stack size was never above 4kB so allocating 1MB stack for each coroutine is a lot of wasted memory. So reduce the stack size to 64kB which should still give enough head room. T

[Qemu-block] [PULL 41/42] oslib-posix: add a configure switch to debug stack usage

2016-09-05 Thread Kevin Wolf
From: Peter Lieven this adds a knob to track the maximum stack usage of stacks created by qemu_alloc_stack. Signed-off-by: Peter Lieven Reviewed-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- configure | 19 +++ util/oslib-posix.c | 36 ++

[Qemu-block] [PULL 40/42] coroutine-sigaltstack: use helper for allocating stack memory

2016-09-05 Thread Kevin Wolf
From: Peter Lieven Signed-off-by: Peter Lieven Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Kevin Wolf --- util/coroutine-sigaltstack.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigalts

[Qemu-block] [PULL 35/42] qemu-iotests: Log QMP traffic in debug mode

2016-09-05 Thread Kevin Wolf
Python tests are already annoying enough to debug. With QMP traffic available it's a little bit easier at least. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/iotests.py | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qem

[Qemu-block] [PULL 33/42] coroutine: Assert that no locks are held on termination

2016-09-05 Thread Kevin Wolf
A coroutine that takes a lock must also release it again. If the coroutine terminates without having released all its locks, it's buggy and we'll probably run into a deadlock sooner or later. Make sure that we don't get such cases. Signed-off-by: Kevin Wolf Reviewed-by: Paolo Bonzini Reviewed-by

[Qemu-block] [PULL 39/42] coroutine-ucontext: use helper for allocating stack memory

2016-09-05 Thread Kevin Wolf
From: Peter Lieven Signed-off-by: Peter Lieven Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Kevin Wolf --- util/coroutine-ucontext.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c

[Qemu-block] [PULL 38/42] coroutine: add a macro for the coroutine stack size

2016-09-05 Thread Kevin Wolf
From: Peter Lieven Signed-off-by: Peter Lieven Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Kevin Wolf --- include/qemu/coroutine_int.h | 2 ++ util/coroutine-sigaltstack.c | 2 +- util/coroutine-ucontext.c| 2 +- util/coroutine-win32.c | 2 +- 4 files c

[Qemu-block] [PULL 37/42] oslib-posix: add helpers for stack alloc and free

2016-09-05 Thread Kevin Wolf
From: Peter Lieven the allocated stack will be adjusted to the minimum supported stack size by the OS and rounded up to be a multiple of the system pagesize. Additionally an architecture dependent guard page is added to the stack to catch stack overflows. The memory for the guard page is deductat

[Qemu-block] [PULL 32/42] coroutine: Let CoMutex remember who holds it

2016-09-05 Thread Kevin Wolf
In cases of deadlocks, knowing who holds a given CoMutex is really helpful for debugging. Keeping the information around doesn't cost much and allows us to add another assertion to keep the code correct, so let's just add it. Signed-off-by: Kevin Wolf Reviewed-by: Paolo Bonzini Reviewed-by: Stef

[Qemu-block] [PULL 31/42] qcow2: fix iovec size at qcow2_co_pwritev_compressed

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Use bytes as the size would be more exact than s->cluster_size. Although qemu_iovec_to_buf() will not allow to go beyond the qiov. Signed-off-by: Pavel Butsykin Signed-off-by: Kevin Wolf --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-block] [PULL 34/42] block jobs: Improve error message for missing job ID

2016-09-05 Thread Kevin Wolf
If a block job is started with a node name rather than a device name and no explicit job ID is passed, it was reported that '' isn't a well-formed ID. Which is correct, but we can make the message a little bit nicer. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody Reviewed-by: Alberto Garcia R

[Qemu-block] [PULL 27/42] blockdev-backup: added support for data compression

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin The idea is simple - backup is "written-once" data. It is written block by block and it is large enough. It would be nice to save storage space and compress it. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Mar

[Qemu-block] [PULL 36/42] block: Allow node name for 'qemu-io' HMP command

2016-09-05 Thread Kevin Wolf
When using a node name, create a temporary BlockBackend that is used to run the qemu-io command. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- hmp.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hmp.c b/hmp.c index a7dfe6f..ad33b44 100644 --- a/hmp.c +++ b/hmp.c @@

[Qemu-block] [PULL 30/42] test-coroutine: Fix coroutine pool corruption

2016-09-05 Thread Kevin Wolf
The test case overwrites the Coroutine object with 0xff as a way to assert that the coroutine isn't used any more. However, this means that the coroutine pool now contains a corrupted object and later test cases may get this corrupted object and crash. This patch saves the real content of the obje

[Qemu-block] [PULL 26/42] drive-backup: added support for data compression

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin The idea is simple - backup is "written-once" data. It is written block by block and it is large enough. It would be nice to save storage space and compress it. The patch adds a flag to the qmp/hmp drive-backup command which enables block compression. Compression should be i

[Qemu-block] [PULL 23/42] block/io: turn on dirty_bitmaps for the compressed writes

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Previously was added the assert: commit 1755da16e32c15b22a521e8a38539e4b5cf367f3 Author: Paolo Bonzini Date: Thu Oct 18 16:49:18 2012 +0200 block: introduce new dirty bitmap functionality Now the compressed write is always in coroutine and setting the bits is don

[Qemu-block] [PULL 25/42] block: simplify blockdev-backup

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Now that we can support boxed commands, use it to greatly reduce the number of parameters (and likelihood of getting out of sync) when adjusting blockdev-backup parameters. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff C

[Qemu-block] [PULL 24/42] block: simplify drive-backup

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Now that we can support boxed commands, use it to greatly reduce the number of parameters (and likelihood of getting out of sync) when adjusting drive-backup parameters. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Signed-off-by: Deni

[Qemu-block] [PULL 28/42] qemu-iotests: test backup compression in 055

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Added cases to check the backup compression out of qcow2, raw in qcow2 on drive-backup and blockdev-backup. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: St

[Qemu-block] [PULL 29/42] qemu-iotests: add vmdk for test backup compression in 055

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin The vmdk format has support for compression, it would be fine to add it for the test backup compression Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan

[Qemu-block] [PULL 22/42] block: remove BlockDriver.bdrv_write_compressed

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin There are no block drivers left that implement the old .bdrv_write_compressed interface, so it can be removed. Also now we have no need to use the bdrv_pwrite_compressed function and we can remove it entirely. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Sign

[Qemu-block] [PULL 17/42] qcow2: add qcow2_co_pwritev_compressed

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Added implementation of the qcow2_co_pwritev_compressed function that will allow us to safely use compressed writes for the qcow2 from running VMs. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruste

[Qemu-block] [PULL 13/42] nbd-server: Allow node name for nbd-server-add

2016-09-05 Thread Kevin Wolf
There is no reason why an NBD server couldn't be started for any node, even if it's not on the top level. This converts nbd-server-add to accept a node-name. Note that there is a semantic difference between using a BlockBackend name and the node name of its root: In the former case, the NBD server

[Qemu-block] [PULL 18/42] qcow2: cleanup qcow2_co_pwritev_compressed to avoid the recursion

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Now that the function uses a vector instead of a buffer, there is no need to use recursive code. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoc

[Qemu-block] [PULL 20/42] qcow: add qcow_co_pwritev_compressed

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Added implementation of the qcow_co_pwritev_compressed function that will allow us to safely use compressed writes for the qcow from running VMs. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster

[Qemu-block] [PULL 10/42] block: Accept node-name for drive-backup

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts drive-backup and the corresponding transaction action to accept a node-name without lifting the restriction that we're operating at a root node. In case of an inval

[Qemu-block] [PULL 16/42] block/io: reuse bdrv_co_pwritev() for write compressed

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin For bdrv_pwrite_compressed() it looks like most of the code creating coroutine is duplicated in bdrv_prwv_co(). So we can just add a flag (BDRV_REQ_WRITE_COMPRESSED) and use bdrv_prwv_co() as a generic one. In the end we get coroutine oriented function for write compressed by

[Qemu-block] [PULL 11/42] block: Accept node-name for drive-mirror

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts drive-mirror to accept a node-name without lifting the restriction that we're operating at a root node. In case of an invalid device name, the command returns the G

[Qemu-block] [PULL 15/42] block: Convert bdrv_pwrite_compressed() to BdrvChild

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoczi CC: Kevin Wolf Signed-off-by: Kevin Wolf --- block/block-backend.c | 2 +- block/io.c

[Qemu-block] [PULL 06/42] block: Accept node-name for blockdev-mirror

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts blockdev-mirror to accept a node-name without lifting the restriction that we're operating at a root node. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Revie

[Qemu-block] [PULL 07/42] block: Accept node-name for blockdev-snapshot-delete-internal-sync

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts blockdev-snapshot-delete-internal-sync to accept a node-name without lifting the restriction that we're operating at a root node. In case of an invalid device name,

[Qemu-block] [PULL 05/42] block: Accept node-name for blockdev-backup

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts blockdev-backup and the corresponding transaction action to accept a node-name without lifting the restriction that we're operating at a root node. In case of an in

[Qemu-block] [PULL 21/42] qcow: cleanup qcow_co_pwritev_compressed to avoid the recursion

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Now that the function uses a vector instead of a buffer, there is no need to use recursive code. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoc

[Qemu-block] [PULL 19/42] vmdk: add vmdk_co_pwritev_compressed

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin Added implementation of the vmdk_co_pwritev_compressed function that will allow us to safely use compressed writes for the vmdk from running VMs. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster

[Qemu-block] [PULL 12/42] nbd-server: Use a separate BlockBackend

2016-09-05 Thread Kevin Wolf
The builtin NBD server uses its own BlockBackend now instead of reusing the monitor/guest device one. This means that it has its own writethrough setting now. The builtin NBD server always uses writeback caching now regardless of whether the guest device has WCE enabled. qemu-nbd respects the cach

[Qemu-block] [PULL 14/42] block: switch blk_write_compressed() to byte-based interface

2016-09-05 Thread Kevin Wolf
From: Pavel Butsykin This is a preparatory patch, which continues the general trend of the transition to the byte-based interfaces. bdrv_check_request() and blk_check_request() are no longer used, thus we can remove them. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Reviewed-by:

[Qemu-block] [PULL 08/42] block: Accept node-name for blockdev-snapshot-internal-sync

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts blockdev-snapshot-internal-sync to accept a node-name without lifting the restriction that we're operating at a root node. In case of an invalid device name, the co

[Qemu-block] [PULL 04/42] block: Accept node-name for block-commit

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts block-commit to accept a node-name without lifting the restriction that we're operating at a root node. As libvirt makes use of the DeviceNotFound error class, we m

[Qemu-block] [PULL 09/42] block: Accept node-name for change-backing-file

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts change-backing-file to accept a node-name without lifting the restriction that we're operating at a root node. In case of an invalid device name, the command return

[Qemu-block] [PULL 03/42] block: Accept node-name for block-stream

2016-09-05 Thread Kevin Wolf
In order to remove the necessity to use BlockBackend names in the external API, we want to allow node-names everywhere. This converts block-stream to accept a node-name without lifting the restriction that we're operating at a root node. In case of an invalid device name, the command returns the G

[Qemu-block] [PULL 01/42] ide: ide-cd without drive property for empty drive

2016-09-05 Thread Kevin Wolf
This allows the creation of an empty ide-cd device without manually creating a BlockBackend. Signed-off-by: Kevin Wolf Acked-by: Eric Blake --- hw/ide/qdev.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 67c76bf..2e

[Qemu-block] [PULL 00/42] Block layer patches

2016-09-05 Thread Kevin Wolf
The following changes since commit e87d397e5ef66276ccc49b829527d605ca07d0ad: Open 2.8 development tree (2016-09-05 11:38:54 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch changes up to 1585512ba88324844c2722fd977b126fc274860

[Qemu-block] [PULL 02/42] scsi: scsi-cd without drive property for empty drive

2016-09-05 Thread Kevin Wolf
This allows the creation of an empty scsi-cd device without manually creating a BlockBackend. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- hw/scsi/scsi-disk.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 836a155..99c9d61 10064

Re: [Qemu-block] [PATCH 00/10] block: Accept qdev IDs in device level QMP commands

2016-09-05 Thread Kevin Wolf
Am 19.08.2016 um 18:50 hat Kevin Wolf geschrieben: > In order to remove the necessity to use BlockBackend names in the external > API, > we already converted all block layer QMP commands on the node level to accept > node names instead of BlockBackend names. This series converts the second > part

[Qemu-block] [PATCH 3/3] fdc: Move qdev properties to FloppyDrive

2016-09-05 Thread Kevin Wolf
This makes the FloppyDrive qdev object actually useful: Now that it has all properties that don't belong to the controller, you can actually use '-device floppy' and get a working result. Command line semantics is consistent with CD-ROM drives: By default you get a single empty floppy drive. You c

[Qemu-block] [PATCH 1/3] fdc: Add a floppy qbus

2016-09-05 Thread Kevin Wolf
This adds a qbus to the floppy controller that should contain the floppy drives eventually. At the moment it just exists and is empty. Signed-off-by: Kevin Wolf --- hw/block/fdc.c | 40 +++- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/hw/blo

[Qemu-block] [PATCH 2/3] fdc: Add a floppy drive qdev

2016-09-05 Thread Kevin Wolf
Floppy controllers automatically create two floppy drive devices in qdev now. (They always created two drives, but managed them only internally.) Signed-off-by: Kevin Wolf --- hw/block/fdc.c | 152 +++-- 1 file changed, 115 insertions(+), 37 de

[Qemu-block] [PATCH 0/3] fdc: Use separate qdev device for drives

2016-09-05 Thread Kevin Wolf
We have been complaining for a long time about how the floppy controller and floppy drives are combined in a single qdev device and how this makes the device awkward to work with because it behaves different from all other block devices. The latest reason to complain was when I noticed that using

Re: [Qemu-block] [PATCH for 2.8 02/11] virtio: convert to use DMA api

2016-09-05 Thread Wei Xu
On 2016年08月30日 11:06, Jason Wang wrote: @@ -1587,6 +1595,11 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) } if (legacy) { +if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) { +error_setg(errp, "VIRTIO_F_IOMMU_PLATFORM was suppor

Re: [Qemu-block] [Qemu-devel] [PATCH] virtio-blk: Remove hw/virtio/dataplane folder from MAINTAINERS file

2016-09-05 Thread Markus Armbruster
Thomas Huth writes: > On 05.09.2016 13:05, Markus Armbruster wrote: [...] >> Let's fix all this. You or I? > > I don't mind. I'm currently busy hunting some bugs ... So feel free to > send the patches for these issues. (and in case you also don't have time > for that now, I've also put an entry

Re: [Qemu-block] [Qemu-devel] [PATCH] virtio-blk: Remove hw/virtio/dataplane folder from MAINTAINERS file

2016-09-05 Thread Thomas Huth
On 05.09.2016 13:05, Markus Armbruster wrote: > Thomas Huth writes: > >> On 05.09.2016 10:22, Markus Armbruster wrote: >>> Thomas Huth writes: >>> The folder does not exist anymore, thus should be removed from the MAINTAINERS file, too. Signed-off-by: Thomas Huth --- >>

Re: [Qemu-block] [Qemu-devel] [PATCH] virtio-blk: Remove hw/virtio/dataplane folder from MAINTAINERS file

2016-09-05 Thread Markus Armbruster
Thomas Huth writes: > On 05.09.2016 10:22, Markus Armbruster wrote: >> Thomas Huth writes: >> >>> The folder does not exist anymore, thus should be removed from the >>> MAINTAINERS file, too. >>> >>> Signed-off-by: Thomas Huth >>> --- >>> MAINTAINERS | 1 - >>> 1 file changed, 1 deletion(-) >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/1] block-backend: allow flush on devices with open tray

2016-09-05 Thread Markus Armbruster
John Snow writes: > On 09/02/2016 01:44 AM, Markus Armbruster wrote: >> John Snow writes: >> >>> If a device still has an attached BDS because the medium has not yet >>> been removed, we will be unable to migrate to a new host because >>> blk_flush will return an error for that backend. >>> >>>

Re: [Qemu-block] [Qemu-devel] hostdev / iSCSI issue in QEMU 2.7

2016-09-05 Thread Kevin Wolf
Am 01.09.2016 um 22:21 hat Holger Schranz geschrieben: > Hello, > > we need help for an issue we have sice QEMU 2.7. > May be we use the wrong mailing list. If so please let me know which > mail list we have to use to report problems in QEMU. > > Best regards > > Holger Eric, a quick look sugge

Re: [Qemu-block] [Qemu-devel] [PATCH] virtio-blk: Remove hw/virtio/dataplane folder from MAINTAINERS file

2016-09-05 Thread Thomas Huth
On 05.09.2016 10:22, Markus Armbruster wrote: > Thomas Huth writes: > >> The folder does not exist anymore, thus should be removed from the >> MAINTAINERS file, too. >> >> Signed-off-by: Thomas Huth >> --- >> MAINTAINERS | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/MAINTAINERS b/M

Re: [Qemu-block] [Qemu-devel] [PATCH] virtio-blk: Remove hw/virtio/dataplane folder from MAINTAINERS file

2016-09-05 Thread Markus Armbruster
Thomas Huth writes: > The folder does not exist anymore, thus should be removed from the > MAINTAINERS file, too. > > Signed-off-by: Thomas Huth > --- > MAINTAINERS | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index b6fb84e..ff45f8c 100644 > --- a/MAINTAIN