migration queue
From: "Dr. David Alan Gilbert" <[email protected]>
The following changes since commit 4c2c1015905fa1d616750dfe024b4c0b35875950:
Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20180323' into staging (2018-03-23 10:20:54 +0000)
are available in the Git repository at:
git://github.com/dagrh/qemu.git tags/pull-migration-20180323a
for you to fetch changes up to 09576e74dbe697c5f0a7bc2ad7b59601457a2ff4:
migration: Fix block migration flag case (2018-03-23 18:24:11 +0000)
----------------------------------------------------------------
Migration fixes for 2.12
All small fixes. Dan's is a missing piece of a cleanup that finally completes something, and between Paolo, Dan and myself we recon it's still on the edge of being a bug fix.
----------------------------------------------------------------
Daniel P. Berrangé (1):
migration: convert socket server to QIONetListener
Dr. David Alan Gilbert (1):
migration: Fix block migration flag case
Lidong Chen (1):
migration: Fix rate limiting issue on RDMA migration
Peter Lieven (2):
migration/block: limit the number of parallel I/O requests migration/block: compare only read blocks against the rate limiter
migration/block.c | 5 +++-- migration/migration.c | 1 + migration/qemu-file.c | 2 +- migration/socket.c | 48 ++++++++++++++++-------------------------------- 4 files changed, 21 insertions(+), 35 deletions(-)
[Qemu-devel] [PULL 1/5] migration: convert socket server to QIONetListener
From: "Daniel P. Berrange" <[email protected]>
Instead of creating a QIOChannelSocket directly for the migration server socket, use a QIONetListener. This provides the ability to listen on multiple sockets at the same time, so enables full support for IPv4/IPv6 dual stack.
For example, '$QEMU -incoming tcp::9000' now correctly listens
on both 0.0.0.0 and :: at the same time, instead of only on 0.0.0.0.
Message-Id: <[email protected]>
--- migration/socket.c | 48 ++++++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 32 deletions(-)
migration/socket.c +16 -32
@@ -24,6 +24,7 @@#include "migration.h" #include "qemu-file.h" #include "io/channel-socket.h" +#include "io/net-listener.h" #include "trace.h"
@@ -129,34 +130,20 @@ void unix_start_outgoing_migration(MigrationState *s, } -static gboolean socket_accept_incoming_migration (QIOChannel *ioc, -GIOCondition condition, -gpointer opaque) +static void socket_accept_incoming_migration (QIONetListener *listener, +QIOChannelSocket *cioc, +gpointer opaque) { -QIOChannelSocket *sioc; -Error *err =NULL ; - - sioc =qio_channel_socket_accept (QIO_CHANNEL_SOCKET (ioc), - &err); -if (!sioc) { -error_report ("could not accept migration connection (%s)" , -error_get_pretty (err)); - goto out; - } -trace_migration_socket_incoming_accepted (); -qio_channel_set_name (QIO_CHANNEL (sioc),"migration-socket-incoming" ); -migration_channel_process_incoming (QIO_CHANNEL (sioc)); -object_unref (OBJECT (sioc)); +qio_channel_set_name (QIO_CHANNEL (cioc),"migration-socket-incoming" ); +migration_channel_process_incoming (QIO_CHANNEL (cioc)); -out:if (migration_has_all_channels ()) {/* Close listening socket as its no longer needed */ -qio_channel_close (ioc,NULL ); -return G_SOURCE_REMOVE ; - }else { -return G_SOURCE_CONTINUE ; +qio_net_listener_disconnect (listener); + +object_unref (OBJECT (listener)); } }
@@ -164,21 +151,18 @@ out:static void socket_start_incoming_migration (SocketAddress *saddr,Error **errp) { -QIOChannelSocket *listen_ioc =qio_channel_socket_new (); +QIONetListener *listener =qio_net_listener_new (); -qio_channel_set_name (QIO_CHANNEL (listen_ioc), -"migration-socket-listener" ); +qio_net_listener_set_name (listener,"migration-socket-listener" ); -if (qio_channel_socket_listen_sync (listen_ioc, saddr, errp) <0 ) { -object_unref (OBJECT (listen_ioc)); +if (qio_net_listener_open_sync (listener, saddr, errp) <0 ) { +object_unref (OBJECT (listener));return ; } -qio_channel_add_watch (QIO_CHANNEL (listen_ioc), -G_IO_IN , - socket_accept_incoming_migration, - listen_ioc, - (GDestroyNotify )object_unref); +qio_net_listener_set_client_func (listener, + socket_accept_incoming_migration, +NULL ,NULL ); }void tcp_start_incoming_migration (const char *host_port,Error **errp)
Signature · 1 line
2.14.3
[Qemu-devel] [PULL 2/5] migration: Fix rate limiting issue on RDMA migration
In reply to Dr. David Alan Gilbert (git)From: Lidong Chen <[email protected]>
RDMA migration implement save_page function for QEMUFile, but ram_control_save_page do not increase bytes_xfer. So when doing RDMA migration, it will use whole bandwidth.
Message-Id: <[email protected]>
--- migration/qemu-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
migration/qemu-file.c +1 -1
@@ -253,7 +253,7 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset,if (f->hooks && f->hooks->save_page) {int ret = f->hooks->save_page (f, f->opaque, block_offset, offset, size, bytes_sent); - + f->bytes_xfer += size;if (ret !=RAM_SAVE_CONTROL_DELAYED ) {if (bytes_sent && *bytes_sent >0 ) {qemu_update_position (f, *bytes_sent);
Signature · 1 line
2.14.3
[Qemu-devel] [PULL 3/5] migration/block: limit the number of parallel I/O requests
In reply to Dr. David Alan Gilbert (git)From: Peter Lieven <[email protected]>
the current implementation submits up to 512 I/O requests in parallel which is much to high especially for a background task. This patch adds a maximum limit of 16 I/O requests that can be submitted in parallel to avoid monopolizing the I/O device.
Message-Id: <[email protected]>
--- migration/block.c | 2 ++ 1 file changed, 2 insertions(+)
migration/block.c +2 -0
@@ -37,6 +37,7 @@#define MAX_IS_ALLOCATED_SEARCH (65536 * BDRV_SECTOR_SIZE)#define MAX_IO_BUFFERS 512 +#define MAX_PARALLEL_IO 16//#define DEBUG_BLK_MIGRATION
@@ -775,6 +776,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)while ((block_mig_state.submitted + block_mig_state.read_done) *BLOCK_SIZE <qemu_file_get_rate_limit (f) && + block_mig_state.submitted <MAX_PARALLEL_IO && (block_mig_state.submitted + block_mig_state.read_done) <MAX_IO_BUFFERS ) {blk_mig_unlock ();
Signature · 1 line
2.14.3
[Qemu-devel] [PULL 4/5] migration/block: compare only read blocks against the rate limiter
In reply to Dr. David Alan Gilbert (git)From: Peter Lieven <[email protected]>
only read_done blocks are in the queued to be flushed to the migration stream. submitted blocks are still in flight.
Message-Id: <[email protected]>
--- migration/block.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
migration/block.c +1 -2
@@ -773,8 +773,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)/* control the rate of transfer */ blk_mig_lock (); -while ((block_mig_state.submitted + - block_mig_state.read_done) *BLOCK_SIZE < +while (block_mig_state.read_done *BLOCK_SIZE <qemu_file_get_rate_limit (f) && block_mig_state.submitted <MAX_PARALLEL_IO && (block_mig_state.submitted + block_mig_state.read_done) <
Signature · 1 line
2.14.3
[Qemu-devel] [PULL 5/5] migration: Fix block migration flag case
In reply to Dr. David Alan Gilbert (git)From: "Dr. David Alan Gilbert" <[email protected]>
Fix the case where when a migration with a bad protocol is tried, we leave the block migration capability set.
(This is a cut down version of my 'migration: Fix block failure cases' where it's other case was fixed by Peter's dd0ee30caeebbd )
Message-Id: <[email protected]>
--- migration/migration.c | 1 + 1 file changed, 1 insertion(+)
migration/migration.c +1 -0
@@ -1428,6 +1428,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, "a valid migration protocol");migrate_set_state (&s->state,MIGRATION_STATUS_SETUP ,MIGRATION_STATUS_FAILED ); +block_cleanup_parameters (s);return ; }
Signature · 1 line
2.14.3
Peter Maydell
AppliedQuoted 17 lines · Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" <[email protected]>
The following changes since commit
4c2c1015905fa1d616750dfe024b4c0b35875950:Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20180323' into staging (2018-03-23 10:20:54 +0000)
are available in the Git repository at:
git://github.com/dagrh/qemu.gittags/pull-migration-20180323afor you to fetch changes up to
09576e74dbe697c5f0a7bc2ad7b59601457a2ff4:migration: Fix block migration flag case (2018-03-23 18:24:11 +0000)
----------------------------------------------------------------
Migration fixes for 2.12
Quoted 6 lines
All small fixes. Dan's is a missing piece of a cleanup that finally completes something, and between Paolo, Dan and myself we recon it's still on the edge of being a bug fix.
----------------------------------------------------------------
Applied, thanks.
-- PMM