[Qemu-devel] [PATCH 00/11] Migration next v10

2012-08-05 Thread Orit Wasserman
Remove capabilities from query-migrate. patches are based on git://repo.or.cz/qemu/quintela.git Migration-next-v5 branch Please review Juan Quintela (1): Restart optimization on stage3 update version Orit Wasserman (10): Add migration capabilities Add migrate-set-capabilities and query-migrat

[Qemu-devel] [PATCH 00/11] Migration next v10

2012-08-05 Thread Orit Wasserman
Remove capabilities from query-migrate. patches are based on git://repo.or.cz/qemu/quintela.git Migration-next-v5 branch Please review Juan Quintela (1): Restart optimization on stage3 update version Orit Wasserman (10): Add migration capabilities Add migrate-set-capabilities and query-migrat

[Qemu-devel] [PATCH 01/11] Add migration capabilities

2012-08-05 Thread Orit Wasserman
Add migration capabilities that can be queried by the management using query-migrate-supported-capabilities command. The management can query the source QEMU and the destination QEMU in order to verify both support some migration capability (currently only XBZRLE). Signed-off-by: Orit Wasserman

[Qemu-devel] [PATCH 02/11] Add migrate-set-capabilities and query-migrate-capabilities

2012-08-05 Thread Orit Wasserman
' HMP commands. Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- hmp-commands.hx | 16 + hmp.c| 65 ++ hmp.h|2 + migration.c | 46 ++ m

[Qemu-devel] [PATCH 07/11] Add XBZRLE to ram_save_block and ram_save_live

2012-08-05 Thread Orit Wasserman
-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- arch_init.c | 158 ++- migration.c | 24 + migration.h |4 ++ 3 files changed, 184 insertions(+), 2 deletions(-) diff --git a/arch_init.c

[Qemu-devel] [PATCH 04/11] Add cache handling functions

2012-08-05 Thread Orit Wasserman
Add MRU page cache mechanism. The page are accessed by their address. Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- Makefile.objs |1 + cutils.c |9 ++ include/qemu/page_cache.h

[Qemu-devel] [PATCH 08/11] Add migrate_set_cache_size command

2012-08-05 Thread Orit Wasserman
e. Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- arch_init.c | 10 ++ hmp-commands.hx | 22 ++ hmp.c| 19 +++ hmp.h|2 ++ migration.c

[Qemu-devel] [PATCH 10/11] Add XBZRLE statistics

2012-08-05 Thread Orit Wasserman
Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- arch_init.c | 28 hmp.c| 13 + migration.c | 17

[Qemu-devel] [PATCH 03/11] Add XBZRLE documentation

2012-08-05 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- docs/xbzrle.txt | 136 +++ 1 files changed, 136 insertions(+), 0 deletions(-) create mode 100644 docs/xbzrle.txt diff --git a/docs/xbzrle.txt b/docs/xbzrle.txt new file mode 100644 index 000..ce577a9

[Qemu-devel] [PATCH 11/11] Restart optimization on stage3 update version

2012-08-05 Thread Orit Wasserman
From: Juan Quintela Signed-off-by: Juan Quintela --- arch_init.c | 24 +++- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/arch_init.c b/arch_init.c index 9833d54..21031d1 100644 --- a/arch_init.c +++ b/arch_init.c @@ -273,14 +273,16 @@ static void save_bl

[Qemu-devel] [PATCH 09/11] Add migration accounting for normal and duplicate pages

2012-08-05 Thread Orit Wasserman
Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- arch_init.c | 38 ++ hmp.c|6 ++ migration.c |6 ++ migration.h

[Qemu-devel] [PATCH 06/11] Add xbzrle_encode_buffer and xbzrle_decode_buffer functions

2012-08-05 Thread Orit Wasserman
d-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Eric Blake --- migration.h |4 ++ savevm.c| 159 +++ 2 files changed, 163 insertions(+), 0 deletions(-) diff --git a/migration.h b/mig

[Qemu-devel] [PATCH 05/11] Add uleb encoding/decoding functions

2012-08-05 Thread Orit Wasserman
Implement Unsigned Little Endian Base 128. Signed-off-by: Orit Wasserman --- cutils.c | 33 + qemu-common.h |8 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/cutils.c b/cutils.c index b0bdd4b..700f943 100644 --- a/cutils.c

Re: [Qemu-devel] [PATCH 02/11] Add migrate-set-capabilities and query-migrate-capabilities

2012-08-06 Thread Orit Wasserman
On 08/06/2012 05:26 PM, Eric Blake wrote: > On 08/05/2012 03:13 AM, Orit Wasserman wrote: >> The management can enable/disable a capability for the next migration by >> using >> migrate-set-apabilities QMP command. > > s/set-apabilities/set-capabilities/ > &

Re: [Qemu-devel] [PATCH 08/12] Add migrate_set_cache_size command

2012-08-06 Thread Orit Wasserman
On 08/06/2012 09:13 PM, Eric Blake wrote: > On 08/06/2012 11:51 AM, Orit Wasserman wrote: >> Change XBZRLE cache size in bytes (the size should be a power of 2, it will >> be >> rounded down to the nearest power of 2). >> If XBZRLE cache size is too small there will be

