[Qemu-devel] [PATCH V2 3/3] qemu-iotests: Add 088 new test for drive-mirror-replace.

2014-03-11 Thread Benoît Canet
Tests for drive-mirror-replace whose purpose is to enable quorum file mirroring and replacement after failure. Signed-off-by: Benoit Canet ben...@irqsave.net --- tests/qemu-iotests/041| 34 +-- tests/qemu-iotests/088| 221 ++

[Qemu-devel] [PATCH V2 0/3] Quorum maintainance operations

2014-03-11 Thread Benoît Canet
/switch/switches/ s/replace/replaces/ Benoît Canet (3): quorum: Add the rewrite-corrupted parameter to quorum. block: Add drive-mirror-replace command to repair quorum files. qemu-iotests: Add 088 new test for drive-mirror-replace. block.c | 8 +- block/mirror.c

[Qemu-devel] [PATCH V2 2/3] block: Add drive-mirror-replace command to repair quorum files.

2014-03-11 Thread Benoît Canet
When a quorum file is totally destroyed (broken NAS or SAN) the user can start a drive-mirror job on the quorum block backend and then replace the broken quorum file with drive-mirror-replace given it has a node-name. Signed-off-by: Benoit Canet ben...@irqsave.net --- block.c |

Re: [Qemu-devel] [PATCH v16 00/14] Drop in_use from BlockDriverState and enable point-in-time snapshot exporting over NBD

