mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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:
parent
4309a79bff
commit
41ef56e611
4 changed files with 28 additions and 8 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue