From patchwork Tue Oct 22 03:25:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Li X-Patchwork-Id: 285338 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6EEFA2C0127 for ; Tue, 22 Oct 2013 14:32:13 +1100 (EST) Received: from localhost ([::1]:42792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYShX-0006yW-Ik for incoming@patchwork.ozlabs.org; Mon, 21 Oct 2013 23:32:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYSc5-0005of-SO for qemu-devel@nongnu.org; Mon, 21 Oct 2013 23:26:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYSbw-0004a6-Tq for qemu-devel@nongnu.org; Mon, 21 Oct 2013 23:26:33 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:59970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYSbw-0004Zs-At for qemu-devel@nongnu.org; Mon, 21 Oct 2013 23:26:24 -0400 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Oct 2013 08:56:23 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp09.in.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 22 Oct 2013 08:56:20 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 76E9E394003F for ; Tue, 22 Oct 2013 08:55:59 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r9M3QHjT48496848 for ; Tue, 22 Oct 2013 08:56:17 +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 r9M3QJke023801 for ; Tue, 22 Oct 2013 08:56:19 +0530 Received: from localhost.cn.ibm.com ([9.115.122.43]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r9M3PhTd022250; Tue, 22 Oct 2013 08:56:17 +0530 From: Lei Li To: qemu-devel@nongnu.org Date: Tue, 22 Oct 2013 11:25:37 +0800 Message-Id: <1382412341-1173-14-git-send-email-lilei@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.6 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> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13102203-2674-0000-0000-00000B22BB8A X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.9 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 Subject: [Qemu-devel] [PATCH 13/17] migration-unix: replace qemu_fopen_socket with qemu_fopen_socket_local 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 Relace qemu_fopen_socket with qemu_fopen_socket_local in Unix protocol migration. Signed-off-by: Lei Li --- migration-unix.c | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/migration-unix.c b/migration-unix.c index 651fc5b..d3a151a 100644 --- a/migration-unix.c +++ b/migration-unix.c @@ -37,12 +37,22 @@ static void unix_wait_for_connect(int fd, void *opaque) if (fd < 0) { DPRINTF("migrate connect error\n"); s->file = NULL; - migrate_fd_error(s); + goto fails; } else { DPRINTF("migrate connect success\n"); - s->file = qemu_fopen_socket(fd, "wb"); + + s->file = qemu_fopen_socket_local(fd, "wb"); + if (s->file == NULL) { + DPRINTF("failed to open local socket\n"); + goto fail; + } + migrate_fd_connect(s); + return; } + +fail: + migrate_fd_error(s); } void unix_start_outgoing_migration(MigrationState *s, const char *path, Error **errp) @@ -71,9 +81,9 @@ static void unix_accept_incoming_migration(void *opaque) goto out; } - f = qemu_fopen_socket(c, "rb"); + f = qemu_fopen_socket_local(c, "rb"); if (f == NULL) { - fprintf(stderr, "could not qemu_fopen socket\n"); + fprintf(stderr, "could not qemu_fopen socket local\n"); goto out; }