2014-03-10 Thread Benoît Canet
The Monday 10 Mar 2014 à 14:38:12 (+0800), Fam Zheng wrote : On Mon, 03/10 06:13, Benoît Canet wrote: The Friday 07 Mar 2014 à 16:20:42 (+0800), Fam Zheng wrote : This series adds for point-in-time snapshot NBD exporting based on blockdev-backup (variant of drive-backup with existing

Re: [Qemu-devel] [PATCH] Rewrite block filter snapshot authorization mechanism

2014-03-10 Thread Benoît Canet
The Monday 03 Mar 2014 à 19:11:33 (+0100), Benoît Canet wrote : Rewrite the snapshot authorization mechanism for block filter as suggested by Paolo. run testsuite and Tested BlockBackend snapshots Tested quorum snapshot Tested that snapshot below or above the active qcow2 file

Re: [Qemu-devel] [PATCH v2 3/5] block/raw-posix: bdrv_parse_filename() for cdrom

2014-03-09 Thread Benoît Canet
The Saturday 08 Mar 2014 à 00:39:43 (+0100), Max Reitz wrote : The host_cdrom protocol drivers should strip the host_cdrom: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-posix.c | 15 +++ 1 file changed, 15 insertions(+) diff

Re: [Qemu-devel] [PATCH v2 03/12] block: Add has_single_child field for drivers

2014-03-09 Thread Benoît Canet
The Friday 07 Mar 2014 à 23:55:47 (+0100), Max Reitz wrote : This field should be used by block drivers acting as filters which have only a single child BDS which is referenced through the file field of the BDS. Setting this field allows other block functions to access the child BDS, for

Re: [Qemu-devel] [PATCH v2 04/12] block/json: Add JSON protocol driver

2014-03-09 Thread Benoît Canet
The Friday 07 Mar 2014 à 23:55:48 (+0100), Max Reitz wrote : Add a JSON protocol driver which allows supplying block driver options through the filename rather than separately. Other than that, it is a pure passthrough driver which identifies itself as a filter. This patch implements the

Re: [Qemu-devel] [PATCH v2 06/12] block/json: Add functions for writing zeroes etc.

2014-03-09 Thread Benoît Canet
The Friday 07 Mar 2014 à 23:55:50 (+0100), Max Reitz wrote : Add passthrough functions for bdrv_aio_discard(), bdrv_co_write_zeroes(), bdrv_truncate() and bdrv_has_zero_init(). Signed-off-by: Max Reitz mre...@redhat.com --- block/json.c | 30 ++ 1 file changed,

Re: [Qemu-devel] [PATCH v2 11/12] block/qapi: Ignore filters on top for format name

2014-03-09 Thread Benoît Canet
The Friday 07 Mar 2014 à 23:55:55 (+0100), Max Reitz wrote : bdrv_query_image_info() currently deduces the image filename and the format name from the top BDS. However, it is probably more reasonable to ignore as many filters as possible on top of the BDS chain since those neither change the

Re: [Qemu-devel] [PATCH v2 02/12] check-qdict: Add test for qdict_join()

2014-03-09 Thread Benoît Canet
The Friday 07 Mar 2014 à 23:55:46 (+0100), Max Reitz wrote : Add some test cases for qdict_join(). Signed-off-by: Max Reitz mre...@redhat.com --- tests/check-qdict.c | 87 + 1 file changed, 87 insertions(+) diff --git

Re: [Qemu-devel] [PATCH v16 00/14] Drop in_use from BlockDriverState and enable point-in-time snapshot exporting over NBD

2014-03-09 Thread Benoît Canet
The Friday 07 Mar 2014 à 16:20:42 (+0800), Fam Zheng wrote : This series adds for point-in-time snapshot NBD exporting based on blockdev-backup (variant of drive-backup with existing device as target). We get a thin point-in-time snapshot by COW mechanism of drive-backup, and export it

Re: [Qemu-devel] [PATCH 1/2] block: Add node-name and to-replace-node-name arguments to drive-mirror.

2014-03-07 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 13:54:44 (-0700), Eric Blake wrote : On 03/05/2014 08:18 AM, Benoît Canet wrote: node-name give a name to the created BDS and register it in the node graph. s/give/gives/ s/register/registers/ to-replace-node-name can be used when drive-mirror is called

Re: [Qemu-devel] [PATCH 1/5] block: Keep filename option after parsing

2014-03-06 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 22:41:36 (+0100), Max Reitz wrote : Currently, bdrv_file_open() always removes the filename option from the options QDict after bdrv_parse_filename() has been (successfully) called. However, for drivers with bdrv_needs_filename, it makes more sense for

Re: [Qemu-devel] [PATCH 2/5] block/raw-posix: Implement bdrv_parse_filename()

2014-03-06 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 22:41:37 (+0100), Max Reitz wrote : The file protocol driver should strip the file: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-posix.c | 12 1 file changed, 12 insertions(+) diff --git

Re: [Qemu-devel] [PATCH 3/5] block/raw-posix: Strip file: prefix on creation

2014-03-06 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 22:41:38 (+0100), Max Reitz wrote : The bdrv_create() implementation of the block/raw-posix file protocol driver should strip the file: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-posix.c | 2 ++ 1 file changed, 2

Re: [Qemu-devel] [PATCH 4/5] block/raw-win32: Implement bdrv_parse_filename()

2014-03-06 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 22:41:39 (+0100), Max Reitz wrote : The file protocol driver should strip the file: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-win32.c | 12 1 file changed, 12 insertions(+) diff --git

Re: [Qemu-devel] [PATCH 5/5] block/raw-win32: Strip file: prefix on creation

2014-03-06 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 22:41:40 (+0100), Max Reitz wrote : The bdrv_create() implementation of the block/raw-win32 file protocol driver should strip the file: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-win32.c | 2 ++ 1 file changed, 2

Re: [Qemu-devel] [PATCH 0/5] block/raw: Strip file: prefix from filenames

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 13:57:55 (+0100), Kevin Wolf wrote : Am 05.03.2014 um 22:41 hat Max Reitz geschrieben: The file protocol drivers (block/raw-posix and block/raw-win32) may be explicitly selected by prepending a file: prefix to a filename (as with all other block protocols).

[Qemu-devel] [PATCH V2 for 2.0 1/2] block: Add node-name and to-replace-node-name arguments to drive-mirror.

2014-03-06 Thread Benoît Canet
node-name gives a name to the created BDS and registers it in the node graph. to-replace-node-name can be used when drive-mirror is called with sync=full. The purpose of these fields is to be able to reconstruct and replace a broken quorum file. drive-mirror will bdrv_swap the new BDS named

[Qemu-devel] [PATCH V2 for 2.0 2/2] qemu-iotests: Add TestRepairQuorum to 041 to test drive-mirror node-name mode.

2014-03-06 Thread Benoît Canet
The the to-replace-node-name is designed to allow repairing of broken Quorum file. This patch introduce a new class TestRepairQuorum testing that the feature works. Some further work will be done on QEMU to improve the robutness of the tests. Signed-off-by: Benoit Canet ben...@irqsave.net ---

[Qemu-devel] [PATCH V2 for 2.0 0/2] Allow to repair broken quorum files

2014-03-06 Thread Benoît Canet
with the mirror. The obvious first usage is Quorum: with this patch one quand drive-mirror the block device say quorum0 and then bdrv_swap the result in place of a broken quorum file (dead filer for example). The second patch implement drive-mirror tests for this mode. Benoît Canet (2): block: Add node-name

Re: [Qemu-devel] [PATCH] block: qemu-iotests 085 - live snapshots tests

2014-03-06 Thread Benoît Canet
The Friday 28 Feb 2014 à 21:08:11 (-0500), Jeff Cody wrote : This adds tests for live snapshots, both through the single snapshot command, and the transaction group snapshot command. The snapshots are done through the QMP interface, using the following commands for snapshots: Single

Re: [Qemu-devel] [PATCH] block: Fix error path segfault in bdrv_open()

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 16:42:12 (+0100), Kevin Wolf wrote : Using an invalid option for a block device that is opened with BDRV_O_PROTOCOL led to drv = NULL, and when trying to include the driver name in the error message, qemu dereferenced it: $ x86_64-softmmu/qemu-system-x86_64

Re: [Qemu-devel] [PATCH 1/3] blockdev: Fail blockdev-add with encrypted images

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 16:44:27 (+0100), Kevin Wolf wrote : Encrypted images need a password before they can be used, and we don't want blockdev-add to create BDSes that aren't fully initialised. So for now simply forbid encrypted images; we can come back to it later if we need the

Re: [Qemu-devel] [PATCH 2/3] blockdev: Fix NULL pointer dereference in blockdev-add

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 16:44:28 (+0100), Kevin Wolf wrote : If aio=native, we check that cache.direct is set as well. If however cache wasn't specified at all, qemu just segfaulted. The old condition didn't make any sense anyway because it effectively only checked for the default cache

Re: [Qemu-devel] [PATCH V2 for 2.0 2/2] qemu-iotests: Add TestRepairQuorum to 041 to test drive-mirror node-name mode.

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 15:06:22 (+0100), Benoît Canet wrote : The the to-replace-node-name is designed to allow repairing of broken Quorum file. This patch introduce a new class TestRepairQuorum testing that the feature works. Some further work will be done on QEMU to improve

Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: Test a few blockdev-add error cases

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 16:44:29 (+0100), Kevin Wolf wrote : Signed-off-by: Kevin Wolf kw...@redhat.com --- tests/qemu-iotests/087 | 122 + tests/qemu-iotests/087.out | 40 +++ tests/qemu-iotests/group | 1 + 3 files

Re: [Qemu-devel] [PATCH 3/5] block/raw-posix: bdrv_parse_filename() for cdrom

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 23:25:37 (+0100), Max Reitz wrote : The host_cdrom protocol drivers should strip the host_cdrom: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-posix.c | 20 1 file changed, 20 insertions(+)

Re: [Qemu-devel] [PATCH 1/5] block/raw-posix: bdrv_parse_filename() for hdev

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 23:25:35 (+0100), Max Reitz wrote : The host_device protocol driver should strip the host_device: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-posix.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

Re: [Qemu-devel] [PATCH 2/5] block/raw-posix: bdrv_parse_filename() for floppy

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 23:25:36 (+0100), Max Reitz wrote : The host_floppy protocol driver should strip the host_floppy: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-posix.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

Re: [Qemu-devel] [PATCH 4/5] block/raw-posix: Strip protocol prefix on creation

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 23:25:38 (+0100), Max Reitz wrote : The hdev_create() implementation in block/raw-posix.c is used by the host_device, host_cdrom and host_floppy protocol block drivers together. Thus, it any of the associated prefixes may occur and exactly one should be stripped, if

Re: [Qemu-devel] [PATCH 5/5] block/raw-win32: bdrv_parse_filename() for hdev

2014-03-06 Thread Benoît Canet
The Thursday 06 Mar 2014 à 23:27:41 (+0100), Max Reitz wrote : The host_device protocol driver should strip the host_device: prefix from filenames if present. Signed-off-by: Max Reitz mre...@redhat.com --- block/raw-win32.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[Qemu-devel] [PATCH 0/2] Allow to repair broken quorum files

2014-03-05 Thread Benoît Canet
for example). The second patch implement drive-mirror tests for this mode. Benoît Canet (2): block: Add node-name and to-replace-node-name arguments to drive-mirror. qemu-iotests: Add TestRepairQuorum to 041 to test drive-mirror node-name mode. block/mirror.c | 39