[Qemu-devel] [PATCH 12/12] Restart optimization on stage3 update version

2012-08-06 Thread Orit Wasserman
From: Juan Quintela Signed-off-by: Juan Quintela --- arch_init.c | 24 +++- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/arch_init.c b/arch_init.c index 5f864a6..5181953 100644 --- a/arch_init.c +++ b/arch_init.c @@ -273,14 +273,16 @@ static void save_bl

[Qemu-devel] [PATCH 00/12] Migration next v11

2012-08-06 Thread Orit Wasserman
ntela (1): Restart optimization on stage3 update version Orit Wasserman (11): Add migration capabilities Add migrate-set-capabilities Add XBZRLE documentation Add cache handling functions Add uleb encoding/decoding functions Add xbzrle_encode_buffer and xbzrle_decode_buffer funct

[Qemu-devel] [PATCH 11/12] Add XBZRLE statistics

2012-08-06 Thread Orit Wasserman
Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- arch_init.c | 28 hmp.c| 13 + migration.c | 17

[Qemu-devel] [PATCH 04/12] Add cache handling functions

2012-08-06 Thread Orit Wasserman
Add MRU page cache mechanism. The page are accessed by their address. Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- Makefile.objs |1 + cutils.c |9 ++ include/qemu/page_cache.h

[Qemu-devel] [PATCH 00/12] Migration next v12

2012-08-06 Thread Orit Wasserman
Remove capabilities from query-migrate. patches are based on git://repo.or.cz/qemu/quintela.git Migration-next-v5 branch Please review Juan Quintela (1): Restart optimization on stage3 update version Orit Wasserman (11): Add migration capabilities Add migrate-set-capabilities Add XBZRLE

[Qemu-devel] [PATCH 01/12] Add migration capabilities

2012-08-06 Thread Orit Wasserman
The management can query the current migration capabilities using query-migrate-capabilities QMP command. The user can use 'info migrate_capabilities' HMP command. Currently only XBZRLE capability is available. Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- hmp-c

[Qemu-devel] [PATCH 06/12] Add xbzrle_encode_buffer and xbzrle_decode_buffer functions

2012-08-06 Thread Orit Wasserman
d-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Eric Blake --- migration.h |4 ++ savevm.c| 159 +++ 2 files changed, 163 insertions(+), 0 deletions(-) diff --git a/migration.h b/mig

[Qemu-devel] [PATCH 09/12] Change total_time to total-time in MigrationStats

2012-08-06 Thread Orit Wasserman
migration total_time was introduced in commit d5f8a5701d3690b5ec0c34b6a5c0b5a24d274540 for QEMU 1.2 Signed-off-by: Orit Wasserman --- qapi-schema.json |4 ++-- qmp-commands.hx |9 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/qapi-schema.json b/qapi

[Qemu-devel] [PATCH 10/12] Add migration accounting for normal and duplicate pages

2012-08-06 Thread Orit Wasserman
Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- arch_init.c | 38 ++ hmp.c|6 ++ migration.c |6 ++ migration.h

[Qemu-devel] [PATCH 07/12] Add XBZRLE to ram_save_block and ram_save_live

2012-08-06 Thread Orit Wasserman
-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- arch_init.c | 158 ++- migration.c | 24 + migration.h |4 ++ 3 files changed, 184 insertions(+), 2 deletions(-) diff --git a/arch_init.c

[Qemu-devel] [PATCH 12/12] Restart optimization on stage3 update version

2012-08-06 Thread Orit Wasserman
From: Juan Quintela Signed-off-by: Juan Quintela --- arch_init.c | 24 +++- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/arch_init.c b/arch_init.c index 5f864a6..5181953 100644 --- a/arch_init.c +++ b/arch_init.c @@ -273,14 +273,16 @@ static void save_bl

[Qemu-devel] [PATCH 07/12] Add XBZRLE to ram_save_block and ram_save_live

2012-08-06 Thread Orit Wasserman
-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- arch_init.c | 158 ++- migration.c | 24 + migration.h |4 ++ 3 files changed, 184 insertions(+), 2 deletions(-) diff --git a/arch_init.c

[Qemu-devel] [PATCH 08/12] Add migrate_set_cache_size command

2012-08-06 Thread Orit Wasserman
e. Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- arch_init.c | 10 ++ hmp-commands.hx | 22 ++ hmp.c| 19 +++ hmp.h|2 ++ migration.c

[Qemu-devel] [PATCH 01/12] Add migration capabilities

2012-08-06 Thread Orit Wasserman
The management can query the current migration capabilities using query-migrate-capabilities QMP command. The user can use 'info migrate_capabilities' HMP command. Currently only XBZRLE capability is available. Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- hmp-c

[Qemu-devel] [PATCH 03/12] Add XBZRLE documentation

