From 43eaae28e0394f8fb80848fb40aa5d28c6360321 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 2 Oct 2012 18:21:18 +0200 Subject: migration (incoming): add error propagation to fd and exec protocols And remove the superfluous integer return value. Reviewed-by: Luiz Capitulino Signed-off-by: Paolo Bonzini --- migration-fd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'migration-fd.c') diff --git a/migration-fd.c b/migration-fd.c index a7c800a852..ce6932d7c3 100644 --- a/migration-fd.c +++ b/migration-fd.c @@ -97,7 +97,7 @@ static void fd_accept_incoming_migration(void *opaque) qemu_fclose(f); } -int fd_start_incoming_migration(const char *infd) +void fd_start_incoming_migration(const char *infd, Error **errp) { int fd; QEMUFile *f; @@ -107,11 +107,9 @@ int fd_start_incoming_migration(const char *infd) fd = strtol(infd, NULL, 0); f = qemu_fdopen(fd, "rb"); if(f == NULL) { - DPRINTF("Unable to apply qemu wrapper to file descriptor\n"); - return -errno; + error_setg_errno(errp, errno, "failed to open the source descriptor"); + return; } qemu_set_fd_handler2(fd, NULL, fd_accept_incoming_migration, NULL, f); - - return 0; } -- cgit v1.2.1