[Qemu-devel] [PATCH v2 21/30] libqtest: Correct small memory leak.

2014-08-04 Thread John Snow
Fixes a small memory leak inside of libqtest. After we produce a test path and glib copies the string for itself, we should clean up our temporary copy. Signed-off-by: John Snow --- tests/libqtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/libqtest.c b/tests/libqtest.c index

[Qemu-devel] [PATCH v2 22/30] libqos: Fixes a small memory leak.

2014-08-04 Thread John Snow
Allow users the chance to clean up the QPCIBusPC structure by adding a small cleanup routine. Helps clear up small memory leaks during setup/teardown, to allow for cleaner debug output messages. Signed-off-by: John Snow --- tests/libqos/pci-pc.c | 7 +++ tests/libqos/pci-pc.h | 1 + 2 files

[Qemu-devel] [PATCH v2 29/30] ahci: Add test_hba_enable to ahci-test.

2014-08-04 Thread John Snow
adherence. Signed-off-by: John Snow --- tests/ahci-test.c | 156 ++ 1 file changed, 156 insertions(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 1c19c9c..f157047 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -277,11 +277,17

[Qemu-devel] [PATCH v2 26/30] ahci: Add test_pci_spec to ahci-test.

2014-08-04 Thread John Snow
Adds a specification adherence test for AHCI where the boot-up values for the PCI configuration space are compared against the AHCI 1.3 specification. This test does not itself attempt to engage the device. Signed-off-by: John Snow --- tests/ahci-test.c | 305

[Qemu-devel] [PATCH v2 25/30] ahci: Adding basic functionality qtest.

2014-08-04 Thread John Snow
. Signed-off-by: John Snow --- tests/Makefile| 2 + tests/ahci-test.c | 196 ++ 2 files changed, 198 insertions(+) create mode 100644 tests/ahci-test.c diff --git a/tests/Makefile b/tests/Makefile index 4b2e1bb..0c61b22 100644 --- a/tests

[Qemu-devel] [PATCH v2 28/30] ahci: Add test_hba_spec to ahci-test.

2014-08-04 Thread John Snow
Add a test routine that checks the boot-up values of the HBA configuration memory space against the AHCI 1.3 specification and Intel ICH9 data sheet (for Q35 machines) for adherence and sane values. The HBA is not yet engaged or put into the idle state. Signed-off-by: John Snow --- tests/ahci

[Qemu-devel] [PATCH v2 23/30] libqos: allow qpci_iomap to return BAR mapping size

2014-08-04 Thread John Snow
This patch allows qpci_iomap to return the size of the BAR mapping that it created, to allow driver applications (e.g, ahci-test) to make determinations about the suitability or the mapping size, or in the specific case of AHCI, how many ports are supported by the HBA. Signed-off-by: John Snow

Re: [Qemu-devel] Are -cdrom/-hda (or -drive if=ide) supposed to work in q35?

2014-08-05 Thread John Snow
On 08/05/2014 04:30 AM, Kevin Wolf wrote: Am 01.08.2014 um 22:10 hat John Snow geschrieben: On 06/12/2014 05:03 AM, Markus Armbruster wrote: -drive mixes up configuration of backend and frontend (a.k.a. device model), as follows: 1. It always defines a backend. "info block"

Re: [Qemu-devel] [PATCH v2 00/30] AHCI test suite framework

2014-08-06 Thread John Snow
On 08/06/2014 07:30 AM, Markus Armbruster wrote: Stefan Hajnoczi writes: On Mon, Aug 04, 2014 at 05:11:01PM -0400, John Snow wrote: This patch series introduces a number of small fixes and tweaks to help support an AHCI test suite that in the future I hope to expand to a fuller regression

Re: [Qemu-devel] [PATCH RFC v2 1/8] qmp: print dirty bitmap

2015-02-10 Thread John Snow
On 01/27/2015 05:56 AM, Vladimir Sementsov-Ogievskiy wrote: Adds qmp and hmp commands to print dirty bitmap. This is needed only for testing. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 33 + blockdev.c| 13 +++

Re: [Qemu-devel] [PATCH RFC v2 3/8] block: BdrvDirtyBitmap serialization interface

2015-02-10 Thread John Snow
, uint64_t count); +void bdrv_dirty_bitmap_deserialize_finish(BdrvDirtyBitmap *bitmap); void bdrv_enable_copy_on_read(BlockDriverState *bs); void bdrv_disable_copy_on_read(BlockDriverState *bs); Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v2 2/8] hbitmap: serialization