2012-08-06 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- docs/xbzrle.txt | 128 +++ 1 files changed, 128 insertions(+), 0 deletions(-) create mode 100644 docs/xbzrle.txt diff --git a/docs/xbzrle.txt b/docs/xbzrle.txt new file mode 100644 index 000..cc3a26a

[Qemu-devel] [PATCH 02/12] Add migrate-set-capabilities

2012-08-06 Thread Orit Wasserman
The management can enable/disable a capability for the next migration by using migrate-set-capabilities QMP command. The user can use migrate_set_capability HMP command. Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- hmp-commands.hx | 14 ++ hmp.c

[Qemu-devel] [PATCH 11/12] Add XBZRLE statistics

2012-08-06 Thread Orit Wasserman
Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- arch_init.c | 28 hmp.c| 13 + migration.c | 17

[Qemu-devel] [PATCH 08/12] Add migrate_set_cache_size command

2012-08-06 Thread Orit Wasserman
e. Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- arch_init.c | 10 ++ hmp-commands.hx | 22 ++ hmp.c| 19 +++ hmp.h|2 ++ migration.c

[Qemu-devel] [PATCH 09/12] Add migration accounting for normal and duplicate pages

2012-08-06 Thread Orit Wasserman
Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- arch_init.c | 38 ++ hmp.c|6 ++ migration.c |6 ++ migration.h

[Qemu-devel] [PATCH 05/12] Add uleb encoding/decoding functions

2012-08-06 Thread Orit Wasserman
Implement Unsigned Little Endian Base 128. Signed-off-by: Orit Wasserman --- cutils.c | 33 + qemu-common.h |8 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/cutils.c b/cutils.c index b0bdd4b..700f943 100644 --- a/cutils.c

[Qemu-devel] [PATCH 04/12] Add cache handling functions

2012-08-06 Thread Orit Wasserman
Add MRU page cache mechanism. The page are accessed by their address. Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman --- Makefile.objs |1 + cutils.c |9 ++ include/qemu/page_cache.h

Re: [Qemu-devel] [PATCH 02/11] Add migrate-set-capabilities and query-migrate-capabilities

2012-08-06 Thread Orit Wasserman
On 08/06/2012 07:39 PM, Eric Blake wrote: > On 08/06/2012 10:28 AM, Orit Wasserman wrote: > >>> That is, BOTH commands end up iterating over a list of caps, and output >>> identical information in the case where caps exist of 'name: state' for >>> ea

[Qemu-devel] [PATCH 05/12] Add uleb encoding/decoding functions

2012-08-06 Thread Orit Wasserman
Implement Unsigned Little Endian Base 128. Signed-off-by: Orit Wasserman --- cutils.c | 33 + qemu-common.h |8 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/cutils.c b/cutils.c index b0bdd4b..700f943 100644 --- a/cutils.c

[Qemu-devel] [PATCH 02/12] Add migrate-set-capabilities

2012-08-06 Thread Orit Wasserman
The management can enable/disable a capability for the next migration by using migrate-set-capabilities QMP command. The user can use migrate_set_capability HMP command. Signed-off-by: Orit Wasserman Signed-off-by: Juan Quintela --- hmp-commands.hx | 14 ++ hmp.c

[Qemu-devel] [PATCH 03/12] Add XBZRLE documentation

2012-08-06 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- docs/xbzrle.txt | 128 +++ 1 files changed, 128 insertions(+), 0 deletions(-) create mode 100644 docs/xbzrle.txt diff --git a/docs/xbzrle.txt b/docs/xbzrle.txt new file mode 100644 index 000..cc3a26a

[Qemu-devel] [PATCH 06/12] Add xbzrle_encode_buffer and xbzrle_decode_buffer functions

2012-08-06 Thread Orit Wasserman
d-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Signed-off-by: Eric Blake --- migration.h |4 ++ savevm.c| 159 +++ 2 files changed, 163 insertions(+), 0 deletions(-) diff --git a/migration.h b/mig

Re: [Qemu-devel] [PATCH 02/11] Add migrate-set-capabilities and query-migrate-capabilities

2012-08-06 Thread Orit Wasserman
On 08/06/2012 07:14 PM, Eric Blake wrote: > On 08/06/2012 10:04 AM, Orit Wasserman wrote: >> On 08/06/2012 05:26 PM, Eric Blake wrote: >>> On 08/05/2012 03:13 AM, Orit Wasserman wrote: >>>> The management can enable/disable a capability for the next migration b

[Qemu-devel] [PATCH 10/12] Change total_time to total-time in MigrationStats

2012-08-06 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- qapi-schema.json |4 ++-- qmp-commands.hx |6 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 8cc40e2..3238403 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -260,7 +260,7

Re: [Qemu-devel] [PATCH 1/8] buffered_file: g_realloc() can't fail

2012-08-21 Thread Orit Wasserman
L) { > -fprintf(stderr, "qemu file buffer expansion failed\n"); > -exit(1); > -} > - > -s->buffer = tmp; > +s->buffer = g_realloc(s->buffer, s->buffer_capacity); > } > > memcpy(s->buffer + s->buffer_size, buf, size); > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 2/8] fix migration sync