[Qemu-devel] [PATCH 1/2] block: Add node-name and to-replace-node-name arguments to drive-mirror.

2014-03-05 Thread Benoît Canet
node-name give a name to the created BDS and register it in the node graph. to-replace-node-name can be used when drive-mirror is called with sync=full. The purpose of these fields is to be able to reconstruct and replace a broken quorum file. drive-mirror will bdrv_swap the new BDS named

[Qemu-devel] [PATCH 2/2] qemu-iotests: Add TestRepairQuorum to 041 to test drive-mirror node-name mode.

2014-03-05 Thread Benoît Canet
The the to-replace-node-name is designed to allow repairing of broken Quorum file. This patch introduce a new class TestRepairQuorum testing that the feature works. Some further work will be done on QEMU to improve the robutness of the tests. Signed-off-by: Benoit Canet ben...@irqsave.net ---

Re: [Qemu-devel] [PATCH 1/2] iscsi: Use bs-sg for everything else than disks

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 16:00:48 (+0100), Kevin Wolf wrote : The current iscsi block driver code makes the rather arbitrary decision that TYPE_MEDIUM_CHANGER and TYPE_TAPE devices have bs-sg = 1 and all other device types are disks. Instead of this, check for TYPE_DISK to expose the disk

Re: [Qemu-devel] [PATCH 2/2] block: Fix bs-request_alignment assertion for bs-sg=1

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 16:00:49 (+0100), Kevin Wolf wrote : For sg backends, bs-request_alignment is meaningless and may be 0. Signed-off-by: Kevin Wolf kw...@redhat.com --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index

