Exit if incoming migration fails
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
63729c3692
commit
8ca5e80118
16
migration.c
16
migration.c
@ -36,22 +36,26 @@ static uint32_t max_throttle = (32 << 20);
|
|||||||
|
|
||||||
static MigrationState *current_migration;
|
static MigrationState *current_migration;
|
||||||
|
|
||||||
void qemu_start_incoming_migration(const char *uri)
|
int qemu_start_incoming_migration(const char *uri)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (strstart(uri, "tcp:", &p))
|
if (strstart(uri, "tcp:", &p))
|
||||||
tcp_start_incoming_migration(p);
|
ret = tcp_start_incoming_migration(p);
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
else if (strstart(uri, "exec:", &p))
|
else if (strstart(uri, "exec:", &p))
|
||||||
exec_start_incoming_migration(p);
|
ret = exec_start_incoming_migration(p);
|
||||||
else if (strstart(uri, "unix:", &p))
|
else if (strstart(uri, "unix:", &p))
|
||||||
unix_start_incoming_migration(p);
|
ret = unix_start_incoming_migration(p);
|
||||||
else if (strstart(uri, "fd:", &p))
|
else if (strstart(uri, "fd:", &p))
|
||||||
fd_start_incoming_migration(p);
|
ret = fd_start_incoming_migration(p);
|
||||||
#endif
|
#endif
|
||||||
else
|
else {
|
||||||
fprintf(stderr, "unknown migration protocol: %s\n", uri);
|
fprintf(stderr, "unknown migration protocol: %s\n", uri);
|
||||||
|
ret = -EPROTONOSUPPORT;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
||||||
|
@ -50,7 +50,7 @@ struct FdMigrationState
|
|||||||
void *opaque;
|
void *opaque;
|
||||||
};
|
};
|
||||||
|
|
||||||
void qemu_start_incoming_migration(const char *uri);
|
int qemu_start_incoming_migration(const char *uri);
|
||||||
|
|
||||||
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data);
|
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data);
|
||||||
|
|
||||||
|
7
vl.c
7
vl.c
@ -2975,7 +2975,12 @@ int main(int argc, char **argv, char **envp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (incoming) {
|
if (incoming) {
|
||||||
qemu_start_incoming_migration(incoming);
|
int ret = qemu_start_incoming_migration(incoming);
|
||||||
|
if (ret < 0) {
|
||||||
|
fprintf(stderr, "Migration failed. Exit code %s(%d), exiting.\n",
|
||||||
|
incoming, ret);
|
||||||
|
exit(ret);
|
||||||
|
}
|
||||||
} else if (autostart) {
|
} else if (autostart) {
|
||||||
vm_start();
|
vm_start();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user