aboutsummaryrefslogtreecommitdiff
path: root/migration-exec.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2010-06-02 14:55:25 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2010-06-03 14:55:45 -0500
commit41ef56e61153d7bd27d34a634633bb51b1c5988d (patch)
treeeea50adb3c58ec6784b0c0ee1385324f0f6a6c1f /migration-exec.c
parent4309a79bffce10d6d8de82c5ee403ffa4f45db64 (diff)
downloadqemu-41ef56e61153d7bd27d34a634633bb51b1c5988d.zip
qemu-41ef56e61153d7bd27d34a634633bb51b1c5988d.tar.gz
qemu-41ef56e61153d7bd27d34a634633bb51b1c5988d.tar.bz2
migration: respect exit status with exec:
This patch makes sure that if the exec: process exits with a non-zero return status, we treat the migration as failed. This fixes https://bugs.launchpad.net/qemu/+bug/391879 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 5435827..93bde62 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,