2012-08-21 Thread Orit Wasserman
@@ -488,6 +488,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) > ram_addr_t addr; > RAMBlock *block; > > +memory_global_sync_dirty_bitmap(get_system_memory()); > bytes_transferred = 0; > last_block = NULL; > last_offset = 0; > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 3/8] migration: move total_time from ram stats to migration info

2012-08-21 Thread Orit Wasserman
uery-migrate > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 2ce4ce6..8671bf3 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -2239,14 +2239,14 @@ The main json-object contains the following: > > - "status": migration status (json-string) > - Possible values: "active", "completed", "failed", "cancelled" > +- "total-time": total amount of ms since migration started. If > +migration has ended, it returns the total migration > + time (json-int) > - "ram": only present if "status" is "active", it is a json-object with the >following RAM information (in bytes): > - "transferred": amount transferred (json-int) > - "remaining": amount remaining (json-int) > - "total": total (json-int) > - - "total-time": total amount of ms since migration started. If > - migration has ended, it returns the total migration > time > - (json-int) > - "duplicate": number of duplicated pages (json-int) > - "normal" : number of normal pages transferred (json-int) > - "normal-bytes" : number of normal bytes transferred (json-int) > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 5/8] migration: print total downtime for final phase of migration

2012-08-21 Thread Orit Wasserman
On 08/18/2012 02:17 PM, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > hmp.c| 4 > migration.c | 6 +- > migration.h | 1 + > qapi-schema.json | 7 ++- > qmp-commands.hx | 3 +++ > 5 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a

Re: [Qemu-devel] [PATCH 6/8] migration: rename expected_time to expected_downtime

2012-08-21 Thread Orit Wasserman
ntime <= migrate_max_downtime()) { > memory_global_sync_dirty_bitmap(get_system_memory()); > -expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth; > +expected_downtime = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth; > > -return expected_time <= migrate_max_downtime(); > +return expected_downtime <= migrate_max_downtime(); > } > return 0; > } > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 7/8] migration: export migrate_get_current()

2012-08-21 Thread Orit Wasserman
nge_notifier(Notifier > *notify); > bool migration_is_active(MigrationState *); > bool migration_has_finished(MigrationState *); > bool migration_has_failed(MigrationState *); > +MigrationState *migrate_get_current(void); > > uint64_t ram_bytes_remaining(void); > uint64_t ram_bytes_transferred(void); > Reviewed-by: Orit Wasserman

[Qemu-devel] [PATCH v6 02/11] Add uleb encoding/decoding functions

2012-01-25 Thread Orit Wasserman
Implement Unsigned Little Endian Base 128. Signed-off-by: Orit Wasserman --- migration.h |4 savevm.c| 26 ++ 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/migration.h b/migration.h index 372b066..50dec18 100644 --- a/migration.h +++ b

[Qemu-devel] [PATCH v6 00/11] XBRLE delta for live migration of large memory app

2012-01-25 Thread Orit Wasserman
..} Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Orit Wasserman (11): Add cache handling functions Add uleb encoding/decoding functions Add save_block_hdr function Add host_from_stream_offset_versioned function Add XBZRLE to ram_save_block

[Qemu-devel] [PATCH v6 08/11] Add migration capabilties

2012-01-25 Thread Orit Wasserman
Add migration capabiltes that can be queried by the management. The managment can query to source and the destination in order to verfiy both support some maigration capability (currently only XBZRLE). Signed-off-by: Orit Wasserman --- hmp.c| 18 ++ hmp.h

[Qemu-devel] [PATCH v6 09/11] Add set_cachesize command

2012-01-25 Thread Orit Wasserman
Change XBZRLE cache size in MB (the size should be a poer of 2) Signed-off-by: Orit Wasserman --- hmp-commands.hx | 15 +++ hmp.c| 13 + hmp.h|1 + migration.c | 22 +- migration.h |2 ++ qapi

Re: [Qemu-devel] [PATCH v6 02/11] Add uleb encoding/decoding functions

2012-01-25 Thread Orit Wasserman
On 01/25/2012 02:22 PM, Orit Wasserman wrote: > On 01/25/2012 01:48 PM, Avi Kivity wrote: >> On 01/25/2012 01:26 PM, Orit Wasserman wrote: >>> Implement Unsigned Little Endian Base 128. >>> >>> >>> +/* ULEB128 */ >>> +int ul

[Qemu-devel] [PATCH v6 04/11] Add host_from_stream_offset_versioned function

2012-01-25 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- arch_init.c | 26 +++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c index 1218306..26312f6 100644 --- a/arch_init.c +++ b/arch_init.c @@ -550,6 +550,18 @@ static inline void

[Qemu-devel] [PATCH v6 10/11] Add XBZRLE option to migrate command

2012-01-25 Thread Orit Wasserman
QMP/HMP changes Signed-off-by: Orit Wasserman --- hmp-commands.hx | 21 + qmp-commands.hx | 18 +++--- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 3b7255d..daa8aae 100644 --- a/hmp-commands.hx +++ b

