mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
a0ff044b8e
commit
817b9ed5eb
3 changed files with 12 additions and 21 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue