aboutsummaryrefslogtreecommitdiff
path: root/migration-exec.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-02-22 17:36:36 +0100
committerJuan Quintela <quintela@redhat.com>2013-03-11 13:32:02 +0100
commit817b9ed5eb300dbb434d752da416441028539a96 (patch)
tree0cddbea310298a2cffaf3dd99897ea9f8660ed25 /migration-exec.c
parenta0ff044b8ea81908cd8fe5819ce33780f53f58ee (diff)
migration: merge qemu_popen_cmd with qemu_popen
There is no reason for outgoing exec migration to do popen manually anymore (the reason used to be that we needed the FILE* to make it non-blocking). Use qemu_popen_cmd. Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration-exec.c')
-rw-r--r--migration-exec.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/migration-exec.c b/migration-exec.c
index a051a6e668..5dc73139a4 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -59,19 +59,17 @@ static int exec_close(MigrationState *s)
void exec_start_outgoing_migration(MigrationState *s, const char *command, Error **errp)
{
- FILE *f;
-
- f = popen(command, "w");
+ QEMUFile *f;
+ f = qemu_popen_cmd(command, "w");
if (f == NULL) {
error_setg_errno(errp, errno, "failed to popen the migration target");
return;
}
- s->fd = fileno(f);
+ s->opaque = f;
+ s->fd = qemu_get_fd(f);
assert(s->fd != -1);
- s->opaque = qemu_popen(f, "w");
-
s->close = exec_close;
s->get_error = file_errno;
s->write = file_write;