[Qemu-devel] [PATCH v6 01/11] Add cache handling functions

2012-01-25 Thread Orit Wasserman
Add LRU page caching mechanism. The pages are stored in the cache ordered by their address. Signed-off-by: Orit Wasserman --- arch_init.c | 175 +++ 1 files changed, 175 insertions(+), 0 deletions(-) diff --git a/arch_init.c b

[Qemu-devel] [PATCH v6 07/11] Add XBZRLE parameters to MigrationState

2012-01-25 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- arch_init.c |5 + migration.c |8 migration.h |4 savevm.c|9 ++--- sysemu.h|1 + 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c index 3a9b0e6..c7da4d7 100644 --- a

[Qemu-devel] [PATCH v6 03/11] Add save_block_hdr function

2012-01-25 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- arch_init.c | 24 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch_init.c b/arch_init.c index 34e4e60..1218306 100644 --- a/arch_init.c +++ b/arch_init.c @@ -300,6 +300,16 @@ static void cache_insert(unsigned long

[Qemu-devel] [PATCH v6 05/11] Add XBZRLE to ram_save_block and ram_save_live

2012-01-25 Thread Orit Wasserman
(by using load_xbrle function). Signed-off-by: Orit Wasserman --- arch_init.c | 169 ++ migration.h |3 + savevm.c| 93 - 3 files changed, 251 insertions(+), 14 deletions(-) diff --git a

[Qemu-devel] [PATCH v6 11/11] Add XBZRLE statstics information

2012-01-25 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- arch_init.c | 60 ++ migration.c | 10 + migration.h |9 qapi-schema.json | 20 - 4 files changed, 97 insertions(+), 2 deletions(-) diff --git a

Re: [Qemu-devel] [PATCH v6 02/11] Add uleb encoding/decoding functions

2012-01-25 Thread Orit Wasserman
On 01/25/2012 01:48 PM, Avi Kivity wrote: > On 01/25/2012 01:26 PM, Orit Wasserman wrote: >> Implement Unsigned Little Endian Base 128. >> >> >> +/* ULEB128 */ >> +int uleb128_encode_small(uint8_t *out, uint32_t n); >> +int uleb128_decode_small(const u

[Qemu-devel] [PATCH v6 06/11] Add MigrationParams structure

2012-01-25 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- block-migration.c |8 migration.c | 16 +--- migration.h |9 +++-- qemu-common.h |1 + savevm.c | 12 sysemu.h |4 ++-- vmstate.h |2 +- 7 files changed, 32

[Qemu-devel] [PATCH v7 01/11] Add cache handling functions

2012-01-26 Thread Orit Wasserman
Add LRU page cache mechanism. The page are accessed by their address. Signed-off-by: Orit Wasserman --- arch_init.c | 174 +++ 1 files changed, 174 insertions(+), 0 deletions(-) diff --git a/arch_init.c b/arch_init.c index 2366511

[Qemu-devel] [PATCH v7 03/11] Add save_block_hdr function

2012-01-26 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- arch_init.c | 25 + 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/arch_init.c b/arch_init.c index bdc74a9..ac21bc0 100644 --- a/arch_init.c +++ b/arch_init.c @@ -300,6 +300,17 @@ static void cache_insert(unsigned

[Qemu-devel] [PATCH v7 04/11] Add host_from_stream_offset_versioned function

2012-01-26 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- arch_init.c | 26 +++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c index ac21bc0..0f6037e 100644 --- a/arch_init.c +++ b/arch_init.c @@ -550,6 +550,18 @@ static inline void

[Qemu-devel] [PATCH v7 11/11] Add XBZRLE statstics information

2012-01-26 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- arch_init.c | 60 ++ migration.c | 10 + migration.h |9 qapi-schema.json | 20 - 4 files changed, 97 insertions(+), 2 deletions(-) diff --git a

[Qemu-devel] [PATCH v7 02/11] Add uleb encoding/decoding functions

2012-01-26 Thread Orit Wasserman
Implement Unsigned Little Endian Base 128. Signed-off-by: Orit Wasserman --- migration.h |4 savevm.c| 28 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/migration.h b/migration.h index 372b066..50dec18 100644 --- a/migration.h +++ b

[Qemu-devel] [PATCH v7 06/11] Add MigrationParams structure

2012-01-26 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- block-migration.c |8 migration.c | 16 +--- migration.h |9 +++-- qemu-common.h |1 + savevm.c | 12 sysemu.h |4 ++-- vmstate.h |2 +- 7 files changed, 32

[Qemu-devel] [PATCH v7 08/11] Add migration capabilties

2012-01-26 Thread Orit Wasserman
Add migration capabiltes that can be queried by the management. The managment can query to source and the destination in order to verify both support some maigration capability (currently only XBZRLE). Signed-off-by: Orit Wasserman --- hmp.c| 18 ++ hmp.h

[Qemu-devel] [PATCH v7 10/11] Add XBZRLE option to migrate command

2012-01-26 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- hmp-commands.hx | 21 + qmp-commands.hx | 18 +++--- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 3b7255d..daa8aae 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx

[Qemu-devel] [PATCH v7 09/11] Add set_cachesize command

2012-01-26 Thread Orit Wasserman
Change XBZRLE cache size in MB (the size should be a power of 2). Signed-off-by: Orit Wasserman --- hmp-commands.hx | 15 +++ hmp.c| 13 + hmp.h|1 + migration.c | 22 +- migration.h |2 ++ qapi

[Qemu-devel] [PATCH v7 00/11] XBRLE delta for live migration of large memory app

2012-01-26 Thread Orit Wasserman
; 4096 * 4; i++) { ..buf[i * 4096 / 4]++; ..} ..printf("."); ..} ..} Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Orit Wasserman (11): Add cache handling functions Add uleb encoding/decoding functio

