[Qemu-block] [PATCH for-2.10 3/4] block-backend: Defer shared_perm tightening migration completion

2017-08-14 Thread Fam Zheng
As in the case of nbd_export_new(), bdrv_invalidate_cache() can be called when migration is still in progress. In this case we are not ready to tighten the shared permissions fenced by blk->disable_perm. Defer to a VM state change handler. Signed-off-by: Fam Zheng ---

[Qemu-block] [PATCH for-2.10 4/4] iotests: Add non-shared storage migration case 192

2017-08-14 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/192 | 63 ++ tests/qemu-iotests/192.out | 7 ++ tests/qemu-iotests/group | 1 + 3 files changed, 71 insertions(+) create mode 100755 tests/qemu-iotests/192 create mode

[Qemu-block] [PATCH for-2.10 2/4] nbd: Fix order of bdrv_set_perm and bdrv_invalidate_cache

2017-08-14 Thread Fam Zheng
From: Kevin Wolf The "inactive" state of BDS affects whether the permissions can be granted, we must call bdrv_invalidate_cache before bdrv_set_perm to support "-incoming defer" case. Reported-by: Christian Ehrhardt Signed-off-by: Fam Zheng

[Qemu-block] [PATCH for-2.10 0/4] block: Fix non-shared storage migration

2017-08-14 Thread Fam Zheng
"nbd-server-add -w" doesn't work when we are in "-incoming defer" state: (qemu) nbd_server_add -w drive-virtio-disk0 Block node is read-only Two problems are faced: - nbd_export_new() calls bdrv_invalidate_cache() too late. - bdrv_invalidate_cache() restores qdev permission (which

[Qemu-block] [PATCH for-2.10 1/4] stubs: Add vm state change handler stubs

2017-08-14 Thread Fam Zheng
Signed-off-by: Fam Zheng --- stubs/Makefile.objs | 1 + stubs/change-state-handler.c | 14 ++ 2 files changed, 15 insertions(+) create mode 100644 stubs/change-state-handler.c diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index

[Qemu-block] [RFC v4 08/13] ide: enumerate_slots implementation

2017-08-14 Thread Eduardo Habkost
Example output when using "-machine q35": { "available": true, "count": 1, "device-types": [ "ide-device" ], "hotpluggable": false, "opts": [ { "option": "unit", "values": 0 }, { "option": "bus", "values": "ide.2" } ], "opts-complete": true }

[Qemu-block] [PATCH for-2.10 v2] nbd-client: Fix regression when server sends garbage

2017-08-14 Thread Eric Blake
When we switched NBD to use coroutines for qemu 2.9 (in particular, commit a12a712a), we introduced a regression: if a server sends us garbage (such as a corrupted magic number), we quit the read loop but do not stop sending further queued commands, resulting in the client hanging when it never

Re: [Qemu-block] [PATCH v2 for 2.10] block/nbd-client: always return EIO on and after the first io channel error

2017-08-14 Thread Eric Blake
On 08/14/2017 02:39 AM, Vladimir Sementsov-Ogievskiy wrote: > 12.08.2017 01:28, Eric Blake wrote: >> On 08/08/2017 10:26 AM, Vladimir Sementsov-Ogievskiy wrote: >> >> Initial review, I'm still playing with this one, and will reply again on >> Monday. >> >>> Do not communicate after the first error

Re: [Qemu-block] [Qemu-devel] [PATCH v4 3/3] qemu-img check: add format allocation info

2017-08-14 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > qapi/block-core.json | 6 +- > qemu-img.c | 42 ++ > 2 files changed, 47 insertions(+), 1

Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/3] block: add bdrv_get_format_alloc_stat format interface

2017-08-14 Thread Markus Armbruster
Cc: Eric Blake for additional schema review expertise. Vladimir Sementsov-Ogievskiy writes: > The function should collect statistics, about used/unused by top-level > format driver space (in its .file) and allocation status > (data/zero/discarded/after-eof) of

Re: [Qemu-block] [Qemu-devel] migration issue with qemu 2.10-rc2: QEMU command 'nbd-server-add': Block node is read-only

2017-08-14 Thread Fam Zheng
On Fri, 08/11 18:48, Kevin Wolf wrote: > The patch below implements what I was thinking of, and it seems to fix > this problem. However, you'll immediately run into the next one, which > is a message like 'Conflicts with use by ide0-hd0 as 'root', which does > not allow 'write' on #block172'. > >

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-14 Thread Manos Pitsidianakis
On Wed, Aug 09, 2017 at 05:39:42PM +0200, Kevin Wolf wrote: Am 09.08.2017 um 16:45 hat Alberto Garcia geschrieben: On Wed 09 Aug 2017 03:42:07 PM CEST, Manos Pitsidianakis wrote: > On Wed, Aug 09, 2017 at 02:36:20PM +0200, Alberto Garcia wrote: >>On Wed 09 Aug 2017 11:36:12 AM CEST, Manos

Re: [Qemu-block] [PATCH v7 07/16] block/dirty-bitmap: add bdrv_dirty_bitmap_release_successor

2017-08-14 Thread Vladimir Sementsov-Ogievskiy
10.07.2017 19:30, Vladimir Sementsov-Ogievskiy wrote: To just release successor and unfreeze bitmap without any additional work. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev --- block/dirty-bitmap.c | 13

Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/5] qapi: Add qobject_is_equal()

2017-08-14 Thread Markus Armbruster
Max Reitz writes: > On 2017-07-11 13:33, Markus Armbruster wrote: >> Max Reitz writes: >> >>> First of all, OK, you don't want QNum(42.0) to equal QNum(42) at all (at >>> least not right now and in the foreseeable future). >>> You're the maintainer, so you

Re: [Qemu-block] [PATCH v2 for 2.10] block/nbd-client: always return EIO on and after the first io channel error

2017-08-14 Thread Vladimir Sementsov-Ogievskiy
12.08.2017 01:28, Eric Blake wrote: On 08/08/2017 10:26 AM, Vladimir Sementsov-Ogievskiy wrote: Initial review, I'm still playing with this one, and will reply again on Monday. Do not communicate after the first error to avoid communicating throught s/throught/through a/ broken channel.