2015-02-10 Thread John Snow
1 << (i & (BITS_PER_LONG - 1)); +} +} +} + +bitmap->levels[0][0] |= 1UL << (BITS_PER_LONG - 1); +} + void hbitmap_free(HBitmap *hb) { unsigned i; Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v2 4/8] block: add dirty-dirty bitmaps

2015-02-10 Thread John Snow
I had hoped it wouldn't come to this :) On 01/27/2015 05:56 AM, Vladimir Sementsov-Ogievskiy wrote: A dirty-dirty bitmap is a dirty bitmap for BdrvDirtyBitmap. It tracks set/unset changes of BdrvDirtyBitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 44 +

Re: [Qemu-devel] [PATCH RFC v2 6/8] block: add bdrv_next_dirty_bitmap()

2015-02-10 Thread John Snow
HBitmap *bdrv_create_dirty_dirty_bitmap(BdrvDirtyBitmap *bitmap, uint64_t granularity); Makes sense to me. Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v2 5/8] block: add bdrv_dirty_bitmap_enabled()

2015-02-10 Thread John Snow
which might have /slightly/ different semantics for enabled/disabled bitmaps. I don't think you'll need this patch, but in case you do need it: Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v2 7/8] migration: add dirty parameter

2015-02-10 Thread John Snow
On 01/27/2015 05:56 AM, Vladimir Sementsov-Ogievskiy wrote: Add dirty parameter to qmp-migrate command. If this parameter is true, migration/block.c will migrate dirty bitmaps. This parameter can be used without "blk" parameter to migrate only dirty bitmaps, skipping block migration. Signed-of

Re: [Qemu-devel] [PATCH RFC v2 8/8] migration: add migration/dirty-bitmap.c

2015-02-10 Thread John Snow
Peter Maydell: What's the right way to license a file as copied from a previous version? See below, please; Max, Markus: ctrl+f "bdrv_get_device_name" and let me know what you think, if you would. Juan, Amit, David: Copying migration maintainers. On 01/27/2015 05:56 AM, Vladimir Sementsov-Og

Re: [Qemu-devel] [PATCH v12 03/17] block: Introduce bdrv_dirty_bitmap_granularity()

2015-02-10 Thread John Snow
On 02/10/2015 05:13 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: This returns the granularity (in bytes) of dirty bitmap, which matches the QMP interface and the existing query interface. Small adjustments are made to ensure that granularity-- in bytes-- is handled

Re: [Qemu-devel] [PATCH v12 06/17] block: Add bitmap successors

2015-02-11 Thread John Snow
On 02/11/2015 11:50 AM, Max Reitz wrote: With the full stops and newlines removed (in all error_setg() calls in this patch): Habits, habits, habits.\n Thanks.\n

Re: [Qemu-devel] [PATCH v12 07/17] qmp: Add support of "dirty-bitmap" sync mode for drive-backup

2015-02-11 Thread John Snow
On 02/11/2015 12:47 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: 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 con

Re: [Qemu-devel] [PATCH v12 07/17] qmp: Add support of "dirty-bitmap" sync mode for drive-backup

2015-02-11 Thread John Snow
On 02/11/2015 01:18 PM, Max Reitz wrote: On 2015-02-11 at 12:54, John Snow wrote: On 02/11/2015 12:47 PM, Max Reitz wrote: Looks good to me in general, now I need to find out what the successor bitmap is used for; but I guess I'll find that out by reviewing the rest of this series.

Re: [Qemu-devel] [PATCH v12 08/17] qmp: add block-dirty-bitmap-clear

2015-02-11 Thread John Snow
On 02/11/2015 01:28 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: 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

Re: [Qemu-devel] [PATCH v12 03/17] block: Introduce bdrv_dirty_bitmap_granularity()

2015-02-11 Thread John Snow
On 02/10/2015 05:03 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: This returns the granularity (in bytes) of dirty bitmap, which matches the QMP interface and the existing query interface. Small adjustments are made to ensure that granularity-- in bytes-- I guess these

Re: [Qemu-devel] [PATCH v12 10/17] qmp: Add dirty bitmap status fields in query-block

2015-02-11 Thread John Snow
On 02/11/2015 02:10 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: Adds the "disabled" and "frozen" status booleans. Signed-off-by: Fam Zheng Signed-off-by: John Snow --- block.c | 2 ++ qapi/block-core.json | 7 ++- 2 files changed

Re: [Qemu-devel] [PATCH v12 07/17] qmp: Add support of "dirty-bitmap" sync mode for drive-backup

