diff options
author | Anthony Liguori | 2012-11-02 19:06:28 +0100 |
---|---|---|
committer | Anthony Liguori | 2012-11-02 19:06:28 +0100 |
commit | 2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0 (patch) | |
tree | 98dbd8f0ee86efb371da9fa605d87f96b51d55e5 /migration-unix.c | |
parent | Merge remote-tracking branch 'afaerber/qom-cpu' into staging (diff) | |
parent | migration: move process_incoming_migration to a coroutine (diff) | |
download | qemu-2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0.tar.gz qemu-2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0.tar.xz qemu-2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0.zip |
Merge remote-tracking branch 'bonzini/migr-coroutine' into staging
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* bonzini/migr-coroutine:
migration: move process_incoming_migration to a coroutine
migration: handle EAGAIN while reading QEMUFile
migration: move qemu_fclose to process_incoming_migration
migration: close socket QEMUFile from socket_close
migration: xxx_close will only be called once
migration: use closesocket, not close
migration: use migrate_fd_close in migrate_fd_cleanup
migration: clean up server sockets and handlers before invoking process_incoming_migration
migration: replace qemu_stdio_fd with qemu_get_fd
migration: add qemu_get_fd
migration: consolidate QEMUFile methods in a single QEMUFileOps struct
migration: unify stdio-based QEMUFile operations
Diffstat (limited to 'migration-unix.c')
-rw-r--r-- | migration-unix.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/migration-unix.c b/migration-unix.c index ed3db3a39a..dba72b4a54 100644 --- a/migration-unix.c +++ b/migration-unix.c @@ -44,11 +44,8 @@ static int unix_close(MigrationState *s) { int r = 0; DPRINTF("unix_close\n"); - if (s->fd != -1) { - if (close(s->fd) < 0) { - r = -errno; - } - s->fd = -1; + if (close(s->fd) < 0) { + r = -errno; } return r; } @@ -88,12 +85,14 @@ static void unix_accept_incoming_migration(void *opaque) do { c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen); } while (c == -1 && errno == EINTR); + qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL); + close(s); DPRINTF("accepted migration\n"); if (c == -1) { fprintf(stderr, "could not accept migration connection\n"); - goto out2; + goto out; } f = qemu_fopen_socket(c); @@ -103,12 +102,10 @@ static void unix_accept_incoming_migration(void *opaque) } process_incoming_migration(f); - qemu_fclose(f); + return; + out: close(c); -out2: - qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL); - close(s); } void unix_start_incoming_migration(const char *path, Error **errp) |