[Qemu-devel] [PATCH v7 07/11] Add XBZRLE parameters to MigrationState

2012-01-26 Thread Orit Wasserman
Signed-off-by: Orit Wasserman --- arch_init.c |5 + migration.c |8 migration.h |4 savevm.c|9 ++--- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c index 4ebf080..f864585 100644 --- a/arch_init.c +++ b

[Qemu-devel] [PATCH v7 05/11] Add XBZRLE to ram_save_block and ram_save_live

2012-01-26 Thread Orit Wasserman
(by using load_xbrle function). Signed-off-by: Orit Wasserman --- arch_init.c | 169 ++ migration.h |3 + savevm.c| 93 3 files changed, 253 insertions(+), 12 deletions(-) diff --git a/arch_init.c

Re: [Qemu-devel] [RFC PATCH] replication agent module

2012-02-08 Thread Orit Wasserman
On 02/07/2012 04:05 PM, Paolo Bonzini wrote: > On 02/07/2012 02:50 PM, Stefan Hajnoczi wrote: >>> I guess we might need to attach multiple QMP monitors for this to work >>> (one for libvirt, one for the rephub). I'm not sure if there is a >>> fundamental problem with this or if it just needs to be

Re: [Qemu-devel] [RFC PATCH] replication agent module

2012-02-08 Thread Orit Wasserman
On 02/07/2012 04:45 PM, Ori Mamluk wrote: > On 07/02/2012 15:34, Kevin Wolf wrote: >> Am 07.02.2012 11:29, schrieb Ori Mamluk: >>> Repagent is a new module that allows an external replication system to >>> replicate a volume of a Qemu VM. >>> >>> This RFC patch adds the repagent client module to Qe

Re: [Qemu-devel] [PATCH 01/30] split MRU ram list

