[Qemu-devel] [PULL 01/76] savevm: create snapshot failed when id_str already exists

2015-04-28 Thread Kevin Wolf
From: Yi Wang The command "virsh create" will fail in such condition: vm has two disks: vda and vdb. vda has snapshot s1 with id "1", vdb doesn't have s1 but has snapshot s2 with id "1". When we want to run command "virsh create s1", del_existing_snapshots() only deletes s1 in vda, and bdrv_snap

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

2015-04-28 Thread Kevin Wolf
From: Paolo Bonzini 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 AioContext. Because AioCo

[Qemu-devel] [PULL 11/76] checkpatch: complain about ffs(3) calls

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi The ffs(3) family of functions is not portable. MinGW doesn't always provide the function. Use ctz32() or ctz64() instead. Signed-off-by: Stefan Hajnoczi Message-id: 1427124571-28598-10-git-send-email-stefa...@redhat.com Signed-off-by: Kevin Wolf --- scripts/checkpatch

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

2015-04-28 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- 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 100644 --- a/block/block-backend.c ++

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi 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 Signed-off-by: Stefan Hajnoczi Message-id: 1427124571-28598-4-git-send-email-stefa...@redhat.com Signed-off-by: Kevin Wolf -

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

2015-04-28 Thread Kevin Wolf
From: Fam Zheng 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 block_job_resume must be

