4 * Copyright IBM, Corp. 2008
5 * Copyright Dell MessageOne 2008
6 * Copyright Red Hat, Inc. 2015-2016
9 * Anthony Liguori <aliguori@us.ibm.com>
10 * Charles Duffy <charles_duffy@messageone.com>
11 * Daniel P. Berrange <berrange@redhat.com>
13 * This work is licensed under the terms of the GNU GPL, version 2. See
14 * the COPYING file in the top-level directory.
16 * Contributions after 2012-01-13 are licensed under the terms of the
17 * GNU GPL, version 2 or (at your option) any later version.
20 #include "qemu/osdep.h"
21 #include "qapi/error.h"
22 #include "qemu-common.h"
25 #include "migration/migration.h"
26 #include "io/channel-command.h"
30 void exec_start_outgoing_migration(MigrationState
*s
, const char *command
, Error
**errp
)
33 const char *argv
[] = { "/bin/sh", "-c", command
, NULL
};
35 trace_migration_exec_outgoing(command
);
36 ioc
= QIO_CHANNEL(qio_channel_command_new_spawn(argv
,
43 qio_channel_set_name(ioc
, "migration-exec-outgoing");
44 migration_channel_connect(s
, ioc
, NULL
);
45 object_unref(OBJECT(ioc
));
48 static gboolean
exec_accept_incoming_migration(QIOChannel
*ioc
,
49 GIOCondition condition
,
52 migration_channel_process_incoming(migrate_get_current(), ioc
);
53 object_unref(OBJECT(ioc
));
54 return FALSE
; /* unregister */
57 void exec_start_incoming_migration(const char *command
, Error
**errp
)
60 const char *argv
[] = { "/bin/sh", "-c", command
, NULL
};
62 trace_migration_exec_incoming(command
);
63 ioc
= QIO_CHANNEL(qio_channel_command_new_spawn(argv
,
70 qio_channel_set_name(ioc
, "migration-exec-incoming");
71 qio_channel_add_watch(ioc
,
73 exec_accept_incoming_migration
,