Re: [Qemu-devel] [PATCH 1/2] iscsi: Use bs-sg for everything else than disks

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 16:41:20 (+0100), Kevin Wolf wrote : Am 05.03.2014 um 16:33 hat Benoît Canet geschrieben: The Wednesday 05 Mar 2014 à 16:00:48 (+0100), Kevin Wolf wrote : The current iscsi block driver code makes the rather arbitrary decision that TYPE_MEDIUM_CHANGER

Re: [Qemu-devel] [PATCH 01/10] qdict: Add qdict_join()

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:44 (+0100), Max Reitz wrote : This function joins two QDicts by absorbing one into the other. Signed-off-by: Max Reitz mre...@redhat.com --- include/qapi/qmp/qdict.h | 3 +++ qobject/qdict.c | 32 2 files changed,

Re: [Qemu-devel] [PATCH 02/10] block/json: Add JSON protocol driver

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:45 (+0100), Max Reitz wrote : Add a JSON protocol driver which allows supplying block driver options through the filename rather than separately. Other than that, it is a pure passthrough driver which identifies itself as a filter. This patch implements the

Re: [Qemu-devel] [PATCH 01/10] qdict: Add qdict_join()

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 17:01:43 (+0100), Kevin Wolf wrote : Am 05.03.2014 um 16:55 hat Benoît Canet geschrieben: The Monday 03 Mar 2014 à 16:28:44 (+0100), Max Reitz wrote : This function joins two QDicts by absorbing one into the other. Signed-off-by: Max Reitz mre...@redhat.com

Re: [Qemu-devel] [PATCH 03/10] block/json: Add functions for cache control

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:46 (+0100), Max Reitz wrote : Add passthrough functions for bdrv_aio_flush() and bdrv_invalidate_cache(). Signed-off-by: Max Reitz mre...@redhat.com --- block/json.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/block/json.c

Re: [Qemu-devel] [PATCH 04/10] block/json: Add functions for writing zeroes etc.

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:47 (+0100), Max Reitz wrote : Add passthrough functions for bdrv_aio_discard(), bdrv_co_write_zeroes(), bdrv_truncate() and bdrv_has_zero_init(). Signed-off-by: Max Reitz mre...@redhat.com --- block/json.c | 30 ++ 1 file changed,

Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status()

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:48 (+0100), Max Reitz wrote : Implement this function in the same way as raw_bsd does: Acknowledge that this is a passthrough driver (always return BDRV_BLOCK_OFFSET_VALID and BDRV_BLOCK_DATA and derive the offset directly from the sector index) and add

Re: [Qemu-devel] [PATCH 06/10] block/json: Add ioctl etc.

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:49 (+0100), Max Reitz wrote : Add passthrough functions for bdrv_aio_ioctl(), bdrv_is_inserted(), bdrv_media_changed(), bdrv_eject(), bdrv_lock_medium() and bdrv_ioctl(). Signed-off-by: Max Reitz mre...@redhat.com --- block/json.c | 40

Re: [Qemu-devel] [PATCH 08/10] block/raw_bsd: Add bdrv_get_specific_info()

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:51 (+0100), Max Reitz wrote : Add a passthrough function for bdrv_get_specific_info(). Signed-off-by: Max Reitz mre...@redhat.com --- block/raw_bsd.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/raw_bsd.c b/block/raw_bsd.c index

Re: [Qemu-devel] [PATCH 09/10] block/qapi: Ignore filters on top for format name

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:52 (+0100), Max Reitz wrote : bdrv_query_image_info() currently deduces the image filename and the format name from the top BDS. However, it is probably more reasonable to ignore as many filters as possible on top of the BDS chain since those neither change the

Re: [Qemu-devel] [PATCH 07/10] block/json: Add bdrv_get_specific_info()

2014-03-05 Thread Benoît Canet
The Monday 03 Mar 2014 à 16:28:50 (+0100), Max Reitz wrote : Add a passthrough function for bdrv_get_specific_info(). Signed-off-by: Max Reitz mre...@redhat.com --- block/json.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/json.c b/block/json.c index ce718e8..6aa0544