2015-02-11 Thread John Snow
On 02/11/2015 12:47 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: 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 con

Re: [Qemu-devel] [PATCH v12 14/17] iotests: add simple incremental backup case

2015-02-11 Thread John Snow
On 02/11/2015 04:40 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: Signed-off-by: John Snow --- tests/qemu-iotests/112| 120 +- tests/qemu-iotests/112.out| 4 +- tests/qemu-iotests/iotests.py | 18 --- 3 files

Re: [Qemu-devel] [PATCH v12 16/17] blkdebug: fix "once" rule

2015-02-11 Thread John Snow
On 02/11/2015 04:50 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: Background: The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" o

Re: [Qemu-devel] [PATCH v12 17/17] iotests: add incremental backup failure recovery test

2015-02-11 Thread John Snow
On 02/11/2015 05:01 PM, Max Reitz wrote: On 2015-02-09 at 20:35, John Snow wrote: To test the failure case, we modify iotests.py to allow us to specify that we'd like to allow failures when we wait for block job events. Signed-off-by: John Snow --- tests/qemu-iotests/112

Re: [Qemu-devel] [PATCH RFC v2 5/8] block: add bdrv_dirty_bitmap_enabled()

2015-02-12 Thread John Snow
On 02/12/2015 05:54 AM, Vladimir Sementsov-Ogievskiy wrote: On 11.02.2015 00:30, John Snow wrote: On 01/27/2015 05:56 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 5 + include/block/block.h | 1 + 2 files changed

Re: [Qemu-devel] [PATCH RFC v2 8/8] migration: add migration/dirty-bitmap.c

