From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOq9k-0003Z0-LU for qemu-devel@nongnu.org; Wed, 25 Sep 2013 10:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOq9a-0006Lh-JD for qemu-devel@nongnu.org; Wed, 25 Sep 2013 10:33:32 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:52302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOq9Z-0006LK-UU for qemu-devel@nongnu.org; Wed, 25 Sep 2013 10:33:22 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Sep 2013 20:03:20 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 2A674E0057 for ; Wed, 25 Sep 2013 20:04:23 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8PEZcIY38207698 for ; Wed, 25 Sep 2013 20:05:38 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8PEXHD9004561 for ; Wed, 25 Sep 2013 20:03:17 +0530 From: Lei Li Date: Wed, 25 Sep 2013 22:32:48 +0800 Message-Id: <1380119568-5530-9-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1380119568-5530-1-git-send-email-lilei@linux.vnet.ibm.com> References: <1380119568-5530-1-git-send-email-lilei@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 8/8] migration-unix: side channel support on unix incoming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aarcange@redhat.com, Lei Li , quintela@redhat.com, mdroth@linux.vnet.ibm.com, mrhines@linux.vnet.ibm.com, anthony@codemonkey.ws, lagarcia@br.ibm.com, pbonzini@redhat.com, rcj@linux.vnet.ibm.com Add side channel support on incoming part of unix migration to enable localhost migration with page flipping approach. If there is a pipe available by checking recv_pipefd(), it will fetch the pipe file descriptor and open it by qemu_fopen_pipe() with read mode for the pipe protocol introduced. Signed-off-by: Lei Li --- migration-unix.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/migration-unix.c b/migration-unix.c index 0bfc1c7..878e063 100644 --- a/migration-unix.c +++ b/migration-unix.c @@ -85,6 +85,7 @@ static void unix_accept_incoming_migration(void *opaque) int s = (intptr_t)opaque; QEMUFile *f; int c; + int pipefd; do { c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen); @@ -99,7 +100,18 @@ static void unix_accept_incoming_migration(void *opaque) goto out; } - f = qemu_fopen_socket(c, "rb"); + /* Check if there is a pipe fd to be recevied for a page-flipping + * migration */ + + pipefd = recv_pipefd(c); + if (pipefd > 0) { + DPRINTF("receive pipe file descriptor successfully\n"); + + f = qemu_fopen_pipe(pipefd, "r"); + } else { + f = qemu_fopen_socket(c, "rb"); + } + if (f == NULL) { fprintf(stderr, "could not qemu_fopen socket\n"); goto out; -- 1.7.7.6