Re: [Qemu-devel] [PATCH 02/10] block/json: Add JSON protocol driver

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 20:58:12 (+0100), Max Reitz wrote : On 05.03.2014 17:04, Benoît Canet wrote: The Monday 03 Mar 2014 à 16:28:45 (+0100), Max Reitz wrote : Add a JSON protocol driver which allows supplying block driver options through the filename rather than separately. Other than

Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status()

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 21:10:03 (+0100), Max Reitz wrote : On 05.03.2014 17:11, Benoît Canet wrote: The Monday 03 Mar 2014 à 16:28:48 (+0100), Max Reitz wrote : Implement this function in the same way as raw_bsd does: Acknowledge that this is a passthrough driver (always return

Re: [Qemu-devel] [PATCH 1/2] block: Add node-name and to-replace-node-name arguments to drive-mirror.

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 13:54:44 (-0700), Eric Blake wrote : On 03/05/2014 08:18 AM, Benoît Canet wrote: node-name give a name to the created BDS and register it in the node graph. s/give/gives/ s/register/registers/ to-replace-node-name can be used when drive-mirror is called

Re: [Qemu-devel] [PATCH 02/10] block/json: Add JSON protocol driver

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 21:21:46 (+0100), Max Reitz wrote : On 05.03.2014 21:20, Benoît Canet wrote: The Wednesday 05 Mar 2014 à 20:58:12 (+0100), Max Reitz wrote : On 05.03.2014 17:04, Benoît Canet wrote: The Monday 03 Mar 2014 à 16:28:45 (+0100), Max Reitz wrote : Add a JSON protocol

Re: [Qemu-devel] [PATCH 1/2] block: Add node-name and to-replace-node-name arguments to drive-mirror.

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 22:13:13 (+0100), Benoît Canet wrote : The Wednesday 05 Mar 2014 à 13:54:44 (-0700), Eric Blake wrote : On 03/05/2014 08:18 AM, Benoît Canet wrote: node-name give a name to the created BDS and register it in the node graph. s/give/gives/ s/register

Re: [Qemu-devel] [QEMU 2.0 Fix] block: make bdrv_swap rebuild the bs graph node list field.

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 23:22:30 (+0100), Max Reitz wrote : On 04.03.2014 17:42, Benoît Canet wrote: Moving only the node_name one field could lead to some inconsitencies where a node_name was defined on a bs which was not registered in the graph node list. bdrv_swap between a named

[Qemu-devel] [QEMU 2.0 FIX V2] Fix bdrv_swap behavior regarding the node graph

2014-03-05 Thread Benoît Canet
This bug was discovered while working on the quorum file replacement. The patch switch to a more sane behavior discussed with Kevin. Best regards Benoît Benoît Canet (1): block: make bdrv_swap rebuild the bs graph node list field. block.c | 24 +++- 1 file changed, 19

[Qemu-devel] [QEMU 2.0 FIX V2] block: make bdrv_swap rebuild the bs graph node list field.

2014-03-05 Thread Benoît Canet
Moving only the node_name one field could lead to some inconsitencies where a node_name was defined on a bs which was not registered in the graph node list. bdrv_swap between a named node bs and a non named node bs would lead to this. bdrv_make_anon would then crash because it would try to

Re: [Qemu-devel] [PATCH 05/10] block/json: Add bdrv_co_get_block_status()

2014-03-05 Thread Benoît Canet
The Wednesday 05 Mar 2014 à 21:44:57 (+0100), Max Reitz wrote : On 05.03.2014 21:41, Benoît Canet wrote: The Wednesday 05 Mar 2014 à 21:10:03 (+0100), Max Reitz wrote : On 05.03.2014 17:11, Benoît Canet wrote: The Monday 03 Mar 2014 à 16:28:48 (+0100), Max Reitz wrote : Implement

[Qemu-devel] [QEMU 2.0 Fix] Fix bdrv_swap behavior regarding the node graph

2014-03-04 Thread Benoît Canet
This bug was discovered while working on the quorum file replacement. The patch switch to a more sane behavior discussed with Kevin. Best regards Benoît Benoît Canet (1): block: make bdrv_swap rebuild the bs graph node list field. block.c | 24 +++- 1 file changed, 19

[Qemu-devel] [QEMU 2.0 Fix] block: make bdrv_swap rebuild the bs graph node list field.

2014-03-04 Thread Benoît Canet
Moving only the node_name one field could lead to some inconsitencies where a node_name was defined on a bs which was not registered in the graph node list. bdrv_swap between a named node bs and a non named node bs would lead to this. bdrv_make_anon would then crash because it would try to

Re: [Qemu-devel] [PATCH] block: mirror - remove code cruft that has no function

2014-03-04 Thread Benoît Canet
The Tuesday 04 Mar 2014 à 10:35:48 (-0500), Jeff Cody wrote : Originally, this built up the error message with the backing filename, so that errp was set as follows: error_set(errp, QERR_OPEN_FILE_FAILED, backing_filename); However, we now propagate the local_error from the

[Qemu-devel] [PATCH] Rewrite block filter snapshot authorization mechanism

2014-03-03 Thread Benoît Canet
Rewrite the snapshot authorization mechanism for block filter as suggested by Paolo. run testsuite and Tested BlockBackend snapshots Tested quorum snapshot Tested that snapshot below or above the active qcow2 file are not authorized Benoît Canet (1): block: Rewrite the snapshot authorization

[Qemu-devel] [PATCH] block: Rewrite the snapshot authorization mechanism for block filters.

2014-03-03 Thread Benoît Canet
This patch keep the recursive way of doing things but simplify it by giving two responsabilities to all block filters implementors. They will need to do two things: -Set the is_filter field of their block driver to true. -Implement the bdrv_recurse_is_first_non_filter method of their block

Re: [Qemu-devel] [PATCH] block: Rewrite the snapshot authorization mechanism for block filters.

2014-03-03 Thread Benoît Canet
The Monday 03 Mar 2014 à 19:35:13 (+0100), Paolo Bonzini wrote : Il 03/03/2014 19:11, Benoît Canet ha scritto: diff --git a/block/blkverify.c b/block/blkverify.c index b98b08b..e1c3117 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -288,6 +288,20 @@ static BlockDriverAIOCB

Re: [Qemu-devel] [PATCH V2 3/3] qemu-io-test: Disable Quorum test when not compiled in.

2014-02-22 Thread Benoît Canet
The Saturday 22 Feb 2014 à 15:38:15 (+0800), Fam Zheng wrote : On Sat, 02/22 02:20, Benoît Canet wrote: Quorum is not compiled by default: make the quorum 081 test aware of this. Signed-off-by: Benoit Canet ben...@irqsave.net --- tests/qemu-iotests/081 | 3 +++ 1 file changed, 3

[Qemu-devel] [PATCH V3 0/3] Fix some quorum nits after merge

2014-02-22 Thread Benoît Canet
in v3: use $QEMU_IMG (Fam) apply Eric reviewed by in v2: make error optional and return strerror(-ret) [Eric] better documentation of the error string [Eric] apply Eric reviewed by Benoît Canet (3): qmp: Fix BlockdevOptionQuorum. qmp: Make Quorum error events more

[Qemu-devel] [PATCH V3 1/3] qmp: Fix BlockdevOptionQuorum.

2014-02-22 Thread Benoît Canet
Fix some nits before QEMU 2.0 freeze. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Eric Blake ebl...@redhat.com --- qapi-schema.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index fcb22800..ab5cdde 100644 ---

[Qemu-devel] [PATCH V3 3/3] qemu-io-test: Disable Quorum test when not compiled in.

2014-02-22 Thread Benoît Canet
Quorum is not compiled by default: make the quorum 081 test aware of this. Signed-off-by: Benoit Canet ben...@irqsave.net --- tests/qemu-iotests/081 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 index f053f11..b512d00 100755 ---

[Qemu-devel] [PATCH V3 2/3] qmp: Make Quorum error events more palatable.

2014-02-22 Thread Benoît Canet
Insert quorum QMP events documentation alphabetically. Also change the ret errno value by an optional error being an strerror(-ret) in the QUORUM_REPORT_BAD qmp event. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Eric Blake ebl...@redhat.com --- block/quorum.c | 9

Re: [Qemu-devel] [PATCH 1/2] quorum: Simplify quorum_open()

2014-02-21 Thread Benoît Canet
The Friday 21 Feb 2014 à 20:44:07 (+0100), Max Reitz wrote : Although it may not look like it, this patch simplifies quorum_open(). qdict_array_split() is now able to return QLists with different objects than only QDicts, therefore it will now do all the work and quorum_open() does not have to

Re: [Qemu-devel] [PATCH 2/2] iotests: Mixed quorum child device specifications

2014-02-21 Thread Benoît Canet
The Friday 21 Feb 2014 à 20:44:08 (+0100), Max Reitz wrote : Add a test case to test 081 for mixing full option dicts and reference strings of specifying the quorum child block devices through QMP. Signed-off-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/081 | 52

[Qemu-devel] [PATCH V19 01/12] quorum: Create quorum.c, add QuorumChildRequest and QuorumAIOCB.

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net Quorum is a block filter mirroring writes to num_children children. For reads quorum reads each children and does a vote. If more than vote_threshold versions are identical the quorum is reached and this winning version is returned to the guest. So quorum

[Qemu-devel] [PATCH V19 03/12] quorum: Add quorum_aio_writev and its dependencies.

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net Writes are mirrored num_children times on num_children devices. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- block/quorum.c | 103 + 1 file changed, 103

[Qemu-devel] [PATCH V19 10/12] quorum: Implement recursive .bdrv_recurse_is_first_non_filter in quorum.

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net This is used to activate quorum snapshot. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- block/quorum.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/block/quorum.c b/block/quorum.c

[Qemu-devel] [PATCH V19 06/12] quorum: Add quorum mechanism.

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net This patchset enables the core of the quorum mechanism. The num_children reads are compared to get the majority version and if this version exists more than threshold times the guest won't see the error at all. If a block is corrupted or if an error occurs

[Qemu-devel] [PATCH V19 05/12] quorum: Add quorum_aio_readv.

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net Add code to do num_children reads in parallel and cleanup the structures afterwards. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- block/quorum.c | 39 ++- 1 file changed, 38

Re: [Qemu-devel] [PATCH v2 2/2] iotests: Mixed quorum child device specifications

2014-02-21 Thread Benoît Canet
The Friday 21 Feb 2014 à 22:30:38 (+0100), Max Reitz wrote : Add a test case to test 081 for mixing full option dicts and reference strings of specifying the quorum child block devices through QMP. Signed-off-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/081 | 51

[Qemu-devel] [PATCH V19 07/12] quorum: Add quorum_getlength().

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net Check that every bs file returns the same length. Otherwise, return -EIO to disable the quorum and avoid length discrepancy. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- block/quorum.c | 26

[Qemu-devel] [PATCH V19 09/12] quorum: Add quorum_co_flush().

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net Makes a vote to select error if any. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- block/quorum.c | 28 1 file changed, 28 insertions(+) diff --git a/block/quorum.c b/block/quorum.c

[Qemu-devel] [PATCH V19 04/12] blkverify: Extract qemu_iovec_clone() and qemu_iovec_compare() from blkverify.

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net qemu_iovec_compare() will be used to compare IOs vectors in quorum blkverify mode. The patch extracts these functions in order to factorize the code. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- block

[Qemu-devel] [PATCH V19 12/12] quorum: Add unit test.

2014-02-21 Thread Benoît Canet
Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/081 | 95 ++ tests/qemu-iotests/081.out | 34 + tests/qemu-iotests/group | 1 + 3 files changed, 130 insertions(+)

[Qemu-devel] [PATCH V19 00/12] Quorum block filter

2014-02-21 Thread Benoît Canet
quorum QMP by reference ok quorum QMP by reference and snapshot transaction ok quorum QMP at once ok quorum QMP at once and snapshot transaction ok Benoît Canet (12): quorum: Create quorum.c, add QuorumChildRequest and QuorumAIOCB. quorum: Create BDRVQuorumState and BlkDriver and do init

[Qemu-devel] [PATCH V19 11/12] quorum: Add quorum_open() and quorum_close().

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net Example of command line: -drive if=virtio,driver=quorum,\ children.0.file.filename=1.raw,\ children.0.node-name=1.raw,\ children.0.driver=raw,\ children.1.file.filename=2.raw,\ children.1.node-name=2.raw,\ children.1.driver=raw,\ children.2.file.filename=3

[Qemu-devel] [PATCH V19 08/12] quorum: Add quorum_invalidate_cache().

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net We really want that live migration works with quorum so implement quorum_invalidate_cache(). Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- block/quorum.c | 11 +++ 1 file changed, 11 insertions(+) diff

[Qemu-devel] [PATCH V19 02/12] quorum: Create BDRVQuorumState and BlkDriver and do init.

2014-02-21 Thread Benoît Canet
From: Benoît Canet ben...@irqsave.net Create the structure holding the quorum settings and write the minimal block driver instanciation boilerplate. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Max Reitz mre...@redhat.com --- block/quorum.c | 31 +++ 1

Re: [Qemu-devel] [PATCH V19 06/12] quorum: Add quorum mechanism.

2014-02-21 Thread Benoît Canet
The Friday 21 Feb 2014 à 15:44:06 (-0700), Eric Blake wrote : On 02/21/2014 03:38 PM, Kevin Wolf wrote: +- ret: The IO return code. What values is this likely to contain? Is it a finite set, in which case it would be nice to have a QAPI enum that describes the set of return

Re: [Qemu-devel] [PATCH V19 00/12] Quorum block filter

2014-02-21 Thread Benoît Canet
The Friday 21 Feb 2014 à 15:49:15 (-0700), Eric Blake wrote : On 02/21/2014 02:21 PM, Benoît Canet wrote: Hi this is the latest version of the quorum block filter. This version fix the qmp events and a small rebase conflict. tested: tested that json qmp string are correct

Re: [Qemu-devel] [PATCH V19 06/12] quorum: Add quorum mechanism.

2014-02-21 Thread Benoît Canet
The Friday 21 Feb 2014 à 15:09:42 (-0700), Eric Blake wrote : On 02/21/2014 02:21 PM, Benoît Canet wrote: From: Benoît Canet ben...@irqsave.net This patchset enables the core of the quorum mechanism. The num_children reads are compared to get the majority version and if this version

[Qemu-devel] [PATCH 1/3] qmp: Fix BlockdevOptionQuorum.

2014-02-21 Thread Benoît Canet
Fix some nits before QEMU 2.0 freeze. Signed-off-by: Benoit Canet ben...@irqsave.net --- qapi-schema.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index fcb22800..ab5cdde 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@

[Qemu-devel] [PATCH 3/3] qemu-io-test: Disable Quorum test when not compiled in.

2014-02-21 Thread Benoît Canet
Quorum is not compiled by default: make the quorum 081 test aware of this. Signed-off-by: Benoit Canet ben...@irqsave.net --- tests/qemu-iotests/081 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 index f053f11..c1078f6 100755 ---

[Qemu-devel] [PATCH 2/3] qmp: Make Quorum error events more palatable.

2014-02-21 Thread Benoît Canet
Insert quorum QMP events documentation alphabetically. Also change the ret errno value by error being an strerror() in the QUORUM_REPORT_BAD qmp event. Signed-off-by: Benoit Canet ben...@irqsave.net --- block/quorum.c | 5 ++-- docs/qmp/qmp-events.txt| 72

[Qemu-devel] [PATCH 0/3] Fix some quorum nits after merge

2014-02-21 Thread Benoît Canet
Fix qemu-io test to ignore quorum when not compiled in [Kevin] Fix quorum QMP event [Eric] Fix QMP documentation [Eric] Benoît Canet (3): qmp: Fix BlockdevOptionQuorum. qmp: Make Quorum error events more palatable. qemu-io-test: Disable Quorum test when not compiled in. block/quorum.c

[Qemu-devel] [PATCH V2 1/3] qmp: Fix BlockdevOptionQuorum.

2014-02-21 Thread Benoît Canet
Fix some nits before QEMU 2.0 freeze. Signed-off-by: Benoit Canet ben...@irqsave.net Reviewed-by: Eric Blake ebl...@redhat.com --- qapi-schema.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index fcb22800..ab5cdde 100644 ---

[Qemu-devel] [PATCH V2 0/3] Fix some quorum nits after merge

2014-02-21 Thread Benoît Canet
in v2: make error optional and return strerror(-ret) [Eric] better documentation of the error string [Eric] apply Eric reviewed by Benoît Canet (3): qmp: Fix BlockdevOptionQuorum. qmp: Make Quorum error events more palatable. qemu-io-test: Disable Quorum test when not compiled

[Qemu-devel] [PATCH V2 3/3] qemu-io-test: Disable Quorum test when not compiled in.

2014-02-21 Thread Benoît Canet
Quorum is not compiled by default: make the quorum 081 test aware of this. Signed-off-by: Benoit Canet ben...@irqsave.net --- tests/qemu-iotests/081 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 index f053f11..c1078f6 100755 ---

[Qemu-devel] [PATCH V2 2/3] qmp: Make Quorum error events more palatable.

2014-02-21 Thread Benoît Canet
Insert quorum QMP events documentation alphabetically. Also change the ret errno value by an optional error being an strerror(-ret) in the QUORUM_REPORT_BAD qmp event. Signed-off-by: Benoit Canet ben...@irqsave.net --- block/quorum.c | 9 -- docs/qmp/qmp-events.txt| 75

Re: [Qemu-devel] [PATCH V2 2/3] qmp: Make Quorum error events more palatable.

2014-02-21 Thread Benoît Canet
The Friday 21 Feb 2014 à 18:42:01 (-0700), Eric Blake wrote : On 02/21/2014 06:20 PM, Benoît Canet wrote: Insert quorum QMP events documentation alphabetically. Also change the ret errno value by an optional error being an strerror(-ret) in the QUORUM_REPORT_BAD qmp event. Signed

Re: [Qemu-devel] [PATCH v14 05/14] block: Add bdrv_set_backing_hd()

2014-02-19 Thread Benoît Canet
The Wednesday 19 Feb 2014 à 21:42:22 (+0800), Fam Zheng wrote : This is the common but non-trivial steps to assign or change the backing_hd of BDS. Signed-off-by: Fam Zheng f...@redhat.com --- block.c | 34 +++--- include/block/block.h | 1 + 2

Re: [Qemu-devel] [PATCH v14 04/14] block: Move op_blocker check from block_job_create to its caller

2014-02-19 Thread Benoît Canet
The Wednesday 19 Feb 2014 à 21:42:21 (+0800), Fam Zheng wrote : It makes no sense to check for any blocker on bs, we are here only because of the mechanical conversion from in_use to op_blockers. Remove it now, and let the callers check specific operation types. Backup and mirror already have

Re: [Qemu-devel] [PATCH v14 03/14] block: Replace in_use with operation blocker

2014-02-19 Thread Benoît Canet
The Wednesday 19 Feb 2014 à 21:42:20 (+0800), Fam Zheng wrote : This drops BlockDriverState.in_use with op_blockers: - Call bdrv_op_block_all in place of bdrv_set_in_use(bs, 1). - Call bdrv_op_unblock_all in place of bdrv_set_in_use(bs, 0). - Check bdrv_op_is_blocked() in place of

<    3   4   5   6   7   8   9   10   11   12   >