2015-02-13 Thread John Snow
On 02/13/2015 04:06 AM, Vladimir Sementsov-Ogievskiy wrote: + +blk_mig_reset_dirty_cursor(); +dirty_phase(f, false); + +QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) { +uint8_t flags = DIRTY_BITMAP_MIG_FLAG_DEVICE_NAME | +DIRTY_BI

Re: [Qemu-devel] [PATCH v12 07/17] qmp: Add support of "dirty-bitmap" sync mode for drive-backup

2015-02-13 Thread John Snow
On 02/13/2015 12:33 PM, Vladimir Sementsov-Ogievskiy wrote: On 10.02.2015 04:35, John Snow wrote: .. @@ -278,28 +305,61 @@ static void coroutine_fn backup_run(void *opaque) qemu_coroutine_yield(); job->common.busy = true; } +} else if (

Re: [Qemu-devel] [PATCH RFC v2 8/8] migration: add migration/dirty-bitmap.c

2015-02-13 Thread John Snow
On 02/13/2015 03:19 AM, Vladimir Sementsov-Ogievskiy wrote: On 11.02.2015 00:33, John Snow wrote: Peter Maydell: What's the right way to license a file as copied from a previous version? See below, please; Max, Markus: ctrl+f "bdrv_get_device_name" and let me know what yo

Re: [Qemu-devel] [RFC PATCH 01/14] docs: block replication's description

2015-02-13 Thread John Snow
On 02/13/2015 02:01 AM, Fam Zheng wrote: On Fri, 02/13 13:09, Wen Congyang wrote: What is image fleecing? It's the name of the feature which enables the built-in NBD server to exporting a thin point-in-time snapshot created via drive-backup sync=none. It's for host side data scanning tool

[Qemu-devel] [PATCH v13 00/17] block: incremental backup series

2015-02-13 Thread John Snow
d hmp("c") and added a docstring. - Check for '%' in dirnames. - 16: removed hmp("c"), added a doctsring. - xx Dropped blkdebug patch, was #16. - 17: Removed hmp("c"), added a docstring. - Moved all blkdebug config into QMP, because Max

[Qemu-devel] [PATCH v13 02/17] qmp: Ensure consistent granularity type

2015-02-13 Thread 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 --- block.c | 11 ++- block/mirror.c| 4 ++-- include/block/block.h | 2 +- include/block/block_int.h | 2 +- qapi/

[Qemu-devel] [PATCH v13 04/17] block: Introduce bdrv_dirty_bitmap_granularity()

2015-02-13 Thread John Snow
This returns the granularity (in bytes) of dirty bitmap, which matches the QMP interface and the existing query interface. Small adjustments are made to ensure that granularity (in bytes) is handled consistently as a uint32_t throughout the code. Signed-off-by: John Snow --- block.c

[Qemu-devel] [PATCH v13 06/17] qmp: Add block-dirty-bitmap-enable and block-dirty-bitmap-disable

2015-02-13 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c | 25 + blockdev.c| 40 include/block/block.h | 3 +++ qapi/block-core.json | 28 qmp-commands.hx | 10

[Qemu-devel] [PATCH v13 08/17] qmp: Add support of "dirty-bitmap" sync mode for drive-backup

2015-02-13 Thread 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: Joh

[Qemu-devel] [PATCH v13 05/17] hbitmap: add hbitmap_merge

2015-02-13 Thread John Snow
running speed for particularly sparse bitmaps by using iterators, but the running time for dense maps will be worse. We present the simpler solution first, and we can refine it later if needed. Signed-off-by: John Snow Reviewed-by: Max Reitz --- include/qemu/hbitmap.h | 11 +++ util

[Qemu-devel] [PATCH v13 01/17] qapi: Add optional field "name" to block dirty bitmap

2015-02-13 Thread John Snow
bdrv_find_dirty_bitmap to find a dirty bitmap by name, will be used later when other QMP commands want to reference dirty bitmap by name. Add bdrv_dirty_bitmap_make_anon. This unsets the name of dirty bitmap. Signed-off-by: Fam Zheng Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c

[Qemu-devel] [PATCH v13 12/17] block: add BdrvDirtyBitmap documentation

2015-02-13 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index a7f56f4..c1c11aa 100644 --- a/block.c +++ b/block.c @@ -60,11 +60,11 @@ * or enabled. A frozen bitmap can only abdicate() or

[Qemu-devel] [PATCH v13 11/17] qmp: Add dirty bitmap status fields in query-block

2015-02-13 Thread John Snow
Adds the "disabled" and "frozen" status booleans. Signed-off-by: Fam Zheng Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c | 2 ++ qapi/block-core.json | 7 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c in

[Qemu-devel] [PATCH v13 07/17] block: Add bitmap successors

2015-02-13 Thread John Snow
QMP transactions that enable/disable bitmaps have extra error checking surrounding them that prevent modifying bitmaps that are frozen. Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c | 104 +- blockdev.c|

[Qemu-devel] [PATCH v13 09/17] qmp: add block-dirty-bitmap-clear

2015-02-13 Thread 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 --- block.c | 8 blockdev.c

[Qemu-devel] [PATCH v13 10/17] qapi: Add transaction support to block-dirty-bitmap operations

2015-02-13 Thread John Snow
her a bitmap clear and a full block backup. Signed-off-by: Fam Zheng Signed-off-by: John Snow --- blockdev.c | 170 +++ qapi-schema.json | 10 +++- 2 files changed, 179 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c

[Qemu-devel] [PATCH v13 03/17] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove

2015-02-13 Thread John Snow
o block-core.json will be re-used in future patches in this series, see: 'qapi: Add transaction support to block-dirty-bitmap-{add, enable, disable}' Signed-off-by: John Snow --- block.c | 20 ++ block/mirror.c| 10

[Qemu-devel] [PATCH v13 15/17] iotests: add simple incremental backup case

2015-02-13 Thread John Snow
Signed-off-by: John Snow --- tests/qemu-iotests/112 | 122 + tests/qemu-iotests/112.out | 4 +- 2 files changed, 124 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/112 b/tests/qemu-iotests/112 index 7985cd1..da8f0e0 100644 --- a

[Qemu-devel] [PATCH v13 16/17] iotests: add transactional incremental backup test

2015-02-13 Thread John Snow
Reviewed-by: Max Reitz Signed-off-by: John Snow --- tests/qemu-iotests/112 | 49 ++ tests/qemu-iotests/112.out | 4 ++-- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/112 b/tests/qemu-iotests/112 index da8f0e0

[Qemu-devel] [PATCH v13 13/17] block: Ensure consistent bitmap function prototypes

2015-02-13 Thread 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 --- block.c | 13 ++--- block/backup.c| 2 +- block/mirror.c| 26 ++ block

[Qemu-devel] [PATCH v13 14/17] iotests: add invalid input incremental backup tests

2015-02-13 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/112 | 89 ++ tests/qemu-iotests/112.out | 5 +++ tests/qemu-iotests/group | 1 + 3 files changed, 95 insertions(+) create mode 100644 tests/qemu-iotests/112 create mode

[Qemu-devel] [PATCH v13 17/17] iotests: add incremental backup failure recovery test

2015-02-13 Thread John Snow
To test the failure case, we modify iotests.py to allow us to specify that we'd like to allow failures when we wait for block job events. Signed-off-by: John Snow --- tests/qemu-iotests/112| 57 ++- tests/qemu-iotests/112.out| 4 +--

Re: [Qemu-devel] [PATCH v12 02/17] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove

2015-02-13 Thread John Snow
Missed you by several seconds, I submitted a v13 fixup to cover Max's comments and had wrongly assumed I wouldn't be hearing anything else at 5PM on a Friday :) On 02/13/2015 05:24 PM, Eric Blake wrote: On 02/09/2015 06:35 PM, John Snow wrote: The new command pair is added to m

[Qemu-devel] Enum String Generator

2015-02-13 Thread John Snow
Just a stupid question: We don't have a macro facility in the current codebase that generates both an enum and string table / lookup function simultaneously, do we? Some things really do just wind up looking grossly inelegant in C, and this is one of them. --js

Re: [Qemu-devel] Enum String Generator

2015-02-16 Thread John Snow
On 02/14/2015 09:37 PM, Fam Zheng wrote: On Fri, 02/13 19:33, John Snow wrote: Just a stupid question: We don't have a macro facility in the current codebase that generates both an enum and string table / lookup function simultaneously, do we? Some things really do just wind up lo

Re: [Qemu-devel] [PATCH RFC v2 8/8] migration: add migration/dirty-bitmap.c

2015-02-16 Thread John Snow
On 02/16/2015 07:06 AM, Vladimir Sementsov-Ogievskiy wrote: On 13.02.2015 23:22, John Snow wrote: On 02/13/2015 03:19 AM, Vladimir Sementsov-Ogievskiy wrote: On 11.02.2015 00:33, John Snow wrote: Peter Maydell: What's the right way to license a file as copied from a previous version

Re: [Qemu-devel] [PATCH v13 02/17] qmp: Ensure consistent granularity type

2015-02-16 Thread John Snow
On 02/16/2015 02:49 PM, Max Reitz wrote: On 2015-02-13 at 17:08, John Snow wrote: 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 --- block.c | 11 ++- block/mirror.c

Re: [Qemu-devel] [PATCH 04/13] qemu-img: Suppress unhelpful extra errors in convert, resize

2015-02-16 Thread John Snow
On 02/16/2015 09:44 AM, Markus Armbruster wrote: add_old_style_options() for img_convert() and img_resize() use qemu_opt_set(), which reports errors with qerror_report_err(). Its error messages aren't helpful here, the caller reports one that actually makes sense. Reproducer: $ qemu-img

Re: [Qemu-devel] [PATCH v13 03/17] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove

2015-02-16 Thread John Snow
On 02/16/2015 03:22 PM, Eric Blake wrote: On 02/13/2015 03:08 PM, John Snow wrote: The new command pair is added to manage user created dirty bitmap. The s/manage/manage a/ dirty bitmap's name is mandatory and must be unique for the same device, but different devices can have bitmaps

Re: [Qemu-devel] [PATCH v13 10/17] qapi: Add transaction support to block-dirty-bitmap operations

2015-02-16 Thread John Snow
On 02/16/2015 03:28 PM, Max Reitz wrote: On 2015-02-13 at 17:08, John Snow wrote: This adds four qmp commands to transactions. Users can stop a dirty bitmap, start backup of it, and start another dirty bitmap atomically, so that the dirty bitmap is tracked incrementally and we don't mis

Re: [Qemu-devel] [PATCH RFC v2 8/8] migration: add migration/dirty-bitmap.c

2015-02-17 Thread John Snow
On 02/17/2015 03:54 AM, Vladimir Sementsov-Ogievskiy wrote: On 16.02.2015 21:18, John Snow wrote: On 02/16/2015 07:06 AM, Vladimir Sementsov-Ogievskiy wrote: On 13.02.2015 23:22, John Snow wrote: On 02/13/2015 03:19 AM, Vladimir Sementsov-Ogievskiy wrote: On 11.02.2015 00:33, John Snow

Re: [Qemu-devel] [PATCH RFC v3 02/14] hbitmap: serialization

2015-02-18 Thread John Snow
= 0; i < prev_size; ++i) { +if (bitmap->levels[lev + 1][i]) { +bitmap->levels[lev][i >> BITS_PER_LEVEL] |= +1 << (i & (BITS_PER_LONG - 1)); +} +} +} + +bitmap->levels[0][0] |= 1UL << (BITS_PER_LONG - 1); +} + void hbitmap_free(HBitmap *hb) { unsigned i; Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 03/14] block: BdrvDirtyBitmap serialization interface

2015-02-18 Thread John Snow
itmap_deserialize_finish(BdrvDirtyBitmap *bitmap); + void bdrv_enable_copy_on_read(BlockDriverState *bs); void bdrv_disable_copy_on_read(BlockDriverState *bs); Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 04/14] block: tiny refactoring: minimize hbitmap_(set/reset) usage

2015-02-18 Thread John Snow
map, cur_sector, nr_sectors); +bdrv_reset_dirty_bitmap(bitmap, cur_sector, nr_sectors); } } Thanks for this. Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 05/14] block: add meta bitmaps

2015-02-18 Thread John Snow
On 02/18/2015 09:00 AM, Vladimir Sementsov-Ogievskiy wrote: Meta bitmap is a 'dirty bitmap' for the BdrvDirtyBitmap. It tracks changes (set/unset) of this BdrvDirtyBitmap. It is needed for live migration of block dirty bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c

Re: [Qemu-devel] [PATCH RFC v3 06/14] block: add bdrv_next_dirty_bitmap()

2015-02-18 Thread John Snow
HBitmap *bdrv_create_meta_bitmap(BdrvDirtyBitmap *bitmap, uint64_t granularity); Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 09/14] iotests: maintain several vms in test

2015-02-18 Thread John Snow
;-machine', 'accel=qtest', '-display', 'none', '-vga', 'none'] self._num_drives = 0 +VM.nb_vms += 1 # This can be used to add an unused monitor instance. def add_monitor_telnet(self, ip, port): Simple enough, thanks! Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 07/14] qapi: add dirty-bitmaps migration capability

2015-02-18 Thread John Snow
['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', + 'dirty-bitmaps'] } ## # @MigrationCapabilityStatus Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 08/14] migration: add migration/block-dirty-bitmap.c

2015-02-18 Thread John Snow
On 02/18/2015 09:00 AM, Vladimir Sementsov-Ogievskiy wrote: Live migration of dirty bitmaps. Only named dirty bitmaps, associated with root nodes and non-root named nodes are migrated. If destination qemu is already containing a dirty bitmap with the same name as a migrated bitmap (for the sam

Re: [Qemu-devel] [PATCH RFC v3 10/14] iotests: add add_incoming_migration to VM class

2015-02-18 Thread John Snow
self._args.append('-incoming') +self._args.append(desc) +return self + def pause_drive(self, drive, event=None): '''Pause drive r/w operations''' if not event: Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 14/14] migration/qemu-file: make functions qemu_(get/put)_string public

2015-02-18 Thread John Snow
en = qemu_get_byte(f); +qemu_get_buffer(f, (uint8_t *)name, len); +name[len] = '\0'; + +return name; +} + +void qemu_put_string(QEMUFile *f, const char *name) +{ +int len = strlen(name); + +assert(len < 256); +qemu_put_byte(f, len); +qemu_put_buffer(f, (const uint8_t *)name, len); +} Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 00/14] Dirty bitmaps migration

2015-02-18 Thread John Snow
On 02/18/2015 09:00 AM, Vladimir Sementsov-Ogievskiy wrote: rfc: there are two tests. They are the same but using different interfaces: md5 checksum of the bitmap last layer in query-block or separate query-block-dirty-bitmap with dirty bitmap regions. The second form is more appropria

Re: [Qemu-devel] [PATCH RFC v3 11/14] iotests: add dirty bitmap migration test

2015-02-19 Thread John Snow
On 02/18/2015 09:00 AM, Vladimir Sementsov-Ogievskiy wrote: The test starts two vms (vm_a, vm_b), create dirty bitmap in the first one, do several writes to corresponding device and then migrate vm_a to vm_b with dirty bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iote

Re: [Qemu-devel] [PATCH RFC v3 12/14] qapi: add md5 checksum of last dirty bitmap level to query-block

2015-02-19 Thread John Snow
S_PER_LEVEL, 1); +const guchar *data = (const guchar *)bitmap->levels[HBITMAP_LEVELS - 1]; +return g_compute_checksum_for_data(G_CHECKSUM_MD5, data, size); +} It strikes me as somewhat odd to introduce a feature for the explicit purpose of regression testing, but I can't think of how else we'd do it simply, so this makes the most sense to me right now. Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH RFC v3 13/14] iotests: add dirty bitmap migration test

2015-02-19 Thread John Snow
On 02/18/2015 09:00 AM, Vladimir Sementsov-Ogievskiy wrote: [the same test as 117, but not using qmp: query-block-dirty-bitmap. only one test from {117, 118} will be in the next patch set version] The test starts two vms (vm_a, vm_b), create dirty bitmap in the first one, do several writes to

