From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF6fR-0007XQ-U6 for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:05:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF6fL-0008Kb-B8 for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:05:29 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:43020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF6fL-0008KE-3t for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:05:23 -0400 Received: by pbbrp12 with SMTP id rp12so8110795pbb.4 for ; Fri, 21 Sep 2012 10:05:22 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 21 Sep 2012 19:04:57 +0200 Message-Id: <1348247106-27936-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 0/9] Incoming migration coroutine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: quintela@redhat.com Juan, here is the implementation of migration-in-a-coroutine, applying on top of your recently-posted 41-patch series. With these patches, the monitor (and in the future the NBD server) is responsive during migration. The first seven patches are just cleanups, only the last two actually implement the feature. They are the opposite change of the nonblocking->blocking change that you implemented for the migration thread. However, the change is much simpler because we have no timers, and because of the use of coroutines. Without coroutines (and as in non-threaded migration), you have to proceed in two steps: first collect data in a buffer, then write it. This lets you handle EAGAIN only at precise points in buffered_flush/buffered_put_buffer, so that you can restart writing in migrate_fd_put_notify. This "checkpointing" is the reason why QEMUFileBuffered exists. With coroutines, you can just stop whenever you want with qemu_coroutine_yield. As soon as select tells you that you can read, you'll re-enter directly in qemu_get_buffer, read more data and pass it to the loading routines. Thanks, Paolo Paolo Bonzini (9): migration: unify stdio-based QEMUFile operations migration: consolidate QEMUFile methods in a single QEMUFileOps struct migration: add qemu_get_fd migration: replace qemu_stdio_fd with qemu_get_fd migration: clean up server sockets and handlers before invoking process_incoming_migration migration: close socket QEMUFile from socket_close migration: move qemu_fclose to process_incoming_migration migration: handle EAGAIN while reading QEMUFile migration: move process_incoming_migration to a coroutine buffered_file.c | 21 +++++-- migration-exec.c | 5 +- migration-fd.c | 3 +- migration-tcp.c | 10 +-- migration-unix.c | 10 +-- migration.c | 27 +++++++- qemu-file.h | 23 ++++--- savevm.c | 188 ++++++++++++++++++++++++++++++++----------------------- 8 file modificati, 181 inserzioni(+), 106 rimozioni(-) -- 1.7.12