From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLcR-0002Qs-Iy for qemu-devel@nongnu.org; Thu, 24 Oct 2013 10:10:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZLcJ-0003kq-4X for qemu-devel@nongnu.org; Thu, 24 Oct 2013 10:10:35 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:53844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLcI-0003km-MZ for qemu-devel@nongnu.org; Thu, 24 Oct 2013 10:10:27 -0400 Received: by mail-wi0-f170.google.com with SMTP id l12so9909370wiv.3 for ; Thu, 24 Oct 2013 07:10:26 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <52692A4E.6000909@redhat.com> Date: Thu, 24 Oct 2013 15:10:22 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1382412341-1173-1-git-send-email-lilei@linux.vnet.ibm.com> <1382412341-1173-14-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1382412341-1173-14-git-send-email-lilei@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 13/17] migration-unix: replace qemu_fopen_socket with qemu_fopen_socket_local List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: aarcange@redhat.com, aliguori@us.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, lagarcia@br.ibm.com, rcj@linux.vnet.ibm.com Il 22/10/2013 04:25, Lei Li ha scritto: > 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"); "failed to open Unix socket" > + 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"); "failed to open Unix socket" > goto out; > } > > Otherwise ok. Paolo