Re: [Qemu-devel] unable to set SATA serial with a spaces

2015-02-19 Thread John Snow
On 02/19/2015 02:48 PM, Alan Latteri wrote: I am virtualzing a physical server for which I need to set the SCSI/SATA drive serial. It is comprised of 12 " " spaces then 8 letter/digits. If I exclude the spaces, the drive serial is not accurate. If I include the spaces I get the following error.

[Qemu-devel] [PATCH 3/8] libqos/ahci: add ahci command helpers

2015-02-19 Thread John Snow
default values/guesses were incorrect or undesirable. Signed-off-by: John Snow --- tests/libqos/ahci.c | 42 ++ tests/libqos/ahci.h | 5 + 2 files changed, 47 insertions(+) diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 6f6652c..1d92438

[Qemu-devel] [PATCH 2/8] qtest/ahci: Add a macro bootup routine

2015-02-19 Thread John Snow
Add a routine that can be used to engage the AHCI device at a not-granular level so that bringing up the functionality of the HBA is easy in future tests that are not concerned with testing the bring-up process. Signed-off-by: John Snow --- tests/ahci-test.c | 23 +-- 1 file

[Qemu-devel] [PATCH 7/8] qtest/ahci: add qcow2 support to ahci-test

2015-02-19 Thread John Snow
This will enable the testing of high offsets without wasting a lot of disk space, and does not impact the previous tests. Signed-off-by: John Snow --- tests/ahci-test.c | 15 +-- tests/libqos/libqos.c | 30 ++ tests/libqos/libqos.h | 1 + 3 files

[Qemu-devel] [PATCH 8/8] qtest/ahci: test different disk sectors

2015-02-19 Thread John Snow
Test sector offset 0, 1, and the last sector(s) in LBA28 and LBA48 modes. Signed-off-by: John Snow --- tests/ahci-test.c | 69 +++-- tests/libqos/ahci.c | 10 tests/libqos/ahci.h | 4 ++-- 3 files changed, 64 insertions(+), 19

[Qemu-devel] [PATCH 6/8] qtest/ahci: add fragmented dma test

2015-02-19 Thread John Snow
Test what happens when we try to use extremely short PRDTs to accomplish a small data transfer. Signed-off-by: John Snow --- tests/ahci-test.c | 59 +++ 1 file changed, 59 insertions(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index

[Qemu-devel] [PATCH 1/8] libqos/ahci: Zero-fill AHCI headers

2015-02-19 Thread John Snow
Even though it's just the reserved space, make sure they're zeroes. Signed-off-by: John Snow --- tests/libqos/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 170ec5a..6f6652c 100644 --- a/tests/libqos/ahci.c +

[Qemu-devel] [PATCH 0/8] ahci: add more IO tests

2015-02-19 Thread John Snow
configurations, different I/O commands for PIO and DMA, different address scheme combinations for LBA28 and LBA48, and different sector offsets. John Snow (8): libqos/ahci: Zero-fill AHCI headers qtest/ahci: Add a macro bootup routine libqos/ahci: add ahci command helpers qtest/ahci: Add DMA test

[Qemu-devel] [PATCH 5/8] qtest/ahci: Add PIO and LBA48 tests

2015-02-19 Thread John Snow
transfer of ATAPI commands as well, and should be behaving well. Signed-off-by: John Snow --- tests/ahci-test.c | 155 ++ 1 file changed, 133 insertions(+), 22 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 9394d85

[Qemu-devel] [PATCH 4/8] qtest/ahci: Add DMA test variants

2015-02-19 Thread John Snow
, 256K. Signed-off-by: John Snow --- tests/ahci-test.c | 38 ++ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 9fe9fb5..9394d85 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -731,12 +731,11

Re: [Qemu-devel] [PATCH v13 15/17] iotests: add simple incremental backup case

2015-02-20 Thread John Snow
On 02/20/2015 05:02 AM, Stefan Hajnoczi wrote: On Fri, Feb 13, 2015 at 05:08:56PM -0500, John Snow wrote: +def check_incremental(self, target=None): +if target is None: +target = self.bitmaps[-1].last_target() +self.assertTrue(iotests.compare_images

Re: [Qemu-devel] [PATCH v13 00/17] block: incremental backup series

2015-02-20 Thread John Snow
On 02/20/2015 06:09 AM, Stefan Hajnoczi wrote: On Fri, Feb 13, 2015 at 05:08:41PM -0500, John Snow wrote: This series requires: [PATCH v3] blkdebug: fix "once" rule Welcome to the "incremental backup" newsletter, where we discuss exciting developments in non-redundant bac

[Qemu-devel] [PATCH v14 02/19] qmp: Ensure consistent granularity type

2015-02-20 Thread John Snow
We treat this field with a variety of different types everywhere in the code. Now it's just uint32_t. Reviewed-by: Eric Blake Reviewed-by: Max Reitz Signed-off-by: John Snow --- block.c | 11 ++- block/mirror.c| 4 ++-- include/block/block.h

[Qemu-devel] [PATCH v14 05/19] hbitmap: add hbitmap_merge

2015-02-20 Thread John Snow
running speed for particularly sparse bitmaps by using iterators, but the running time for dense maps will be worse. We present the simpler solution first, and we can refine it later if needed. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- include/qemu

[Qemu-devel] [PATCH v14 03/19] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove

2015-02-20 Thread John Snow
o block-core.json will be re-used in future patches in this series, see: 'qapi: Add transaction support to block-dirty-bitmap-{add, enable, disable}' Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c | 20 ++ block/mirror.c| 10

[Qemu-devel] [PATCH v14 01/19] qapi: Add optional field "name" to block dirty bitmap

2015-02-20 Thread John Snow
bdrv_find_dirty_bitmap to find a dirty bitmap by name, will be used later when other QMP commands want to reference dirty bitmap by name. Add bdrv_dirty_bitmap_make_anon. This unsets the name of dirty bitmap. Signed-off-by: Fam Zheng Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by

[Qemu-devel] [PATCH v14 13/19] block: Ensure consistent bitmap function prototypes

2015-02-20 Thread 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 --- block.c | 13 ++--- block/backup.c| 2 +- block/mirror.c| 26 ++ block

[Qemu-devel] [PATCH v14 08/19] qmp: Add support of "dirty-bitmap" sync mode for drive-backup

2015-02-20 Thread 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 Sn

[Qemu-devel] [PATCH v14 04/19] block: Introduce bdrv_dirty_bitmap_granularity()

2015-02-20 Thread 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 --- block.c | 8 ++-- include/block/block.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH v14 09/19] qmp: add block-dirty-bitmap-clear

2015-02-20 Thread 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. Reviewed-by: Max Reitz Signed-off-by: John Snow --- block.c

[Qemu-devel] [PATCH v14 14/19] iotests: add invalid input incremental backup tests

2015-02-20 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/112 | 89 ++ tests/qemu-iotests/112.out | 5 +++ tests/qemu-iotests/group | 1 + 3 files changed, 95 insertions(+) create mode 100644 tests/qemu-iotests/112 create mode

[Qemu-devel] [PATCH v14 00/19] block: incremental backup series

2015-02-20 Thread John Snow
ed .add_args(["-S"]) and hmp("c") and added a docstring. - Check for '%' in dirnames. - 16: removed hmp("c"), added a doctsring. - xx Dropped blkdebug patch, was #16. - 17: Removed hmp("c"), added a docstring. - Moved all blkdebug conf

[Qemu-devel] [PATCH v14 12/19] block: add BdrvDirtyBitmap documentation

2015-02-20 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index a7f56f4..c1c11aa 100644 --- a/block.c +++ b/block.c @@ -60,11 +60,11 @@ * or enabled. A frozen bitmap can only abdicate() or

[Qemu-devel] [PATCH v14 11/19] qmp: Add dirty bitmap status fields in query-block

2015-02-20 Thread John Snow
Adds the "disabled" and "frozen" status booleans. Signed-off-by: Fam Zheng Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c | 2 ++ qapi/block-core.json | 7 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c in

[Qemu-devel] [PATCH v14 06/19] qmp: Add block-dirty-bitmap-enable and block-dirty-bitmap-disable

2015-02-20 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- block.c | 25 + blockdev.c| 40 include/block/block.h | 3 +++ qapi/block-core.json | 28 qmp-commands.hx | 10

[Qemu-devel] [PATCH v14 10/19] qapi: Add transaction support to block-dirty-bitmap operations

2015-02-20 Thread John Snow
her a bitmap clear and a full block backup. Signed-off-by: Fam Zheng Signed-off-by: John Snow --- blockdev.c | 170 +++ qapi-schema.json | 10 +++- 2 files changed, 179 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c

<    1   2   3   4   5   6   7   8   9   10   >