aboutsummaryrefslogtreecommitdiffstats
path: root/migration-exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration-exec.c')
-rw-r--r--migration-exec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/migration-exec.c b/migration-exec.c
index 54358271c..93bde62cd 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -43,13 +43,21 @@ static int file_write(FdMigrationState *s, const void * buf, size_t size)
static int exec_close(FdMigrationState *s)
{
+ int ret = 0;
DPRINTF("exec_close\n");
if (s->opaque) {
- qemu_fclose(s->opaque);
+ ret = qemu_fclose(s->opaque);
s->opaque = NULL;
s->fd = -1;
+ if (ret != -1 &&
+ WIFEXITED(ret)
+ && WEXITSTATUS(ret) == 0) {
+ ret = 0;
+ } else {
+ ret = -1;
+ }
}
- return 0;
+ return ret;
}
MigrationState *exec_start_outgoing_migration(Monitor *mon,