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>
This commit is contained in:
Anthony Liguori 2010-06-02 14:55:25 -05:00
parent 4309a79bff
commit 41ef56e611
4 changed files with 28 additions and 8 deletions

View file

@ -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,