[Qemu-block] [PULL 04/76] hw/arm/nseries: convert ffs(3) to ctz32()

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com It is not clear from the code how a 0 parameter should be handled by the hardware. Keep the same behavior as ffs(0) - 1 == -1. Cc: Andrzej Zaborowski bal...@zabor.org Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Message-id:

[Qemu-block] [PULL 02/76] MAINTAINERS: Add myself as the maintainer of the Quorum driver

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia be...@igalia.com Signed-off-by: Alberto Garcia be...@igalia.com Message-id: 1426522925-1-1-git-send-email-be...@igalia.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- MAINTAINERS | 6 ++ 1 file changed, 6

[Qemu-block] [PULL 39/76] qmp: fill in the image field in BlockDeviceInfo

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia be...@igalia.com The image field in BlockDeviceInfo is supposed to contain an ImageInfo object. However that is being filled in by bdrv_query_info(), not by bdrv_block_device_info(), which is where BlockDeviceInfo is actually created. Anyone calling bdrv_block_device_info()

[Qemu-block] [PULL 54/76] hbitmap: cache array lengths

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com As a convenience: between incremental backups, bitmap migrations and bitmap persistence we seem to need to recalculate these a lot. Because the lengths are a little bit-twiddly, let's just solidly cache them and be done with it. Reviewed-by: Max Reitz

[Qemu-block] [PULL 57/76] block: Add bitmap successors

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com A bitmap successor is an anonymous BdrvDirtyBitmap that is intended to be created just prior to a sensitive operation (e.g. Incremental Backup) that can either succeed or fail, but during the course of which we still want a bitmap tracking writes. On creating a

