[Qemu-devel] [PATCH 1/5] qemu-fd-exchange: provide common methods for exchange fd

2014-01-23 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/qemu/fd-exchange.h | 25 +++ util/Makefile.objs |1 + util/qemu-fd-exchange.c| 97 3 files changed, 123 insertions(+), 0 deletions(-) create mode 100644 include

[Qemu-devel] [PATCH 5/5] virtio-9p-proxy: replace v9fs_receivefd with qemu_recv_with_fd

2014-01-23 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- hw/9pfs/virtio-9p-proxy.c | 60 ++-- 1 files changed, 3 insertions(+), 57 deletions(-) diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c index 5f44bb7..f34b845 100644 --- a/hw/9pfs

[Qemu-devel] [PATCH 0/5 v2] Provide common methods for exchange FD

2014-01-23 Thread Lei Li
help on verifying whether it has impact on it. :) Please let me know if there is anything needs to be improved. Thanks Changes since V1: -- Copy right and typo fixes pointed out by Eric. -- Don't cast 'char *' to 'int *' from Daniel. -- Get rid of local migration part. Lei Li (5): fd

[Qemu-devel] [PATCH 4/5] virtfs-proxy-helper: replace send_fd with qemu_send_with_fd

2014-01-23 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- fsdev/virtfs-proxy-helper.c | 51 ++ hw/9pfs/virtio-9p-proxy.h |5 2 files changed, 8 insertions(+), 48 deletions(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c

[Qemu-devel] [PATCH 2/5] qemu-bridge-helper: replace send_fd with qemu_send_with_fd

2014-01-23 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- Makefile |2 +- qemu-bridge-helper.c | 31 +++ 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index bdff4e4..6850f35 100644 --- a/Makefile +++ b/Makefile @@ -195,7

[Qemu-devel] [PATCH 3/5] net/tap: replace recv_fd with qemu_recv_with_fd

2014-01-23 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- net/tap.c | 40 +++- 1 files changed, 3 insertions(+), 37 deletions(-) diff --git a/net/tap.c b/net/tap.c index 39c1cda..97ee2e8 100644 --- a/net/tap.c +++ b/net/tap.c @@ -39,6 +39,7 @@ #include sysemu

Re: [Qemu-devel] [PATCH 1/6] qemu-fd-exchange: provide common methods for exchange fd

2014-01-19 Thread Lei Li
On 01/17/2014 06:02 PM, Daniel P. Berrange wrote: On Wed, Jan 08, 2014 at 05:12:51PM +0800, Lei Li wrote: Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/qemu/fd-exchange.h | 25 +++ util/Makefile.objs |1 + util/qemu-fd-exchange.c| 97

Re: [Qemu-devel] [PATCH resend 0/6 RFC] Provide common methods for exchange FD

2014-01-16 Thread Lei Li
Any comments? On 01/08/2014 05:12 PM, Lei Li wrote: This patch series tries to refactor the functions used for exchange of FD in current code, provide common methods for it. The series is based on the localhost migration with side channel for ram series as it was already a good shape

Re: [Qemu-devel] [PATCH 5/6] virtio-9p-proxy: replace v9fs_receivefd with qemu_recv_with_fd

2014-01-16 Thread Lei Li
On 01/16/2014 06:16 PM, Daniel P. Berrange wrote: On Wed, Jan 08, 2014 at 05:12:55PM +0800, Lei Li wrote: Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- hw/9pfs/virtio-9p-proxy.c | 60 ++-- 1 files changed, 3 insertions(+), 57 deletions(-) diff

Re: [Qemu-devel] [PATCH 1/6] qemu-fd-exchange: provide common methods for exchange fd

2014-01-16 Thread Lei Li
On 01/16/2014 11:16 PM, Eric Blake wrote: On 01/08/2014 02:12 AM, Lei Li wrote: Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/qemu/fd-exchange.h | 25 +++ util/Makefile.objs |1 + util/qemu-fd-exchange.c| 97

Re: [Qemu-devel] [PATCH 4/6] virtfs-proxy-helper: replace send_fd with qemu_send_with_fd

2014-01-16 Thread Lei Li
On 01/16/2014 06:15 PM, Daniel P. Berrange wrote: On Wed, Jan 08, 2014 at 05:12:54PM +0800, Lei Li wrote: Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- fsdev/virtfs-proxy-helper.c | 51 ++ hw/9pfs/virtio-9p-proxy.h |5 2 files

Re: [Qemu-devel] [PATCH 1/6] qemu-fd-exchange: provide common methods for exchange fd

2014-01-16 Thread Lei Li
On 01/16/2014 11:26 PM, Eric Blake wrote: On 01/08/2014 02:12 AM, Lei Li wrote: Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/qemu/fd-exchange.h | 25 +++ util/Makefile.objs |1 + util/qemu-fd-exchange.c| 97

[Qemu-devel] [PATCH 2/6] qemu-bridge-helper: replace send_fd with qemu_send_with_fd

2014-01-08 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- Makefile |2 +- qemu-bridge-helper.c | 31 +++ 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index bdff4e4..6850f35 100644 --- a/Makefile +++ b/Makefile @@ -195,7

[Qemu-devel] [PATCH resend 0/6 RFC] Provide common methods for exchange FD

2014-01-08 Thread Lei Li
. Lei Li (6): fd-exchange: provide common methods for exchange of fd qemu-bridge-helper: replace send_fd with qemu_send_with_fd net/tap: replace recv_fd with qemu_recv_with_fd virtfs-proxy-helper: replace send_fd with qemu_send_with_fd virtio-9p-proxy: replace v9fs_receivefd

[Qemu-devel] [PATCH 4/6] virtfs-proxy-helper: replace send_fd with qemu_send_with_fd

2014-01-08 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- fsdev/virtfs-proxy-helper.c | 51 ++ hw/9pfs/virtio-9p-proxy.h |5 2 files changed, 8 insertions(+), 48 deletions(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c

[Qemu-devel] [PATCH 5/6] virtio-9p-proxy: replace v9fs_receivefd with qemu_recv_with_fd

2014-01-08 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- hw/9pfs/virtio-9p-proxy.c | 60 ++-- 1 files changed, 3 insertions(+), 57 deletions(-) diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c index 5f44bb7..f34b845 100644 --- a/hw/9pfs

[Qemu-devel] [PATCH 6/6] migration-local: replace send_pipefd with qemu_send_with_fd

2014-01-08 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 52 +++- 1 files changed, 3 insertions(+), 49 deletions(-) diff --git a/migration-local.c b/migration-local.c index ce4c070..c01ba06 100644 --- a/migration-local.c +++ b

[Qemu-devel] [PATCH 1/6] qemu-fd-exchange: provide common methods for exchange fd

2014-01-08 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/qemu/fd-exchange.h | 25 +++ util/Makefile.objs |1 + util/qemu-fd-exchange.c| 97 3 files changed, 123 insertions(+), 0 deletions(-) create mode 100644 include

[Qemu-devel] [PATCH 3/6] net/tap: replace recv_fd with qemu_recv_with_fd

2014-01-08 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- net/tap.c | 40 +++- 1 files changed, 3 insertions(+), 37 deletions(-) diff --git a/net/tap.c b/net/tap.c index 39c1cda..97ee2e8 100644 --- a/net/tap.c +++ b/net/tap.c @@ -39,6 +39,7 @@ #include sysemu

Re: [Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()

2013-12-03 Thread Lei Li
On 12/02/2013 05:33 PM, Daniel P. Berrange wrote: On Mon, Dec 02, 2013 at 05:19:06PM +0800, Lei Li wrote: This patch adds send_pipefd() to pass the pipe file descriptor to destination process. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 46

Re: [Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()

2013-12-03 Thread Lei Li
On 12/03/2013 07:35 PM, Daniel P. Berrange wrote: On Tue, Dec 03, 2013 at 07:19:40PM +0800, Lei Li wrote: On 12/02/2013 05:33 PM, Daniel P. Berrange wrote: On Mon, Dec 02, 2013 at 05:19:06PM +0800, Lei Li wrote: This patch adds send_pipefd() to pass the pipe file descriptor to destination

Re: [Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()

2013-12-03 Thread Lei Li
On 12/03/2013 07:52 PM, Paolo Bonzini wrote: Il 03/12/2013 12:19, Lei Li ha scritto: On 12/02/2013 05:33 PM, Daniel P. Berrange wrote: On Mon, Dec 02, 2013 at 05:19:06PM +0800, Lei Li wrote: This patch adds send_pipefd() to pass the pipe file descriptor to destination process. Signed-off

Re: [Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()

2013-12-02 Thread Lei Li
On 11/29/2013 07:14 PM, Daniel P. Berrange wrote: On Fri, Nov 29, 2013 at 06:06:13PM +0800, Lei Li wrote: This patch adds send_pipefd() to pass the pipe file descriptor to destination process. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 46

Re: [Qemu-devel] [PATCH 0/17 v4] Localhost migration with side channel for ram

2013-12-02 Thread Lei Li
On 11/29/2013 06:26 PM, Paolo Bonzini wrote: Il 29/11/2013 11:06, Lei Li ha scritto: This patch series tries to introduce a mechanism using side channel pipe for RAM via SCM_RIGHTS with unix domain socket protocol migration. This side channel is used for the page flipping by vmsplice, which

[Qemu-devel] [PATCH 02/17] migration: add migrate_unix_page_flipping()

2013-12-02 Thread Lei Li
Add migrate_unix_page_flipping() to check if MIGRATION_CAPABILITY_X_UNIX_PAGE_FLIPPING is enabled. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/migration/migration.h |3 +++ migration.c |9 + 2 files

[Qemu-devel] [PATCH 01/17] QAPI: introduce migration capability x_unix_page_flipping

2013-12-02 Thread Lei Li
Introduce x_unix_page_flipping to MigrationCapability for localhost migration. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qapi-schema.json | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/qapi

[Qemu-devel] [PATCH 04/17] migration-local: add QEMUFileLocal with socket based QEMUFile

2013-12-02 Thread Lei Li
This patch adds QEMUFileLocal with copy of socket based QEMUFile, will be used as the basis code for Unix socket protocol migration and page flipping migration. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- Makefile.target |1 + migration-local.c | 123

[Qemu-devel] [PATCH 0/17 v5] Localhost migration with side channel for ram

2013-12-02 Thread Lei Li
process with page flipping. Lei Li (17): QAPI: introduce magration capability unix_page_flipping migration: add migrate_unix_page_flipping() qmp-command.hx: add missing docs for migration capabilites migration-local: add QEMUFileLocal with socket based QEMUFile migration-local: introduce

[Qemu-devel] [PATCH 05/17] migration-local: introduce qemu_fopen_socket_local()

2013-12-02 Thread Lei Li
Add qemu_fopen_socket_local() to open QEMUFileLocal introduced earlier. It will create a pipe in write mode if unix_page_flipping is enabled, adjust qemu_local_close() to close pipe as well. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/migration/qemu-file.h |2 + migration

[Qemu-devel] [PATCH 03/17] qmp-command.hx: add missing docs for migration capabilites

2013-12-02 Thread Lei Li
Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qmp-commands.hx |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index fba15cd..0df08c0 100644 --- a/qmp-commands.hx +++ b/qmp

[Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()

2013-12-02 Thread Lei Li
This patch adds send_pipefd() to pass the pipe file descriptor to destination process. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/migration-local.c b

[Qemu-devel] [PATCH 08/17] migration-local: override save_page for page transmit

2013-12-02 Thread Lei Li
it in incoming side as well. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 63 + 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/migration-local.c b/migration-local.c index f479530..9453ec8 100644 --- a/migration

[Qemu-devel] [PATCH 09/17] savevm: adjust ram_control_save_page for page flipping

2013-12-02 Thread Lei Li
Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- savevm.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/savevm.c b/savevm.c index 06c1f29..137e74f 100644 --- a/savevm.c +++ b/savevm.c @@ -668,7 +668,8 @@ size_t ram_control_save_page(QEMUFile

[Qemu-devel] [PATCH 12/17] migration-local: override hook_ram_load

2013-12-02 Thread Lei Li
Override hook_ram_load to receive the pipe file descriptor passed by source process and page address which will be extracted to vmsplice the page data from pipe. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 59 + 1

[Qemu-devel] [PATCH 07/17] save_page: replace block_offset with a MemoryRegion

2013-12-02 Thread Lei Li
This patch exports MemoryRegion to save_page hook, replacing argument ram_addr_t block_offset with a MemoryRegion suggested by Paolo Bonzini. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- arch_init.c |4 ++-- include/migration/migration.h |2 +- include/migration

[Qemu-devel] [PATCH 14/17] add new RunState RUN_STATE_MEMORY_STALE

2013-12-02 Thread Lei Li
Introduce new RunState RUN_STATE_MEMORY_STALE and add it to runstate_needs_reset(). Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qapi-schema.json |7 +-- vl.c | 13 - 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/qapi-schema.json b/qapi

[Qemu-devel] [PATCH 17/17] hmp: better format for info migrate_capabilities

2013-12-02 Thread Lei Li
As there might be more capabilities introduced, better to display it in lines. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- hmp.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hmp.c b/hmp.c index 32ee285..dcfa2f9

[Qemu-devel] [PATCH 15/17] migration-unix: page flipping support on unix outgoing

2013-12-02 Thread Lei Li
Add page flipping support on unix outgoing part by stopping VM with the new RunState RUN_STATE_MEMORY_STALE before invoking migration if unix_page_flipping enabled. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-unix.c | 11 +++ 1 files changed, 11 insertions(+), 0

[Qemu-devel] [PATCH 16/17] migration: adjust migration_thread() process for page flipping

2013-12-02 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/migration.c b/migration.c index e012cd4..7e0ec33 100644 --- a/migration.c +++ b/migration.c @@ -582,7 +582,7 @@ static void *migration_thread(void *opaque

[Qemu-devel] [PATCH 10/17] add unix_msgfd_lookup() to callback get_buffer

2013-12-02 Thread Lei Li
be caughted. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 59 ++-- 1 files changed, 56 insertions(+), 3 deletions(-) diff --git a/migration-local.c b/migration-local.c index 9453ec8..5f98a01 100644 --- a/migration-local.c

[Qemu-devel] [PATCH 11/17] add argument ram_addr_t to hook_ram_load

2013-12-02 Thread Lei Li
Adds argument ram_addr_t to hook_ram_load, and replaces QEMURamHookFunc with QEMURamLoadHookFunc for it. With this new argument, it will allow cut almost half of the data transferred on the Unix socket using by page flipping migraton. Signed-off-by: Lei Li li...@linux.vnet.ibm.com

[Qemu-devel] [PATCH 05/17] migration-local: introduce qemu_fopen_socket_local()

2013-11-29 Thread Lei Li
Add qemu_fopen_socket_local() to open QEMUFileLocal introduced earlier. It will create a pipe in write mode if unix_page_flipping is enabled, adjust qemu_local_close() to close pipe as well. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/migration/qemu-file.h |2 + migration

[Qemu-devel] [PATCH 01/17] QAPI: introduce migration capability unix_page_flipping

2013-11-29 Thread Lei Li
Introduce unix_page_flipping to MigrationCapability for localhost migration. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qapi-schema.json | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/qapi-schema.json b

[Qemu-devel] [PATCH 0/17 v4] Localhost migration with side channel for ram

2013-11-29 Thread Lei Li
of overriding RDMA hooks. - Involve the vmsplice for page flipping. - Add new RunState RUN_STATE_FLIPPING_MIGRATE and add it to runstate_needs_reset() for the adjustment of the current migration process with page flipping. Lei Li (17): QAPI: introduce magration capability

[Qemu-devel] [PATCH 03/17] qmp-command.hx: add missing docs for migration capabilites

2013-11-29 Thread Lei Li
Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qmp-commands.hx |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index fba15cd..dcec433 100644 --- a/qmp-commands.hx +++ b/qmp

[Qemu-devel] [PATCH 02/17] migration: add migrate_unix_page_flipping()

2013-11-29 Thread Lei Li
Add migrate_unix_page_flipping() to check if MIGRATION_CAPABILITY_UNIX_PAGE_FLIPPING is enabled. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/migration/migration.h |3 +++ migration.c |9 + 2 files

[Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()

2013-11-29 Thread Lei Li
This patch adds send_pipefd() to pass the pipe file descriptor to destination process. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/migration-local.c b

[Qemu-devel] [PATCH 10/17] add unix_msgfd_lookup() to callback get_buffer

2013-11-29 Thread Lei Li
be caughted. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 59 ++-- 1 files changed, 56 insertions(+), 3 deletions(-) diff --git a/migration-local.c b/migration-local.c index 0a41c69..76ec306 100644 --- a/migration-local.c

[Qemu-devel] [PATCH 14/17] add new RanState RAN_STATE_MEMORY_STALE

2013-11-29 Thread Lei Li
Introduce new RanState RAN_STATE_MEMORY_STALE and add it to runstate_needs_reset(). Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qapi-schema.json |7 +-- vl.c | 13 - 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/qapi-schema.json b/qapi

[Qemu-devel] [PATCH 07/17] save_page: replace block_offset with a MemoryRegion

2013-11-29 Thread Lei Li
This patch exports MemoryRegion to save_page hook, replacing argument ram_addr_t block_offset with a MemoryRegion suggested by Paolo Bonzini. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- arch_init.c |4 ++-- include/migration/migration.h |2 +- include/migration

[Qemu-devel] [PATCH 11/17] add argument ram_addr_t to hook_ram_load

2013-11-29 Thread Lei Li
Adds argument ram_addr_t to hook_ram_load, and replaces QEMURamHookFunc with QEMURamLoadHookFunc for it. With this new argument, it will allows cut almost half of the data transferred on the Unix socket using by page flipping migraton. Signed-off-by: Lei Li li...@linux.vnet.ibm.com

[Qemu-devel] [PATCH 08/17] migration-local: override save_page for page transmit

2013-11-29 Thread Lei Li
it in incoming side as well. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 63 + 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/migration-local.c b/migration-local.c index f479530..0a41c69 100644 --- a/migration

[Qemu-devel] [PATCH 17/17] hmp: better format for info migrate_capabilities

2013-11-29 Thread Lei Li
As there might be more capabilities introduced, better to display it in lines. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- hmp.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hmp.c b/hmp.c index 32ee285..dcfa2f9

[Qemu-devel] [PATCH 09/17] savevm: adjust ram_control_save_page for page flipping

2013-11-29 Thread Lei Li
Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- savevm.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/savevm.c b/savevm.c index 06c1f29..137e74f 100644 --- a/savevm.c +++ b/savevm.c @@ -668,7 +668,8 @@ size_t ram_control_save_page(QEMUFile

[Qemu-devel] [PATCH 13/17] migration-unix: replace qemu_fopen_socket with qemu_fopen_socket_local

2013-11-29 Thread Lei Li
Relace qemu_fopen_socket with qemu_fopen_socket_local in Unix protocol migration. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-unix.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/migration-unix.c b/migration-unix.c index 651fc5b

[Qemu-devel] [PATCH 15/17] migration-unix: page flipping support on unix outgoing

2013-11-29 Thread Lei Li
Add page flipping support on unix outgoing part by stopping VM with the new RunState RUN_STATE_MEMORY_STALE before invoking migration if unix_page_flipping enabled. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-unix.c | 11 +++ 1 files changed, 11 insertions(+), 0

[Qemu-devel] [PATCH 16/17] migration: adjust migration_thread() process for page flipping

2013-11-29 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/migration.c b/migration.c index 4ac466b..68b5b02 100644 --- a/migration.c +++ b/migration.c @@ -582,7 +582,7 @@ static void *migration_thread(void *opaque

[Qemu-devel] [PATCH 04/17] migration-local: add QEMUFileLocal with socket based QEMUFile

2013-11-29 Thread Lei Li
This patch adds QEMUFileLocal with copy of socket based QEMUFile, will be used as the basis code for Unix socket protocol migration and page flipping migration. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- Makefile.target |1 + migration-local.c | 123

[Qemu-devel] [PATCH 12/17] migration-local: override hook_ram_load

2013-11-29 Thread Lei Li
Override hook_ram_load to receive the pipe file descriptor passed by source process and page address which will be extracted to vmsplice the page data from pipe. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 59 + 1

Re: [Qemu-devel] [PATCH 16/17] migration: adjust migration_thread() process for page flipping

2013-11-28 Thread Lei Li
On 11/26/2013 10:11 PM, Paolo Bonzini wrote: Il 26/11/2013 14:53, Lei Li ha scritto: 1) ram_save_setup stage, it will send all the bytes in this stages to destination, and send_pipefd by ram_control_before_iterate at the end of it. ram_save_setup runs doesn't send anything from guest

Re: [Qemu-devel] [PATCH 0/17 v3] Localhost migration with side channel for ram

2013-11-26 Thread Lei Li
On 11/25/2013 05:48 PM, Paolo Bonzini wrote: Il 25/11/2013 08:29, Lei Li ha scritto: In this case, if the migration would fail just because the misconfiguration of device state on destination, in the meantime the outgoing migration has no aware of this failure, I think it should add

Re: [Qemu-devel] [PATCH 08/17] add unix_msgfd_lookup() to callback get_buffer

2013-11-26 Thread Lei Li
On 11/21/2013 05:11 PM, Lei Li wrote: The control message for exchange of pipe file descriptor should be received by recvmsg, and it might be eaten to stream file by qemu_recv() when receiving by two callbacks. So this patch adds unix_msgfd_lookup() to callback get_buffer as the only one

Re: [Qemu-devel] [PATCH 16/17] migration: adjust migration_thread() process for page flipping

2013-11-26 Thread Lei Li
On 11/26/2013 07:32 PM, Paolo Bonzini wrote: Il 21/11/2013 10:11, Lei Li ha scritto: Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/migration.c b/migration.c index 4ac466b..0f98ac1 100644

Re: [Qemu-devel] [PATCH 10/17] migration-local: override save_page for page transmit

2013-11-26 Thread Lei Li
On 11/26/2013 07:22 PM, Paolo Bonzini wrote: Il 21/11/2013 10:11, Lei Li ha scritto: This patch implements save_page callback for the outside of page flipping. It will write the address of the page on the Unix socket and flip the page data on pipe by vmsplice(). Every page address would have

Re: [Qemu-devel] [PATCH 12/17] migration-local: override hook_ram_load

2013-11-26 Thread Lei Li
On 11/26/2013 07:25 PM, Paolo Bonzini wrote: Il 21/11/2013 10:11, Lei Li ha scritto: +static int qemu_local_ram_load(QEMUFile *f, void *opaque, + uint64_t flags) +{ +QEMUFileLocal *s = opaque; +ram_addr_t addr; +struct iovec iov; +ssize_t ret

Re: [Qemu-devel] [PATCH 16/17] migration: adjust migration_thread() process for page flipping

2013-11-26 Thread Lei Li
On 11/26/2013 08:54 PM, Paolo Bonzini wrote: Il 26/11/2013 13:03, Lei Li ha scritto: +if (pending_size pending_size = max_size +!runstate_needs_reset()) { qemu_savevm_state_iterate(s-file); I'm not sure why you need this. The adjustment here

Re: [Qemu-devel] [PATCH 08/17] add unix_msgfd_lookup() to callback get_buffer

2013-11-26 Thread Lei Li
On 11/26/2013 07:31 PM, Paolo Bonzini wrote: Il 21/11/2013 10:11, Lei Li ha scritto: +/* + * recvmsg is called here to catch the control message for + * the exchange of PIPE file descriptor until it is received. + */ +len = recvmsg(s

Re: [Qemu-devel] [PATCH 14/17] add new RanState RAN_STATE_MEMORY_STALE

2013-11-26 Thread Lei Li
On 11/26/2013 08:28 PM, Paolo Bonzini wrote: Il 21/11/2013 10:11, Lei Li ha scritto: { RUN_STATE_DEBUG, RUN_STATE_SUSPENDED }, DEBUG - MEMORY_STALE is missing. Good catch, I will add it, thanks. :) Paolo { RUN_STATE_RUNNING, RUN_STATE_SUSPENDED

Re: [Qemu-devel] [PATCH 0/17 v3] Localhost migration with side channel for ram

2013-11-24 Thread Lei Li
On 11/22/2013 07:36 PM, Paolo Bonzini wrote: Il 22/11/2013 12:29, Lei Li ha scritto: During the page flipping migration, ram page of source guest would be flipped to the destination, that's why the source guest can not be resumed. AFAICT, the page flipping migration may fail at the connection

Re: [Qemu-devel] [PATCH 0/17 v3] Localhost migration with side channel for ram

2013-11-22 Thread Lei Li
On 11/21/2013 06:19 PM, Daniel P. Berrange wrote: On Thu, Nov 21, 2013 at 05:11:23PM +0800, Lei Li wrote: This patch series tries to introduce a mechanism using side channel pipe for RAM via SCM_RIGHTS with unix domain socket protocol migration. This side channel is used for the page flipping

Re: [Qemu-devel] [PATCH 0/17 v2] Localhost migration with side channel for ram

2013-11-21 Thread Lei Li
On 10/25/2013 08:24 PM, Lei Li wrote: On 10/25/2013 03:30 PM, Paolo Bonzini wrote: Il 25/10/2013 06:58, Lei Li ha scritto: Right now just has inaccurate numbers without the new vmsplice, which based on the result from info migrate, as the guest ram size increases, although the 'total time

[Qemu-devel] [PATCH 02/17] migration: add migrate_unix_page_flipping()

2013-11-21 Thread Lei Li
Add migrate_unix_page_flipping() to check if MIGRATION_CAPABILITY_UNIX_PAGE_FLIPPING is enabled. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/migration/migration.h |3 +++ migration.c |9 + 2 files

[Qemu-devel] [PATCH 08/17] add unix_msgfd_lookup() to callback get_buffer

2013-11-21 Thread Lei Li
be caughted. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 68 ++-- 1 files changed, 65 insertions(+), 3 deletions(-) diff --git a/migration-local.c b/migration-local.c index e028beb..0f0896b 100644 --- a/migration-local.c

[Qemu-devel] [PATCH 01/17] QAPI: introduce migration capability unix_page_flipping

2013-11-21 Thread Lei Li
Introduce unix_page_flipping to MigrationCapability for localhost migration. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qapi-schema.json | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/qapi-schema.json b

[Qemu-devel] [PATCH 05/17] migration-local: introduce qemu_fopen_socket_local()

2013-11-21 Thread Lei Li
Add qemu_fopen_socket_local() to open QEMUFileLocal introduced earlier. It will create a pipe in write mode if unix_page_flipping is enabled, adjust qemu_local_close() to close pipe as well. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/migration/qemu-file.h |2 + migration

[Qemu-devel] [PATCH 03/17] qmp-command.hx: add missing docs for migration capabilites

2013-11-21 Thread Lei Li
Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qmp-commands.hx |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index fba15cd..dcec433 100644 --- a/qmp-commands.hx +++ b/qmp

[Qemu-devel] [PATCH 07/17] migration-local: override before_ram_iterate to send pipefd

2013-11-21 Thread Lei Li
Override before_ram_iterate to send pipefd. It will qemu_fflush the stream QEMUFile and send it in RAM_CONTROL_SETUP stage. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git

[Qemu-devel] [PATCH 06/17] migration-local: add send_pipefd()

2013-11-21 Thread Lei Li
This patch adds send_pipefd() to pass the pipe file descriptor to destination process. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 53 + 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/migration

[Qemu-devel] [PATCH 13/17] migration-unix: replace qemu_fopen_socket with qemu_fopen_socket_local

2013-11-21 Thread Lei Li
Relace qemu_fopen_socket with qemu_fopen_socket_local in Unix protocol migration. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-unix.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/migration-unix.c b/migration-unix.c index 651fc5b

[Qemu-devel] [PATCH 11/17] savevm: adjust ram_control_save_page for page flipping

2013-11-21 Thread Lei Li
Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- savevm.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/savevm.c b/savevm.c index 3ee256e..4576145 100644 --- a/savevm.c +++ b/savevm.c @@ -668,7 +668,8 @@ size_t ram_control_save_page(QEMUFile

[Qemu-devel] [PATCH 15/17] migration-unix: page flipping support on unix outgoing

2013-11-21 Thread Lei Li
Add page flipping support on unix outgoing part by stopping VM with the new RunState RUN_STATE_MEMORY_STALE before invoking migration if unix_page_flipping enabled. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-unix.c | 11 +++ 1 files changed, 11 insertions(+), 0

[Qemu-devel] [PATCH 16/17] migration: adjust migration_thread() process for page flipping

2013-11-21 Thread Lei Li
Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/migration.c b/migration.c index 4ac466b..0f98ac1 100644 --- a/migration.c +++ b/migration.c @@ -579,10 +579,11 @@ static void *migration_thread(void

[Qemu-devel] [PATCH 09/17] save_page: replace block_offset with a MemoryRegion

2013-11-21 Thread Lei Li
This patch exports MemoryRegion to save_page hook, replacing argument ram_addr_t block_offset with a MemoryRegion suggested by Paolo Bonzini. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- arch_init.c |4 ++-- include/migration/migration.h |2 +- include/migration

[Qemu-devel] [PATCH 17/17] hmp: better format for info migrate_capabilities

2013-11-21 Thread Lei Li
As there might be more capabilities introduced, better to display it in lines. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- hmp.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hmp.c b/hmp.c index 32ee285..dcfa2f9

[Qemu-devel] [PATCH 04/17] migration-local: add QEMUFileLocal with socket based QEMUFile

2013-11-21 Thread Lei Li
This patch adds QEMUFileLocal with copy of socket based QEMUFile, will be used as the basis code for Unix socket protocol migration and page flipping migration. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- Makefile.target |1 + migration-local.c | 121

[Qemu-devel] [PATCH 0/17 v3] Localhost migration with side channel for ram

2013-11-21 Thread Lei Li
it to runstate_needs_reset() for the adjustment of the current migration process with page flipping. Lei Li (17): QAPI: introduce magration capability unix_page_flipping migration: add migrate_unix_page_flipping() qmp-command.hx: add missing docs for migration capabilites migration-local: add

[Qemu-devel] [PATCH 14/17] add new RanState RAN_STATE_MEMORY_STALE

2013-11-21 Thread Lei Li
Introduce new RanState RAN_STATE_MEMORY_STALE and add it to runstate_needs_reset(). Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qapi-schema.json |7 +-- vl.c | 12 +++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/qapi-schema.json b/qapi

[Qemu-devel] [PATCH 10/17] migration-local: override save_page for page transmit

2013-11-21 Thread Lei Li
it in incoming side as well. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 54 + 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/migration-local.c b/migration-local.c index 0f0896b..14207e9 100644 --- a/migration

[Qemu-devel] [PATCH 12/17] migration-local: override hook_ram_load

2013-11-21 Thread Lei Li
Override hook_ram_load to receive the pipe file descriptor passed by source process and page address which will be extracted to vmsplice the page data from pipe. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- migration-local.c | 55 + 1

[Qemu-devel] [PATCH resend] save_page: replace block_offset with a MemoryRegion

2013-11-06 Thread Lei Li
This patch exports MemoryRegion to save_page hook, replacing argument ram_addr_t block_offset with a MemoryRegion suggested by Paolo Bonzini. Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- arch_init.c |4 ++-- include/migration/migration.h |2 +- include/migration

Re: [Qemu-devel] [PATCH resend] sdl: Reverse support for video mode setting

2013-11-06 Thread Lei Li
Ping^2 On 10/24/2013 08:21 PM, Lei Li wrote: This patch has been confirmed by the reporter himself as link below, https://bugs.launchpad.net/qemu/+bug/1216368 It has been on the mailing list for a while, could it be merged? PING... On 09/04/2013 05:07 PM, Lei Li wrote: Currently

Re: [Qemu-devel] [PATCH 09/17] migration-local: override before_ram_iterate to send pipefd

2013-10-25 Thread Lei Li
On 10/25/2013 03:23 PM, Paolo Bonzini wrote: Il 25/10/2013 05:38, Lei Li ha scritto: Just want to confirm, normally, should I take these 'otherwise looks good/ok' as a 'Reviewed-by' from you If the other comment is fixed in the update version? Depends on how much the patch changes... right now

Re: [Qemu-devel] [PATCH 14/17] add new RanState RAN_STATE_FLIPPING_MIGRATE

2013-10-25 Thread Lei Li
On 10/25/2013 03:31 PM, Paolo Bonzini wrote: Il 25/10/2013 05:30, Lei Li ha scritto: I am not sure about the name; for one thing, the new state would apply also to postcopy migration. About the name, how about 'live-upgrade'? OK, I'll add the transition between postcopy and this new state

Re: [Qemu-devel] [PATCH 0/17 v2] Localhost migration with side channel for ram

2013-10-25 Thread Lei Li
On 10/25/2013 03:30 PM, Paolo Bonzini wrote: Il 25/10/2013 06:58, Lei Li ha scritto: Right now just has inaccurate numbers without the new vmsplice, which based on the result from info migrate, as the guest ram size increases, although the 'total time' is number of times less compared

[Qemu-devel] [PATCH 0/3 for 1.7] migration: introduce page flipping capability

2013-10-25 Thread Lei Li
This series is extracted from the lastest localhost migration with side channel for ram patch set with comments from Paolo fixed. Send it separately according to his suggestion. Localhost migration with side channel for ram: http://lists.gnu.org/archive/html/qemu-devel/2013-10/msg02787.html Lei

[Qemu-devel] [PATCH 3/3] qmp-command.hx: add missing docs for migration capabilites

2013-10-25 Thread Lei Li
Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qmp-commands.hx |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index fba15cd..dcec433 100644 --- a/qmp-commands.hx +++ b/qmp

[Qemu-devel] [PATCH 1/3] QAPI: introduce magration capability unix_page_flipping

2013-10-25 Thread Lei Li
Introduce unix_page_flipping to MigrationCapability for localhost migration. Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- qapi-schema.json | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/qapi-schema.json b

[Qemu-devel] [PATCH 2/3] migration: add migrate_unix_page_flipping()

2013-10-25 Thread Lei Li
Add migrate_unix_page_flipping() to check if MIGRATION_CAPABILITY_UNIX_PAGE_FLIPPING is enabled. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Lei Li li...@linux.vnet.ibm.com --- include/migration/migration.h |3 +++ migration.c |9 + 2 files

Re: [Qemu-devel] [PATCH resend] sdl: Reverse support for video mode setting

2013-10-24 Thread Lei Li
This patch has been confirmed by the reporter himself as link below, https://bugs.launchpad.net/qemu/+bug/1216368 It has been on the mailing list for a while, could it be merged? PING... On 09/04/2013 05:07 PM, Lei Li wrote: Currently, If the setting of video mode failed, qemu will exit

Re: [Qemu-devel] [PATCH 01/17] rename is_active to is_block_active

2013-10-24 Thread Lei Li
On 10/24/2013 09:46 PM, Paolo Bonzini wrote: Il 22/10/2013 04:25, Lei Li ha scritto: is_active is used to identify block migration, rename to is_block_active to make it more clear. No, is_active is used to identify whether a set of SaveVMHandlers is active. The default is true, so only block

  1   2   3   4   5   >