2012-10-21 Thread Orit Wasserman
ext_mru); > } > if (xen_enabled()) { > /* We need to check if the requested address is in the RAM > @@ -2813,7 +2821,7 @@ int qemu_ram_addr_from_host(void *ptr, ram_addr_t > *ram_addr) > return 0; > } > > -QLIST_FOREACH(block, &ram_list.blocks, next) { > +QLIST_FOREACH(block, &ram_list.blocks_mru, next_mru) { > /* This case append when the block is not mapped. */ > if (block->host == NULL) { > continue; > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 03/30] protect the ramlist with a separate mutex

2012-10-21 Thread Orit Wasserman
(ram_addr_t addr) > { > RAMBlock *block; > > +qemu_mutex_lock_ramlist(); > QLIST_FOREACH(block, &ram_list.blocks, next) { > if (addr == block->offset) { > QLIST_REMOVE(block, next); > QLIST_REMOVE(block, next_mru); > ram_list.version++; > g_free(block); > -return; > +break; > } > } > +qemu_mutex_unlock_ramlist(); > } > > void qemu_ram_free(ram_addr_t addr) > { > RAMBlock *block; > > +qemu_mutex_lock_ramlist(); > QLIST_FOREACH(block, &ram_list.blocks, next) { > if (addr == block->offset) { > QLIST_REMOVE(block, next); > @@ -2644,9 +2662,10 @@ void qemu_ram_free(ram_addr_t addr) > #endif > } > g_free(block); > -return; > +break; > } > } > +qemu_mutex_unlock_ramlist(); > > } > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 04/30] buffered_file: Move from using a timer to use a thread

2012-10-21 Thread Orit Wasserman
On 10/18/2012 09:30 AM, Juan Quintela wrote: > We still protect everything except the wait with the iothread lock. > But we moved from a timer to a thread. Steps one by one. > > We also need to detect when we have finished with a variable "complete". > > Signed-off-by: Juan Quintela > --- > bu

Re: [Qemu-devel] [PATCH 05/30] migration: make qemu_fopen_ops_buffered() return void

2012-10-21 Thread Orit Wasserman
> > DPRINTF("beginning savevm\n"); > ret = qemu_savevm_state_begin(s->file, &s->params); > diff --git a/migration.h b/migration.h > index 1c3e9b7..a63c5d5 100644 > --- a/migration.h > +++ b/migration.h > @@ -45,6 +45,7 @@ struct MigrationState > int64_t dirty_pages_rate; > bool enabled_capabilities[MIGRATION_CAPABILITY_MAX]; > int64_t xbzrle_cache_size; > +bool complete; > }; > > void process_incoming_migration(QEMUFile *f); > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 02/30] add a version number to ram_list

2012-10-21 Thread Orit Wasserman
; > return; > } > @@ -2616,6 +2618,7 @@ void qemu_ram_free(ram_addr_t addr) > if (addr == block->offset) { > QLIST_REMOVE(block, next); > QLIST_REMOVE(block, next_mru); > +ram_list.version++; > if (block->flags & RAM_PREALLOC_MASK) { > ; > } else if (mem_path) { > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 30/30] ram: optimize migration bitmap walking

2012-10-21 Thread Orit Wasserman
On 10/18/2012 09:30 AM, Juan Quintela wrote: > Instead of testing each page individually, we search what is the next > dirty page with a bitmap operation. We have to reorganize the code to > move from a "for" loop, to a while(dirty) loop. > > Signed-off-by: Juan Quintela > --- > arch_init.c | 4

Re: [Qemu-devel] slow xbzrle

2012-10-25 Thread Orit Wasserman
On 10/25/2012 10:12 AM, Stefan Priebe - Profihost AG wrote: > Hello list, > > i'm using 1.2 stable and wanted to use xbzrle but xbzrle is extremely slow. > > While trying to transfer a simple VM with 4GB memory through a 10GBe nic > while running a MySQL (with NO LOAD) it takes up to 10 - 15 min

Re: [Qemu-devel] slow xbzrle

2012-10-25 Thread Orit Wasserman
On 10/25/2012 12:35 PM, Stefan Priebe - Profihost AG wrote: > Am 25.10.2012 11:44, schrieb Orit Wasserman: >>> Is this known or is something wrong? >> My guess this workload migrates fine without XBZRLE so it is not the speed >> or downtime :). >> it could be th

Re: [Qemu-devel] slow xbzrle

2012-10-25 Thread Orit Wasserman
On 10/25/2012 02:18 PM, Stefan Priebe - Profihost AG wrote: > Am 25.10.2012 13:39, schrieb Orit Wasserman: >> On 10/25/2012 12:35 PM, Stefan Priebe - Profihost AG wrote: >>> Am 25.10.2012 11:44, schrieb Orit Wasserman: >>>>> Is this known or is something wrong? >

Re: [Qemu-devel] [PATCH 30/30] ram: optimize migration bitmap walking

2012-10-28 Thread Orit Wasserman
On 10/26/2012 01:39 PM, Juan Quintela wrote: > Orit Wasserman wrote: >> On 10/18/2012 09:30 AM, Juan Quintela wrote: >>> Instead of testing each page individually, we search what is the next >>> dirty page with a bitmap operation. We have to reorganize the code to >

Re: [Qemu-devel] [PATCH 01/12] migration: unify stdio-based QEMUFile operations

2012-10-28 Thread Orit Wasserman
gt; + s->file = qemu_fopen_ops(s, NULL, stdio_get_buffer, stdio_fclose, > NULL, NULL, NULL); > } > return s->file; > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 02/12] migration: consolidate QEMUFile methods in a single QEMUFileOps struct

2012-10-28 Thread Orit Wasserman
(ret >= 0) { > ret = ret2; > } > @@ -510,7 +522,7 @@ int qemu_fclose(QEMUFile *f) > > int qemu_file_put_notify(QEMUFile *f) > { > -return f->put_buffer(f->opaque, NULL, 0, 0); > +return f->ops->put_buffer(f->opaque, NULL, 0, 0); > } > > void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size) > @@ -657,16 +669,16 @@ static int64_t qemu_ftell(QEMUFile *f) > > int qemu_file_rate_limit(QEMUFile *f) > { > -if (f->rate_limit) > -return f->rate_limit(f->opaque); > +if (f->ops->rate_limit) > +return f->ops->rate_limit(f->opaque); > > return 0; > } > > int64_t qemu_file_get_rate_limit(QEMUFile *f) > { > -if (f->get_rate_limit) > -return f->get_rate_limit(f->opaque); > +if (f->ops->get_rate_limit) > +return f->ops->get_rate_limit(f->opaque); > > return 0; > } > @@ -675,8 +687,8 @@ int64_t qemu_file_set_rate_limit(QEMUFile *f, int64_t > new_rate) > { > /* any failed or completed migration keeps its state to allow probing of > * migration data, but has no associated file anymore */ > -if (f && f->set_rate_limit) > -return f->set_rate_limit(f->opaque, new_rate); > +if (f && f->ops->set_rate_limit) > +return f->ops->set_rate_limit(f->opaque, new_rate); > > return 0; > } > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 03/12] migration: add qemu_get_fd

2012-10-28 Thread Orit Wasserman
socket_close > }; > @@ -491,6 +510,14 @@ static void qemu_fill_buffer(QEMUFile *f) > qemu_file_set_error(f, len); > } > > +int qemu_get_fd(QEMUFile *f) > +{ > +if (f->ops->get_fd) { > +return f->ops->get_fd(f->opaque); > +} > +return -1; > +} > + > /** Closes the file > * > * Returns negative error value if any error happened on previous operations > or > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 04/12] migration: replace qemu_stdio_fd with qemu_get_fd

2012-10-28 Thread Orit Wasserman
); > } > > -int qemu_stdio_fd(QEMUFile *f) > -{ > -QEMUFileStdio *p; > -int fd; > - > -p = (QEMUFileStdio *)f->opaque; > - fd = fileno(p->stdio_file); > - > -return fd; > -} > - > static const QEMUFileOps stdio_file_read_ops = { > .get_fd = stdio_get_fd, > .get_buffer = stdio_get_buffer, > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 05/12] migration: clean up server sockets and handlers before invoking process_incoming_migration

2012-10-28 Thread Orit Wasserman
, "could not accept migration connection\n"); > -goto out2; > +goto out; > } > > f = qemu_fopen_socket(c); > @@ -147,9 +149,6 @@ static void unix_accept_incoming_migration(void *opaque) > qemu_fclose(f); > out: > close(c); > -out2: > -qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL); > -close(s); > } > > int unix_start_incoming_migration(const char *path) > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 06/12] migration: use migrate_fd_close in migrate_fd_cleanup

2012-10-28 Thread Orit Wasserman
On 10/18/2012 12:22 PM, Paolo Bonzini wrote: > migrate_fd_cleanup will usually close the file descriptor via > buffered_file_close's call to migrate_fd_close. However, in the case > of s->file == NULL it is "inlining" migrate_fd_close (almost: there is a > direct close() instead of using s->close(

Re: [Qemu-devel] [PATCH 07/12] migration: use closesocket, not close

2012-10-28 Thread Orit Wasserman
,7 +115,7 @@ static void tcp_accept_incoming_migration(void *opaque) > process_incoming_migration(f); > qemu_fclose(f); > out: > -close(c); > +closesocket(c); > } > > int tcp_start_incoming_migration(const char *host_port, Error **errp) > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 08/12] migration: xxx_close will only be called once

2012-10-28 Thread Orit Wasserman
1; > +if (closesocket(s->fd) < 0) { > +r = -socket_error(); > } > return r; > } > diff --git a/migration-unix.c b/migration-unix.c > index a407af2..def1969 100644 > --- a/migration-unix.c > +++ b/migration-unix.c > @@ -44,11 +44,8 @@ static int unix_close(MigrationState *s) > { > int r = 0; > DPRINTF("unix_close\n"); > -if (s->fd != -1) { > -if (close(s->fd) < 0) { > -r = -errno; > -} > -s->fd = -1; > +if (close(s->fd) < 0) { > +r = -errno; > } > return r; > } > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 09/12] migration: close socket QEMUFile from socket_close

2012-10-28 Thread Orit Wasserman
atic int socket_get_buffer(void *opaque, uint8_t *buf, > int64_t pos, int size) > static int socket_close(void *opaque) > { > QEMUFileSocket *s = opaque; > +closesocket(s->fd); > g_free(s); > return 0; > } > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 10/12] migration: move qemu_fclose to process_incoming_migration

2012-10-28 Thread Orit Wasserman
t qemu_start_incoming_migration(const char *uri, Error > **errp) > > void process_incoming_migration(QEMUFile *f) > { > -if (qemu_loadvm_state(f) < 0) { > + int ret; > + > +ret = qemu_loadvm_state(f); > +qemu_fclose(f); > +if (ret < 0) { > fprintf(stderr, "load of migration failed\n"); > exit(0); > } > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 11/12] migration: handle EAGAIN while reading QEMUFile

2012-10-28 Thread Orit Wasserman
On 10/18/2012 12:22 PM, Paolo Bonzini wrote: > This will never happen right now (the assertion would fail). The > next patch will set the socket or pipe in non-blocking mode, thus > enabling this part of the code. > > Coroutines can just stop whenever they want with qemu_coroutine_yield. > As soo

Re: [Qemu-devel] [PATCH 12/12] migration: move process_incoming_migration to a coroutine

2012-10-28 Thread Orit Wasserman
_set_nonblock(fd); > +qemu_set_fd_handler(fd, enter_migration_coroutine, NULL, co); > +qemu_coroutine_enter(co, f); > +} > + > /* amount of nanoseconds we are willing to wait for migration to be down. > * the choice of nanoseconds is because it is the maximum resolution that > * get_clock() can achieve. It is an internal measure. All user-visible > Reviewed-by: Orit Wasserman

Re: [Qemu-devel] [PATCH 30/30] ram: optimize migration bitmap walking

2012-10-30 Thread Orit Wasserman
On 10/28/2012 10:35 AM, Orit Wasserman wrote: > On 10/26/2012 01:39 PM, Juan Quintela wrote: >> Orit Wasserman wrote: >>> On 10/18/2012 09:30 AM, Juan Quintela wrote: >>>> Instead of testing each page individually, we search what is the next >>>> dirty

  1   2   3   4   5   6   7   8   >