[Qemu-block] [PULL 06/76] Convert (ffs(val) - 1) to ctz32(val)

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com This commit was generated mechanically by coccinelle from the following semantic patch: @@ expression val; @@ - (ffs(val) - 1) + ctz32(val) The call sites have been audited to ensure the ffs(0) - 1 == -1 case never occurs (due to input validation,

[Qemu-block] [PULL 15/76] iothread: release iothread around aio_poll

2015-04-28 Thread Kevin Wolf
From: Paolo Bonzini pbonz...@redhat.com This is the first step towards having fine-grained critical sections in dataplane threads, which resolves lock ordering problems between address_space_* functions (which need the BQL when doing MMIO, even after we complete RCU-based dispatch) and the

[Qemu-block] [PULL 27/76] block: Pause block jobs in bdrv_drain_all

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com This is necessary to suppress more IO requests from being generated from block job coroutines. Signed-off-by: Fam Zheng f...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Alberto Garcia

[Qemu-block] [PULL 26/76] blockjob: Allow nested pause

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com This patch changes block_job_pause to increase the pause counter and block_job_resume to decrease it. The counter will allow calling block_job_pause/block_job_resume unconditionally on a job when we need to suspend the IO temporarily. From now on, each

[Qemu-block] [PULL 30/76] block: avoid unnecessary bottom halves

2015-04-28 Thread Kevin Wolf
From: Paolo Bonzini pbonz...@redhat.com bdrv_aio_* APIs can use coroutines to achieve asynchronicity. However, the coroutine may terminate without having yielded back to the caller (for example because of something that invokes a nested event loop, or because the coroutine is doing nothing at

[Qemu-block] [PULL 28/76] qemu-iotests: Test that stop doesn't drain block jobs

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com Signed-off-by: Fam Zheng f...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Alberto Garcia be...@igalia.com Message-id: 1428069921-2957-4-git-send-email-f...@redhat.com Signed-off-by: Stefan

[Qemu-block] [PULL 61/76] block: add BdrvDirtyBitmap documentation

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com Signed-off-by: John Snow js...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id: 1429314609-29776-14-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by:

[Qemu-block] [PULL 29/76] blockjob: Update function name in comments

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com Signed-off-by: Fam Zheng f...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Alberto Garcia be...@igalia.com Message-id: 1428069921-2957-5-git-send-email-f...@redhat.com Signed-off-by: Stefan

[Qemu-block] [PULL 47/76] block/iscsi: bump year in copyright notice

2015-04-28 Thread Kevin Wolf
From: Peter Lieven p...@kamp.de Signed-off-by: Peter Lieven p...@kamp.de Message-id: 1429193313-4263-9-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- block/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Qemu-block] [PULL 60/76] qmp: Add dirty bitmap status field in query-block

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com Add the frozen status booleans, to inform clients when a bitmap is occupied doing a task. Signed-off-by: Fam Zheng f...@redhat.com Signed-off-by: John Snow js...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com

[Qemu-block] [PULL 65/76] iotests: add invalid input incremental backup tests

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com Signed-off-by: John Snow js...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id: 1429314609-29776-18-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by:

[Qemu-block] [PULL 43/76] block/iscsi: store DPOFUA bit from the modesense command

2015-04-28 Thread Kevin Wolf
From: Peter Lieven p...@kamp.de Signed-off-by: Peter Lieven p...@kamp.de Message-id: 1429193313-4263-5-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- block/iscsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[Qemu-block] [PULL 46/76] block/iscsi: handle SCSI_STATUS_TASK_SET_FULL

2015-04-28 Thread Kevin Wolf
From: Peter Lieven p...@kamp.de a target may issue a SCSI_STATUS_TASK_SET_FULL status if there is more than one BUSY command queued already. Signed-off-by: Peter Lieven p...@kamp.de Message-id: 1429193313-4263-8-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi stefa...@redhat.com

[Qemu-block] [PULL 75/76] block: extract bdrv_setup_io_funcs()

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com Move the code to install coroutine and aio emulation function pointers in a BlockDriver to its own function. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- block.c | 7 ++-

[Qemu-block] [PULL 66/76] iotests: add QMP event waiting queue

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com A filter is added to allow callers to request very specific events to be pulled from the event queue, while leaving undesired events still in the stream. This allows us to poll for completion data for multiple asynchronous events in any arbitrary order. A new

[Qemu-block] [PULL 17/76] qemu-img convert: Rewrite copying logic

2015-04-28 Thread Kevin Wolf
The implementation of qemu-img convert is (a) messy, (b) buggy, and (c) less efficient than possible. The changes required to beat some sense into it are massive enough that incremental changes would only make my and the reviewers' life harder. So throw it away and reimplement it from scratch.

[Qemu-block] [PULL 19/76] blkdebug: Add bdrv_truncate()

2015-04-28 Thread Kevin Wolf
This is, amongst others, required for qemu-iotests 033 to run as intended on VHDX, which uses explicit bdrv_truncate() calls to bs-file when allocating new blocks. Signed-off-by: Kevin Wolf kw...@redhat.com Reviewed-by: Jeff Cody jc...@redhat.com --- block/blkdebug.c | 6 ++ 1 file changed,

[Qemu-block] [PULL 09/76] omap_intc: convert ffs(3) to ctz32() in omap_inth_sir_update()

2015-04-28 Thread Kevin Wolf
From: Paolo Bonzini pbonz...@redhat.com Rewrite the loop using level = level - 1 to clear the least significant bit after each iteration. This simplifies the loop and makes it easy to replace ffs(3) with ctz32(). Cc: Peter Maydell peter.mayd...@linaro.org Signed-off-by: Paolo Bonzini

[Qemu-block] [PULL 48/76] block/iscsi: use the allocationmap also if cache.direct=on

2015-04-28 Thread Kevin Wolf
From: Peter Lieven p...@kamp.de the allocationmap has only a hint character. The driver always double checks that blocks marked unallocated in the cache are still unallocated before taking the fast path and return zeroes. So using the allocationmap is migration safe and can also be enabled with

[Qemu-block] [PULL 05/76] uninorth: convert ffs(3) to ctz32()

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com It is not clear from the code how a 0 parameter should be handled by the hardware. Keep the same behavior as ffs(0) - 1 == -1. Cc: Alexander Graf ag...@suse.de Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Message-id:

[Qemu-block] [PULL 20/76] vhdx: Fix zero-fill iov length

2015-04-28 Thread Kevin Wolf
Fix the length of the zero-fill for the back, which was accidentally using the same value as for the front. This is caught by qemu-iotests 033. For consistency, change the code for the front as well to use the length stored in the iov (it is the same value, copied four lines above).

[Qemu-block] [PULL 21/76] thread-pool: clean up thread_pool_completion_bh()

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com This patch simplifies thread_pool_completion_bh(). The function first checks elem-state: if (elem-state != THREAD_DONE) { continue; } It then goes on to check elem-state == THREAD_DONE although we already know this must be the case. The

[Qemu-block] [PULL 22/76] scripts: add 'qemu coroutine' command to qemu-gdb.py

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com The 'qemu coroutine coroutine-address' GDB command prints the backtrace for a CoroutineUContext. This is useful for peeking inside yielded coroutines that are waiting for file descriptor events, timers, etc. For example: $ gdb tests/test-coroutine

[Qemu-block] [PULL 50/76] qapi: Add optional field name to block dirty bitmap

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com This field will be set for user created dirty bitmap. Also pass in an error pointer to bdrv_create_dirty_bitmap, so when a name is already taken on this BDS, it can report an error message. This is not global check, two BDSes can have dirty bitmap with a common

[Qemu-block] [PULL 44/76] block/iscsi: optimize WRITE10/16 if cache.writeback is not set

2015-04-28 Thread Kevin Wolf
From: Peter Lieven p...@kamp.de SCSI allowes to tell the target to not return from a write command if the date is not written to the disk. Use this so called FUA bit if it is supported to optimize WRITE commands if writeback is not allowed. In this case qemu always issues a WRITE followed by a

[Qemu-block] [PULL 72/76] vmdk: Widen before shifting 32 bit header field

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com Coverity spotted this. The field is 32 bits, but if it's possible to overflow in 32 bit left shift. Signed-off-by: Fam Zheng f...@redhat.com Reviewed-by: John Snow js...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- block/vmdk.c | 2 +- 1 file

[Qemu-block] [PULL 71/76] block/dmg: make it modular

2015-04-28 Thread Kevin Wolf
From: Michael Tokarev m...@tls.msk.ru dmg can optionally utilize libbz2, make it modular Signed-off-by: Michael Tokarev m...@tls.msk.ru Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- block/Makefile.objs | 3 ++- 1 file changed, 2 insertions(+), 1

[Qemu-block] [PULL 74/76] block: add bdrv_set_dirty()/bdrv_reset_dirty() to block_int.h

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com The dirty bitmap functions are called from the block I/O processing code. Make them visible to block_int.h users so they can be used outside block.c. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com ---

[Qemu-block] [PULL 14/76] AioContext: acquire/release AioContext during aio_poll

2015-04-28 Thread Kevin Wolf
From: Paolo Bonzini pbonz...@redhat.com This is the first step in pushing down acquire/release, and will let rfifolock drop the contention callback feature. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id:

[Qemu-block] [PULL 10/76] os-win32: drop ffs(3) prototype

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com The lack of ffs(3) in the MinGW headers is a hint that we shouldn't rely on it. MinGW 4.9.2 does not make it available for linking when QEMU's ./configure --enable-debug is used (release builds are fine though). Now that all QEMU code has been switched

[Qemu-block] [PULL 25/76] MAINTAINERS: Add Fam Zheng as Null block driver maintainer

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com Signed-off-by: Fam Zheng f...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id: 1427852740-24315-4-git-send-email-f...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin

[Qemu-block] [PULL 35/76] block: add bdrv_get_device_or_node_name()

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia be...@igalia.com This function gets the device name associated with a BlockDriverState, or its node name if the device name is empty. Signed-off-by: Alberto Garcia be...@igalia.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Message-id:

[Qemu-block] [PULL 24/76] block/null: Support reopen

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com Reopen is used in block-commit. With this always-succeed operation, it is now possible to test committing to a null drive, by specifying null-aio:// or null-co:// as the backing image when creating the qcow2 image. Signed-off-by: Fam Zheng f...@redhat.com

[Qemu-block] [PULL 34/76] block: document block-stream in qmp-commands.hx

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com The 'block-stream' QMP command is documented in block-core.json but not qmp-commands.hx. Add a summary of the command to qmp-commands.hx (similar to the documentation for 'block-commit'). Reported-by: Kashyap Chamarthy kcham...@redhat.com Signed-off-by:

[Qemu-block] [PULL 68/76] iotests: add incremental backup failure recovery test

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com Test the failure case for incremental backups. Signed-off-by: John Snow js...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id: 1429314609-29776-21-git-send-email-js...@redhat.com Signed-off-by:

[Qemu-block] [PULL 73/76] block: replace bdrv_states iteration with bdrv_next()

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com The bdrv_states list is a static variable in block.c. bdrv_drain_all() and bdrv_flush_all() use this variable to iterate over all drives. The next patch will move bdrv_drain_all() and bdrv_flush_all() out of block.c so it's necessary to switch to the

[Qemu-block] [PULL 63/76] block: Resize bitmaps on bdrv_truncate

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com Signed-off-by: John Snow js...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id: 1429314609-29776-16-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by:

[Qemu-block] [PULL 70/76] block/mirror: Always call block_job_sleep_ns()

2015-04-28 Thread Kevin Wolf
From: Max Reitz mre...@redhat.com The mirror block job is trying to take a clever shortcut if delay_ns is 0 and skips block_job_sleep_ns() in that case. But that function must be called in every block job iteration, because otherwise it is for example impossible to pause the job. Signed-off-by:

[Qemu-block] [PULL 62/76] block: Ensure consistent bitmap function prototypes

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com We often don't need the BlockDriverState for functions that operate on bitmaps. Remove it. Signed-off-by: John Snow js...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id:

[Qemu-block] [PULL 69/76] iotests: add incremental backup granularity tests

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com Test what happens if you fiddle with the granularity. Reviewed-by: Max Reitz mre...@redhat.com Signed-off-by: John Snow js...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id: 1429314609-29776-22-git-send-email-js...@redhat.com

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

2015-04-28 Thread Peter Maydell
On 28 April 2015 at 15:59, Kevin Wolf kw...@redhat.com wrote: The following changes since commit 84cbd63f87c1d246f51ec8eee5367a5588f367fd: Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging (2015-04-28 12:22:20 +0100) are available in the git repository at:

[Qemu-block] [PULL 16/76] block-backend: Expose bdrv_write_zeroes()

2015-04-28 Thread Kevin Wolf
Signed-off-by: Kevin Wolf kw...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com --- block/block-backend.c | 11 +++ include/sysemu/block-backend.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index 48b6e4c..93e46f3

[Qemu-block] [PULL 08/76] sd: convert sd_normal_command() ffs(3) call to ctz32()

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com ffs() cannot be replaced with ctz32() when the argument might be zero, because ffs(0) returns 0 while ctz32(0) returns 32. The ffs(3) call in sd_normal_command() is a special case though. It can be converted to ctz32() + 1 because the argument is never

[Qemu-block] [PULL 12/76] block: Switch to host monotonic clock for IO throttling

2015-04-28 Thread Kevin Wolf
From: Fam Zheng f...@redhat.com Currently, throttle timers won't make any progress when VCPU is not running, which would stall the request queue in utils, qtest, vm suspending, and live migration, without special handling. Block jobs are confusingly inconsistent between with and without

[Qemu-block] [PULL 36/76] block: use bdrv_get_device_or_node_name() in error messages

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia be...@igalia.com There are several error messages that identify a BlockDriverState by its device name. However those errors can be produced in nodes that don't have a device name associated. In those cases we should use bdrv_get_device_or_node_name() to fall back to the node

[Qemu-block] [PULL 49/76] docs: incremental backup documentation

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com Signed-off-by: John Snow js...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Message-id: 1429314609-29776-2-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 37/76] block: add 'node-name' field to BLOCK_IMAGE_CORRUPTED

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia be...@igalia.com Since this event can occur in nodes that cannot have a device name associated, include also a field with the node name. Signed-off-by: Alberto Garcia be...@igalia.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com

[Qemu-block] [PULL 67/76] iotests: add simple incremental backup case

2015-04-28 Thread Kevin Wolf
From: John Snow js...@redhat.com Signed-off-by: John Snow js...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Message-id: 1429314609-29776-20-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: