#include "qemu-common.h"
#include "qemu/sockets.h"
+#include "qemu/main-loop.h"
#include "migration/migration.h"
#include "migration/qemu-file.h"
#include "block/block.h"
do { } while (0)
#endif
-static int file_errno(MigrationState *s)
-{
- return errno;
-}
-
-static int file_write(MigrationState *s, const void * buf, size_t size)
-{
- return write(s->fd, buf, size);
-}
-
void exec_start_outgoing_migration(MigrationState *s, const char *command, Error **errp)
{
- s->migration_file = qemu_popen_cmd(command, "w");
- if (s->migration_file == NULL) {
+ s->file = qemu_popen_cmd(command, "w");
+ if (s->file == NULL) {
error_setg_errno(errp, errno, "failed to popen the migration target");
return;
}
- s->get_error = file_errno;
- s->write = file_write;
migrate_fd_connect(s);
}