From patchwork Fri Nov 2 17:50:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 196683 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 204C22C00D0 for ; Sat, 3 Nov 2012 04:51:29 +1100 (EST) Received: from localhost ([::1]:55462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TULOv-0001Vu-9Q for incoming@patchwork.ozlabs.org; Fri, 02 Nov 2012 13:51:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TULOp-0001Vn-GB for qemu-devel@nongnu.org; Fri, 02 Nov 2012 13:51:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TULOn-0005O5-D3 for qemu-devel@nongnu.org; Fri, 02 Nov 2012 13:51:19 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:52142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TULOn-0005Nu-6H for qemu-devel@nongnu.org; Fri, 02 Nov 2012 13:51:17 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so2536065pad.4 for ; Fri, 02 Nov 2012 10:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=4TVoBdGLYdgrotJLUYseDCDVUb1ZArXpx/B1M/k2WPA=; b=uzFE1YEW5djrNF+0g4zM7HRFMGW7BUOi0XY+pUiI+Pg51gW+IZ5wsfoM4DODeqDhbC M9vVUcvlbOhiSEuumcqsgc/m55tNYorzdzNFGDxssfU7Z6XcIyFJpORw8RrDlllqdE3v kgi/cFmM/PYgnEMMFZHQbG+cLiAxl/WLi+jRT++uti7q1cGK9CTvG4MXMhEvS9YQljax fvT9cLiPleGwjS9+UgWJJlrjeMrGTBbLRsOiFQ7wbw2bWiS+59i/QNIULPTZs2v6QQCQ /gD9vVS5IBlVw/gBZ+/4Vwhz8lfa8VFQt7vbdvV9tVFYvsPQWptdWj0xThFHPjKbwMe6 Bomw== Received: by 10.68.223.37 with SMTP id qr5mr8361646pbc.101.1351878676300; Fri, 02 Nov 2012 10:51:16 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it. [93.34.169.1]) by mx.google.com with ESMTPS id a4sm6052116pax.12.2012.11.02.10.51.13 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:51:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 2 Nov 2012 18:50:53 +0100 Message-Id: <1351878665-32413-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.12.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.45 Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PULL 00/12] Incoming migration coroutine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Anthony, The following changes since commit 4ba79505f43bd0ace35c3fe42197eb02e7e0478e: Merge remote-tracking branch 'kraxel/pixman.v3' into staging (2012-11-01 11:14:39 -0500) are available in the git repository at: git://github.com/bonzini/qemu.git migr-coroutine for you to fetch changes up to 82a4da79fd6c108400637143f8439c2364bdb21e: migration: move process_incoming_migration to a coroutine (2012-11-02 18:35:08 +0100) With these patches, the monitor and the NBD server are responsive during migration. The first ten patches are just cleanups, generalizing some parts of QEMUFile and improving the way migration sockets are closed. 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. Paolo ---------------------------------------------------------------- Paolo Bonzini (12): 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: use migrate_fd_close in migrate_fd_cleanup migration: use closesocket, not close migration: xxx_close will only be called once 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 | 19 +++--- migration-fd.c | 36 +++++------ migration-tcp.c | 19 +++--- migration-unix.c | 17 +++-- migration.c | 46 ++++++++++---- qemu-file.h | 23 ++++--- savevm.c | 188 ++++++++++++++++++++++++++++++++----------------------- 8 file modificati, 215 inserzioni(+), 154 rimozioni(-)