From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYScG-00068N-1t for qemu-devel@nongnu.org; Mon, 21 Oct 2013 23:26:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYSc6-0004bT-Ks for qemu-devel@nongnu.org; Mon, 21 Oct 2013 23:26:43 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:50533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYSc6-0004b4-0b for qemu-devel@nongnu.org; Mon, 21 Oct 2013 23:26:34 -0400 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Oct 2013 08:56:32 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 203071258051 for ; Tue, 22 Oct 2013 08:57:03 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r9M3TKNp44630062 for ; Tue, 22 Oct 2013 08:59:20 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r9M3QTG6024134 for ; Tue, 22 Oct 2013 08:56:30 +0530 From: Lei Li Date: Tue, 22 Oct 2013 11:25:39 +0800 Message-Id: <1382412341-1173-16-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1382412341-1173-1-git-send-email-lilei@linux.vnet.ibm.com> References: <1382412341-1173-1-git-send-email-lilei@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 15/17] migration-unix: page flipping support on unix outgoing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aarcange@redhat.com, aliguori@us.ibm.com, Lei Li , quintela@redhat.com, mdroth@linux.vnet.ibm.com, mrhines@linux.vnet.ibm.com, lagarcia@br.ibm.com, pbonzini@redhat.com, rcj@linux.vnet.ibm.com Add page flipping support on unix outgoing part by stopping VM with the new RunState RUN_STATE_FLIPPING_MIGRATE before invoking migration if unix_page_flipping enabled. Signed-off-by: Lei Li --- migration-unix.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/migration-unix.c b/migration-unix.c index d3a151a..f2bfd38 100644 --- a/migration-unix.c +++ b/migration-unix.c @@ -19,6 +19,7 @@ #include "migration/migration.h" #include "migration/qemu-file.h" #include "block/block.h" +#include "sysemu/sysemu.h" //#define DEBUG_MIGRATION_UNIX @@ -33,11 +34,12 @@ static void unix_wait_for_connect(int fd, void *opaque) { MigrationState *s = opaque; + int ret; if (fd < 0) { DPRINTF("migrate connect error\n"); s->file = NULL; - goto fails; + goto fail; } else { DPRINTF("migrate connect success\n"); @@ -47,6 +49,15 @@ static void unix_wait_for_connect(int fd, void *opaque) goto fail; } + /* Stop VM before invoking migration if unix_page_flipping enabled */ + if (migrate_unix_page_flipping()) { + ret = vm_stop_force_state(RUN_STATE_FLIPPING_MIGRATE); + if (ret < 0) { + DPRINTF("failed to stop VM\n"); + goto fail; + } + } + migrate_fd_connect(s); return; } -- 1.7.7.6