[Qemu-devel] [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. Let

[Qemu-devel] [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). Signed-off-by

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi 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 zero: if (!(req.a

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

2015-04-28 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Reviewed-by: Alberto Garcia Message-id: 1428069921-2957-4-git-send-email-f...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/129 | 86 +++

[Qemu-devel] [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 Reviewed-by: Jeff Cody --- block/blkdebug.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/bl

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

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

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi 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, asserts, etc). Therefore

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

2015-04-28 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-id: 1427852740-24315-4-git-send-email-f...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAIN

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

2015-04-28 Thread Kevin Wolf
From: Paolo Bonzini 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 all). In this case, t

[Qemu-devel] [PULL 31/76] virtio_blk: comment fix

2015-04-28 Thread Kevin Wolf
From: "Michael S. Tsirkin" update virtio blk header from latest linux, include comment fixups. Signed-off-by: Michael S. Tsirkin Message-id: 1428854036-12806-1-git-send-email-...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- include/standard-headers/linux/virtio_blk

[Qemu-devel] [PULL 07/76] Convert ffs() != 0 callers to ctz32()

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi There are a number of ffs(3) callers that do roughly: bit = ffs(val); if (bit) { do_something(bit - 1); } This pattern can be converted to ctz32() like this: zeroes = ctz32(val); if (zeroes != 32) { do_something(zeroes); } Signed-off-by: Stefan Ha

[Qemu-devel] [PULL 32/76] m25p80: add missing blk_attach_dev_nofail

2015-04-28 Thread Kevin Wolf
From: Paolo Bonzini Of the block devices that poked into -drive options via drive_get_next, m25p80 was the only one who also did not attach itself to the BlockBackend. Since sd does it, and all other devices go through a "drive" property, with this change all block backends attached to the guest

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi 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 Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Bla

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

2015-04-28 Thread Kevin Wolf
From: Fam Zheng 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 throttling: if user sets

[Qemu-devel] [PULL 38/76] Revert "hmp: fix crash in 'info block -n -v'"

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi This reverts commit 638b8366200130cc7cf7a026630bc6bfb63b0c4c. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- hmp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hmp.c b/hmp.c index f142d36..f31ae27 100644 --- a/hmp.c +++ b/hmp.c @@ -

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

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia 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 name and produce

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

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

[Qemu-devel] [PULL 41/76] block/iscsi: change all iscsilun properties from uint8_t to bool

2015-04-28 Thread Kevin Wolf
From: Peter Lieven Signed-off-by: Peter Lieven Message-id: 1429193313-4263-3-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/iscsi.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c in

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

2015-04-28 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Reviewed-by: Alberto Garcia Message-id: 1428069921-2957-5-git-send-email-f...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/backup.c | 2 +- block/mirror.c | 2 +

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

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia 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() directly will get

[Qemu-devel] [PULL 18/76] qemu-iotests: Some qemu-img convert tests

2015-04-28 Thread Kevin Wolf
This adds a regression test for some problems that the qemu-img convert rewrite just fixed. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/122 | 223 + tests/qemu-iotests/122.out | 209 +

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

2015-04-28 Thread Kevin Wolf
From: Peter Lieven Signed-off-by: Peter Lieven Message-id: 1429193313-4263-5-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/iscsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 221c9fc..237faa1 100644

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

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia 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 Reviewed-by: Max Reitz Reviewed-by: Eric Blake Message-id: 4fa30aa8d61d9052ce266fd5429a59a14e941255.1428485266.git.be...@iga

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi The 'qemu coroutine ' 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 (gdb) b test_yield (gdb) r (gdb)

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

2015-04-28 Thread Kevin Wolf
From: Peter Lieven 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 FLUSH. This is

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

2015-04-28 Thread Kevin Wolf
From: Fam Zheng 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 name. Implemented

[Qemu-devel] [PULL 23/76] block/null: Latency simulation by adding new option "latency-ns"

2015-04-28 Thread Kevin Wolf
From: Fam Zheng Aio context switch should just work because the requests will be drained, so the scheduled timer(s) on the old context will be freed. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Message-id: 1427852740-24315-2-git-send-email-f...@redhat.com Signed-off-by: Stefan Hajnoc

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

2015-04-28 Thread Kevin Wolf
From: Fam Zheng 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 Reviewed-by: Eric Blake Reviewed-b

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

2015-04-28 Thread Kevin Wolf
From: Peter Lieven 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 Message-id: 1429193313-4263-8-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/iscsi.c | 7

[Qemu-devel] [PULL 40/76] block/iscsi: do not forget to logout from target

2015-04-28 Thread Kevin Wolf
From: Peter Lieven We actually were always impolitely dropping the connection and not cleanly logging out. CC: qemu-sta...@nongnu.org Signed-off-by: Peter Lieven Message-id: 1429193313-4263-2-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/iscsi.c

[Qemu-devel] [PULL 56/76] block: Add bitmap disabled status

2015-04-28 Thread Kevin Wolf
From: John Snow Add a status indicating the enabled/disabled state of the bitmap. A bitmap is by default enabled, but you can lock the bitmap into a read-only state by setting disabled = true. A previous version of this patch added a QMP interface for changing the state of the bitmap, but it has

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi 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 QLIST_REMOVE() is dup

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

2015-04-28 Thread Kevin Wolf
From: Peter Lieven Signed-off-by: Peter Lieven Message-id: 1429193313-4263-9-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index 328907b..83

[Qemu-devel] [PULL 42/76] block/iscsi: rename iscsi_write_protected and let it return void

2015-04-28 Thread Kevin Wolf
From: Peter Lieven Signed-off-by: Peter Lieven Message-id: 1429193313-4263-4-git-send-email...@kamp.de Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/iscsi.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c index

[Qemu-devel] [PULL 58/76] qmp: Add support of "dirty-bitmap" sync mode for drive-backup

2015-04-28 Thread Kevin Wolf
From: John Snow For "dirty-bitmap" sync mode, the block job will iterate through the given dirty bitmap to decide if a sector needs backup (backup all the dirty clusters and skip clean ones), just as allocation conditions of "top" sync mode. Signed-off-by: Fam Zheng Signed-off-by: John Snow Re

[Qemu-devel] [PULL 33/76] m25p80: fix s->blk usage before assignment

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi Delay the call to blk_blockalign() until s->blk has been assigned. This never caused a crash because blk_blockalign(NULL, size) defaults to 4096 alignment but it's technically incorrect. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Message-id: 1429091024-250

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

2015-04-28 Thread Kevin Wolf
From: Peter Lieven 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 cache.direct=o

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

2015-04-28 Thread Kevin Wolf
From: Alberto Garcia 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 Reviewed-by: Eric Blake Reviewed-by: Max Reitz Message-id: 147cec5b3594f4bec0cb41c98afe5fcbfb67567c.1428485266.git.be...@

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

2015-04-28 Thread Kevin Wolf
From: John Snow 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 successor, we "fre

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

2015-04-28 Thread Kevin Wolf
From: John Snow 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 Reviewed-by: Eric Blake S

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

2015-04-28 Thread Kevin Wolf
From: John Snow Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Eric Blake Message-id: 1429314609-29776-2-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- docs/bitmaps.md | 352

[Qemu-devel] [PULL 59/76] qmp: add block-dirty-bitmap-clear

2015-04-28 Thread Kevin Wolf
From: John Snow Add bdrv_clear_dirty_bitmap and a matching QMP command, qmp_block_dirty_bitmap_clear that enables a user to reset the bitmap attached to a drive. This allows us to reset a bitmap in the event of a full drive backup. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by:

[Qemu-devel] [PULL 45/76] block/iscsi: increase retry count

2015-04-28 Thread Kevin Wolf
From: Peter Lieven The idea is that a command is retried in a BUSY condition up a time of approx. 60 seconds before it is failed. This should be far higher than any command timeout in the guest. Signed-off-by: Peter Lieven Message-id: 1429193313-4263-7-git-send-email...@kamp.de Signed-off-by: S

[Qemu-devel] [PULL 51/76] qmp: Ensure consistent granularity type

2015-04-28 Thread Kevin Wolf
From: John Snow We treat this field with a variety of different types everywhere in the code. Now it's just uint32_t. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 1429314609-29776-4-git-send-email-js...@redhat.com Signed-off

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

2015-04-28 Thread Kevin Wolf
From: John Snow Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 1429314609-29776-14-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-)

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi 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 public bdrv_next() int

[Qemu-devel] [PULL 52/76] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove

2015-04-28 Thread Kevin Wolf
From: John Snow The new command pair is added to manage a user created dirty bitmap. The dirty bitmap's name is mandatory and must be unique for the same device, but different devices can have bitmaps with the same names. The granularity is an optional field. If it is not specified, we will choo

[Qemu-devel] [PULL 53/76] block: Introduce bdrv_dirty_bitmap_granularity()

2015-04-28 Thread Kevin Wolf
From: John Snow This returns the granularity (in bytes) of dirty bitmap, which matches the QMP interface and the existing query interface. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-id: 1429314609-29776-6-git-send-email-js...@

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

2015-04-28 Thread Kevin Wolf
From: John Snow Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 1429314609-29776-16-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block.c| 18 ++ include/qemu/hbitmap.h |

[Qemu-devel] [PULL 55/76] hbitmap: add hbitmap_merge

2015-04-28 Thread Kevin Wolf
From: John Snow We add a bitmap merge operation to assist in error cases where we wish to combine two bitmaps together. This is algorithmically O(bits) provided HBITMAP_LEVELS remains constant. For a full bitmap on a 64bit machine: sum(bits/64^k, k, 0, HBITMAP_LEVELS) ~= 1.01587 * bits We may b

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

2015-04-28 Thread Kevin Wolf
From: John Snow Add the "frozen" status booleans, to inform clients when a bitmap is occupied doing a task. Signed-off-by: Fam Zheng Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-id: 1429314609-29776-13-git-send-email-js...@redh

Re: [Qemu-devel] [PATCH] pci: Merge pci_nic_init() into pci_nic_init_nofail()

2015-04-28 Thread Markus Armbruster
Thomas Huth writes: > The error reporting in pci_nic_init() is quite erratic: Some errors > are printed directly with error_report(), and some are passed back > to the caller pci_nic_init_nofail() via an Error pointer. > Since pci_nic_init() is only used by pci_nic_init_nofail(), the > functions

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

2015-04-28 Thread Kevin Wolf
From: John Snow Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 1429314609-29776-18-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/124 | 104

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

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

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

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

[Qemu-devel] [PULL 64/76] hbitmap: truncate tests

2015-04-28 Thread Kevin Wolf
From: John Snow The general approach is to set bits close to the boundaries of where we are truncating and ensure that everything appears to have gone OK. We test growing and shrinking by different amounts: - Less than the granularity - Less than the granularity, but across a boundary - Less tha

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

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

Re: [Qemu-devel] [PATCH v5 19/20] hw/arm/virt-acpi-build: Add PCIe controller in ACPI DSDT table

2015-04-28 Thread Igor Mammedov
On Tue, 28 Apr 2015 20:57:25 +0800 Shannon Zhao wrote: > On 2015/4/28 17:54, Igor Mammedov wrote: > > On Tue, 28 Apr 2015 17:06:00 +0800 > > Shannon Zhao wrote: > > > >> On 2015/4/28 16:47, Michael S. Tsirkin wrote: > >>> On Tue, Apr 28, 2015 at 10:42:25AM +0200, Igor Mammedov wrote: > On

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

2015-04-28 Thread Kevin Wolf
From: Max Reitz 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: Max Reitz Reviewe

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

2015-04-28 Thread Kevin Wolf
From: Michael Tokarev dmg can optionally utilize libbz2, make it modular Signed-off-by: Michael Tokarev Reviewed-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- block/Makefile.objs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/Makefile.objs b/block/Makefile.objs

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

2015-04-28 Thread Kevin Wolf
From: John Snow Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 1429314609-29776-20-git-send-email-js...@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/124 | 174

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

2015-04-28 Thread Kevin Wolf
From: Fam Zheng 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 Reviewed-by: John Snow Signed-off-by: Kevin Wolf --- block/vmdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vmdk.c b/b

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi 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 Signed-off-by: Kevin Wolf --- block.c | 12 include/block/

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

2015-04-28 Thread Kevin Wolf
From: Stefan Hajnoczi Move the code to install coroutine and aio emulation function pointers in a BlockDriver to its own function. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block.c | 7 ++- include/block/block_int.h | 8 2 files changed, 14 in

Re: [Qemu-devel] [PATCH 3/7] target-mips: add CP0.PageGrain.ELPA support

2015-04-28 Thread James Hogan
Hi Leon, On 28/04/15 13:41, Leon Alrae wrote: > CP0.PageGrain.ELPA enables support for large physical addresses. This field > is encoded as follows: > 0: Large physical address support is disabled. > 1: Large physical address support is enabled. > > If this bit is a 1, the following changes occur

Re: [Qemu-devel] [PATCH 4/7] target-mips: add MTHC0 and MFHC0 instructions

2015-04-28 Thread James Hogan
Hi Leon, On 28/04/15 13:41, Leon Alrae wrote: > Implement MTHC0 and MFHC0 instructions. In MIPS32 they allow to access > upper word of extended to 64-bits CP0 registers. > > In MIPS64, when CP0 destination register specified is the EntryLo0 or > EntryLo1, bits 1:0 of the GPR appear at bits 31:30

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

2015-04-28 Thread Kevin Wolf
From: John Snow 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 timeout context is

Re: [Qemu-devel] [PATCH v5 19/20] hw/arm/virt-acpi-build: Add PCIe controller in ACPI DSDT table

2015-04-28 Thread Michael S. Tsirkin
On Tue, Apr 28, 2015 at 05:13:10PM +0200, Igor Mammedov wrote: > > Here I need to set the value of buffer to 1 or 0, we could > > createbitfield, but if we want to set the value to non one or zero and > > the BufferSize is large, how could we do? CreateByteField? It's a little > > complex for user.

Re: [Qemu-devel] [PATCH] pci: Merge pci_nic_init() into pci_nic_init_nofail()

2015-04-28 Thread Michael S. Tsirkin
On Tue, Apr 28, 2015 at 12:50:07PM +0200, Thomas Huth wrote: > The error reporting in pci_nic_init() is quite erratic: Some errors > are printed directly with error_report(), and some are passed back > to the caller pci_nic_init_nofail() via an Error pointer. > Since pci_nic_init() is only used by

Re: [Qemu-devel] [PULL 00/22] Memory, TCG, NBD, build system changes for 2015-04-27

2015-04-28 Thread Peter Maydell
On 28 April 2015 at 15:40, Paolo Bonzini wrote: > The following changes since commit e1a5476354d396773e4c555f126d752d4ae58fa9: > > Open 2.4 development tree (2015-04-25 22:05:07 +0100) > > are available in the git repository at: > > git://github.com/bonzini/qemu.git tags/for-upstream > > for y

Re: [Qemu-devel] [PATCH 2/7] target-mips: support Page Frame Number Extension field

2015-04-28 Thread Leon Alrae
Hi James, On 28/04/2015 14:35, James Hogan wrote: > > > On 28/04/15 13:41, Leon Alrae wrote: >> Update tlb->PFN to contain PFN concatenated with PFNX. PFNX is 0 if large >> physical address is not supported. >> >> Signed-off-by: Leon Alrae >> --- >> target-mips/op_helper.c | 32 +++

Re: [Qemu-devel] [PATCH v3 0/4] scripts: qmp-shell: add transaction support

2015-04-28 Thread Kashyap Chamarthy
On Thu, Apr 23, 2015 at 06:23:31PM +0200, Kashyap Chamarthy wrote: > On Thu, Apr 23, 2015 at 10:34:57AM -0400, John Snow wrote: > > The qmp-shell is a little rudimentary, but it can be hacked > > to give us some transactional support without too much difficulty. > > > > (1) Prep. > > (2) Add suppo

Re: [Qemu-devel] [PATCH v3 0/4] scripts: qmp-shell: add transaction support

2015-04-28 Thread John Snow
On 04/28/2015 12:17 PM, Kashyap Chamarthy wrote: On Thu, Apr 23, 2015 at 06:23:31PM +0200, Kashyap Chamarthy wrote: On Thu, Apr 23, 2015 at 10:34:57AM -0400, John Snow wrote: The qmp-shell is a little rudimentary, but it can be hacked to give us some transactional support without too much dif

[Qemu-devel] [PATCH v13 02/12] hw/vfio/platform: vfio-platform skeleton

2015-04-28 Thread Eric Auger
Minimal VFIO platform implementation supporting register space user mapping but not IRQ assignment. Signed-off-by: Kim Phillips Signed-off-by: Eric Auger --- v12 -> v13: - check device name does not contain any / - handle case where readlink fully fills the buffer - in vfio_map_region declare s

[Qemu-devel] [PATCH v13 00/12] KVM platform device passthrough

2015-04-28 Thread Eric Auger
This series aims at enabling KVM platform device passthrough. Kernel dependencies were pulled for 4.1-rc0. This series now only relies on the following QEMU series [1] [PATCH v12 0/4] machvirt dynamic sysbus device instantiation http://comments.gmane.org/gmane.comp.emulators.kvm.arm.devel/886 Bo

[Qemu-devel] [PATCH v13 01/12] linux-headers: update headers according to 4.1-rc0

2015-04-28 Thread Eric Auger
This includes, among other things, VFIO platform driver and irqfd/arm. Signed-off-by: Eric Auger --- v12 -> v13: - update for 4.1-rc0 headers v10 -> v11: - only includes header modifications related to vfio platform driver v14 and not those related to "vfio: type1: support for ARM SMMUS wi

[Qemu-devel] [PATCH v13 05/12] hw/arm/sysbus-fdt: enable vfio-calxeda-xgmac dynamic instantiation

2015-04-28 Thread Eric Auger
This patch allows the instantiation of the vfio-calxeda-xgmac device from the QEMU command line (-device vfio-calxeda-xgmac,host=""). A specialized device tree node is created for the guest, containing compat, dma-coherent, reg and interrupts properties. Signed-off-by: Eric Auger --- v12 -> v13

[Qemu-devel] [PATCH v13 04/12] hw/vfio/platform: calxeda xgmac device

2015-04-28 Thread Eric Auger
The platform device class has become abstract. This patch introduces a calxeda xgmac device that derives from it. Signed-off-by: Eric Auger Reviewed-by: Alex Bennee --- v10 -> v11: - add Alex Reviewed-by - move virt modifications in a separate patch v8 -> v9: - renamed calxeda_xgmac.c into calx

[Qemu-devel] [PATCH v13 12/12] hw/vfio/platform: add irqfd support

2015-04-28 Thread Eric Auger
This patch aims at optimizing IRQ handling using irqfd framework. Instead of handling the eventfds on user-side they are handled on kernel side using - the KVM irqfd framework, - the VFIO driver virqfd framework. the virtual IRQ completion is trapped at interrupt controller This removes the need

[Qemu-devel] [PATCH v13 03/12] hw/vfio/platform: add irq assignment

2015-04-28 Thread Eric Auger
This patch adds the code requested to assign interrupts to a guest. The interrupts are mediated through user handled eventfds only. Signed-off-by: Eric Auger --- v12 -> v13: - start user-side eventfd handling at realize time - remove start_irq_fn v10 -> v11: - use block declaration when possibl

[Qemu-devel] [PATCH v13 11/12] sysbus: add irq_set_hook

2015-04-28 Thread Eric Auger
Add a new callback in the SysBusDeviceClass. This callback now can be overriden by devices inheriting from sysbus. By default the callback is set to the dummy object_property_allow_set_link callback. Signed-off-by: Eric Auger --- v1 -> v2: - use new LinkPropertySetter type --- hw/core/sysbus.c

[Qemu-devel] [PATCH v13 09/12] qdev: pass the check callback to qdev_init_gpio_out_named

2015-04-28 Thread Eric Auger
qdev_init_gpio_out_named takes a new argument corresponding to the check callback passed to object_property_add_link. In qdev_init_gpio_out and sysbus_init_irq, this callback is currently set to the dummy object_property_allow_set_link. This will allow qdev_init_gpio_out_named callers to specializ

[Qemu-devel] [PATCH v13 06/12] kvm: rename kvm_irqchip_[add, remove]_irqfd_notifier with gsi suffix

2015-04-28 Thread Eric Auger
Anticipating for the introduction of new add/remove functions taking a qemu_irq parameter, let's rename existing ones with a gsi suffix. Signed-off-by: Eric Auger --- hw/s390x/virtio-ccw.c | 8 hw/vfio/pci.c | 6 +++--- hw/virtio/virtio-pci.c | 4 ++-- include/sysemu/kvm.h |

[Qemu-devel] [PATCH v13 07/12] kvm-all.c: add qemu_irq/gsi hash table and utility routines

2015-04-28 Thread Eric Auger
VFIO platform device needs to setup irqfd but it does not know the gsi corresponding to the device qemu_irq. This series proposes to store a hash table in kvm_state using the qemu_irq as key and the gsi as a value. kvm_irqchip_set_qemuirq_gsi allows to insert such a pair. The interrupt controller

[Qemu-devel] [PATCH v13 10/12] qdev: check callback takes the property child as third argument

2015-04-28 Thread Eric Auger
Check callback now takes as third argument an Object * const*. In object_set_link_property, we pass the property child as argument. We also assign the *child before the check call so that enhanced check can be performed in the callback. In case the check fails, the old value is restored and ref cou

[Qemu-devel] [PATCH v13 08/12] intc: arm_gic_kvm: set the qemu_irq/gsi mapping

2015-04-28 Thread Eric Auger
The arm_gic_kvm now calls kvm_irqchip_set_qemuirq_gsi to build the hash table storing qemu_irq/gsi mappings. From that point on irqfd can be setup directly from the qemu_irq using kvm_irqchip_add_irqfd_notifier. Signed-off-by: Eric Auger --- v2 -> v3: - kvm_irqchip_add_qemuirq_irqfd_notifier re

Re: [Qemu-devel] [Qemu-block] [PULL 76/76] block: move I/O request processing to block/io.c

2015-04-28 Thread Eric Blake
On 04/28/2015 09:00 AM, Kevin Wolf wrote: > From: Stefan Hajnoczi > > The block.c file has grown to over 6000 lines. It is time to split this > file so there are fewer conflicts and the code is easier to maintain. > > Extract I/O request processing code: > * Read > * Write > * Zero writes an

Re: [Qemu-devel] [PATCH v6 32/36] qapi: Drop tests for inline nested structs

2015-04-28 Thread Eric Blake
On 04/28/2015 07:00 AM, Markus Armbruster wrote: > Eric Blake writes: > >> A future patch will be using a 'name':{dictionary} entry in the >> QAPI schema to specify a default value for an optional argument; >> but existing use of inline nested structs conflicts with that goal. >> >> +++ b/tests/

Re: [Qemu-devel] [PATCH v6 16/36] qapi: Use 'alternate' to replace anonymous union

2015-04-28 Thread Eric Blake
On 04/28/2015 02:41 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Previous patches have led up to the point where I create the >> new meta-type "'alternate':'Foo'". See the previous patches >> for documentation; I intentionally split as much work into >> earlier patches to minimize the

Re: [Qemu-devel] [RFC 00/10] MultiThread TCG.

2015-04-28 Thread Emilio G. Cota
On Tue, Apr 28, 2015 at 11:06:37 +0200, Paolo Bonzini wrote: > On 27/04/2015 19:06, Emilio G. Cota wrote: > > Note that I'm running with -smp 1. My guess is that the iothread > > is starved, since patch 472f4003 "Drop global lock during TCG code > > execution" > > removes from the iothread the abi

Re: [Qemu-devel] [PATCH v6 00/36] drop qapi nested structs

2015-04-28 Thread Eric Blake
On 04/28/2015 08:02 AM, Markus Armbruster wrote: >> v6 changes are noted in each patch; in particular, several new >> patches were added (additional tests, split some patches, conversion >> to 'struct' instead of 'type'). But most of the changes were in >> direct response to review comments or reb

[Qemu-devel] [PULL 0/3] VFIO fixes + AMD GPU reset workaround

2015-04-28 Thread Alex Williamson
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: git://github.com/awilliam/qemu-vfio.git tags/vfio-update-20150

[Qemu-devel] [PULL 1/3] vfio-pci: Further fix BAR size overflow

2015-04-28 Thread Alex Williamson
In an analysis by Laszlo, the resulting type of our calculation for the end of the MSI-X table, and thus the start of memory after the table, is uint32_t. We're therefore not correctly preventing the corner case overflow that we intended to fix here where a BAR >=4G could place the MSI-X table to

[Qemu-devel] [PULL 2/3] vfio-pci: Fix error path sign

2015-04-28 Thread Alex Williamson
This is an impossible error path due to the fact that we're reading a kernel provided, rather than user provided link, which will certainly always fit in PATH_MAX. Currently it returns a fixed 26 char path plus %d group number, which typically maxes out at double digits. However, the caller of the

<    1   2   3   4   >