int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
    MigrationState *s = NULL;
    const char *p;
    int detach = qdict_get_try_bool(qdict, "detach", 0);
    int blk = qdict_get_try_bool(qdict, "blk", 0);
    int inc = qdict_get_try_bool(qdict, "inc", 0);
    const char *uri = qdict_get_str(qdict, "uri");
    if (current_migration &&
        current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) {
        monitor_printf(mon, "migration already in progress\n");
    if (strstart(uri, "tcp:", &p)) {
        s = tcp_start_outgoing_migration(mon, p, max_throttle, detach,
                                         blk, inc);
#if !defined(WIN32)
    } else if (strstart(uri, "exec:", &p)) {
        s = exec_start_outgoing_migration(mon, p, max_throttle, detach,
                                          blk, inc);
    } else if (strstart(uri, "unix:", &p)) {
        s = unix_start_outgoing_migration(mon, p, max_throttle, detach,
                                          blk, inc);
    } else if (strstart(uri, "fd:", &p)) {
        s = fd_start_outgoing_migration(mon, p, max_throttle, detach, 
                                        blk, inc);
#endif
    } else {
        monitor_printf(mon, "unknown migration protocol: %s\n", uri);
    if (s == NULL) {
        monitor_printf(mon, "migration failed\n");
    if (current_migration) {
        current_migration->release(current_migration);
    current_migration = s;
    return 0;
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
    MigrationState *s = NULL;
    const char *p;
    int detach = qdict_get_try_bool(qdict, "detach", 0);
    int blk = qdict_get_try_bool(qdict, "blk", 0);
    int inc = qdict_get_try_bool(qdict, "inc", 0);
    const char *uri = qdict_get_str(qdict, "uri");
    if (current_migration &&
        current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) {
        monitor_printf(mon, "migration already in progress\n");
    if (strstart(uri, "tcp:", &p)) {
        s = tcp_start_outgoing_migration(mon, p, max_throttle, detach,
                                         blk, inc);
#if !defined(WIN32)
    } else if (strstart(uri, "exec:", &p)) {
        s = exec_start_outgoing_migration(mon, p, max_throttle, detach,
                                          blk, inc);
    } else if (strstart(uri, "unix:", &p)) {
        s = unix_start_outgoing_migration(mon, p, max_throttle, detach,
                                          blk, inc);
    } else if (strstart(uri, "fd:", &p)) {
        s = fd_start_outgoing_migration(mon, p, max_throttle, detach, 
                                        blk, inc);
#endif
    } else {
        monitor_printf(mon, "unknown migration protocol: %s\n", uri);
    if (s == NULL) {
        monitor_printf(mon, "migration failed\n");
    if (current_migration) {
        current_migration->release(current_migration);
    current_migration = s;
    return 0;
    return 0;
int FUNC_0(Monitor *VAR_0, const QDict *VAR_1, QObject **VAR_2)
{
    MigrationState *s = NULL;
    const char *VAR_3;
    int VAR_4 = qdict_get_try_bool(VAR_1, "VAR_4", 0);
    int VAR_5 = qdict_get_try_bool(VAR_1, "VAR_5", 0);
    int VAR_6 = qdict_get_try_bool(VAR_1, "VAR_6", 0);
    const char *VAR_7 = qdict_get_str(VAR_1, "VAR_7");
    if (current_migration &&
        current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) {
        monitor_printf(VAR_0, "migration already in progress\n");
    if (strstart(VAR_7, "tcp:", &VAR_3)) {
        s = tcp_start_outgoing_migration(VAR_0, VAR_3, max_throttle, VAR_4,
                                         VAR_5, VAR_6);
#if !defined(WIN32)
    } else if (strstart(VAR_7, "exec:", &VAR_3)) {
        s = exec_start_outgoing_migration(VAR_0, VAR_3, max_throttle, VAR_4,
                                          VAR_5, VAR_6);
    } else if (strstart(VAR_7, "unix:", &VAR_3)) {
        s = unix_start_outgoing_migration(VAR_0, VAR_3, max_throttle, VAR_4,
                                          VAR_5, VAR_6);
    } else if (strstart(VAR_7, "fd:", &VAR_3)) {
        s = fd_start_outgoing_migration(VAR_0, VAR_3, max_throttle, VAR_4, 
                                        VAR_5, VAR_6);
#endif
    } else {
        monitor_printf(VAR_0, "unknown migration protocol: %s\n", VAR_7);
    if (s == NULL) {
        monitor_printf(VAR_0, "migration failed\n");
    if (current_migration) {
        current_migration->release(current_migration);
    current_migration = s;
    return 0;
int FUNC_0(Monitor *VAR_0, const QDict *VAR_1, QObject **VAR_2)
{ MigrationState *s = NULL; const char *VAR_3; int VAR_4 = qdict_get_try_bool(VAR_1, "VAR_4", 0); int VAR_5 = qdict_get_try_bool(VAR_1, "VAR_5", 0); int VAR_6 = qdict_get_try_bool(VAR_1, "VAR_6", 0); const char *VAR_7 = qdict_get_str(VAR_1, "VAR_7"); if (current_migration &&
current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) { monitor_printf(VAR_0, "migration already in progress\n"); if (strstart(VAR_7, "tcp:", &VAR_3)) { s = tcp_start_outgoing_migration(VAR_0, VAR_3, max_throttle, VAR_4,
VAR_5, VAR_6); #if !defined(WIN32)
} else if (strstart(VAR_7, "exec:", &VAR_3)) { s = exec_start_outgoing_migration(VAR_0, VAR_3, max_throttle, VAR_4,
VAR_5, VAR_6); } else if (strstart(VAR_7, "unix:", &VAR_3)) { s = unix_start_outgoing_migration(VAR_0, VAR_3, max_throttle, VAR_4,
VAR_5, VAR_6); } else if (strstart(VAR_7, "fd:", &VAR_3)) { s = fd_start_outgoing_migration(VAR_0, VAR_3, max_throttle, VAR_4,
VAR_5, VAR_6); #endif
} else { monitor_printf(VAR_0, "unknown migration protocol: %s\n", VAR_7); if (s == NULL) { monitor_printf(VAR_0, "migration failed\n"); if (current_migration) { current_migration->release(current_migration); current_migration = s; return 0;