diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2016-05-26 16:09:26 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2016-05-26 16:09:27 +0100 |
| commit | aef11b8d33ff9018b20ae29d87b1d674ed23dab9 (patch) | |
| tree | dc8839951876a7063facf6cce77c839ff1fc434a /migration/unix.c | |
| parent | 2c56d06bafd8933d2a9c6e0aeb5d45f7c1fb5616 (diff) | |
| parent | 12992c16d9afd8a23a94a84ad532a1adedf9e511 (diff) | |
| download | focaccia-qemu-aef11b8d33ff9018b20ae29d87b1d674ed23dab9.tar.gz focaccia-qemu-aef11b8d33ff9018b20ae29d87b1d674ed23dab9.zip | |
Merge remote-tracking branch 'remotes/amit-migration/tags/migration-2.7-2' into staging
migration: add TLS support to the migration data channel This is a big refactoring of the migration backend code - moving away from QEMUFile to the new QIOChannel framework introduced here. This brings a good level of abstraction and reduction of many lines of code. This series also adds the ability for many backends (all except RDMA) to use TLS for encrypting the migration data between the endpoints. # gpg: Signature made Thu 26 May 2016 07:07:08 BST using RSA key ID 657EF670 # gpg: Good signature from "Amit Shah <amit@amitshah.net>" # gpg: aka "Amit Shah <amit@kernel.org>" # gpg: aka "Amit Shah <amitshah@gmx.net>" * remotes/amit-migration/tags/migration-2.7-2: (28 commits) migration: remove qemu_get_fd method from QEMUFile migration: remove support for non-iovec based write handlers migration: add support for encrypting data with TLS migration: define 'tls-creds' and 'tls-hostname' migration parameters migration: don't use an array for storing migrate parameters migration: move definition of struct QEMUFile back into qemu-file.c migration: delete QEMUFile stdio implementation migration: delete QEMUFile sockets implementation migration: delete QEMUSizedBuffer struct migration: delete QEMUFile buffer implementation migration: convert savevm to use QIOChannel for writing to files migration: convert RDMA to use QIOChannel interface migration: convert exec socket protocol to use QIOChannel migration: convert fd socket protocol to use QIOChannel migration: convert tcp socket protocol to use QIOChannel migration: rename unix.c to socket.c migration: convert unix socket protocol to use QIOChannel migration: convert post-copy to use QIOChannelBuffer migration: add reporting of errors for outgoing migration migration: add helpers for creating QEMUFile from a QIOChannel ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'migration/unix.c')
| -rw-r--r-- | migration/unix.c | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/migration/unix.c b/migration/unix.c deleted file mode 100644 index d9aac36b9a..0000000000 --- a/migration/unix.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * QEMU live migration via Unix Domain Sockets - * - * Copyright Red Hat, Inc. 2009 - * - * Authors: - * Chris Lalancette <clalance@redhat.com> - * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. - * - * Contributions after 2012-01-13 are licensed under the terms of the - * GNU GPL, version 2 or (at your option) any later version. - */ - -#include "qemu/osdep.h" - -#include "qemu-common.h" -#include "qemu/error-report.h" -#include "qemu/sockets.h" -#include "qemu/main-loop.h" -#include "migration/migration.h" -#include "migration/qemu-file.h" -#include "block/block.h" - -//#define DEBUG_MIGRATION_UNIX - -#ifdef DEBUG_MIGRATION_UNIX -#define DPRINTF(fmt, ...) \ - do { printf("migration-unix: " fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) -#endif - -static void unix_wait_for_connect(int fd, Error *err, void *opaque) -{ - MigrationState *s = opaque; - - if (fd < 0) { - DPRINTF("migrate connect error: %s\n", error_get_pretty(err)); - s->to_dst_file = NULL; - migrate_fd_error(s); - } else { - DPRINTF("migrate connect success\n"); - s->to_dst_file = qemu_fopen_socket(fd, "wb"); - migrate_fd_connect(s); - } -} - -void unix_start_outgoing_migration(MigrationState *s, const char *path, Error **errp) -{ - unix_nonblocking_connect(path, unix_wait_for_connect, s, errp); -} - -static void unix_accept_incoming_migration(void *opaque) -{ - struct sockaddr_un addr; - socklen_t addrlen = sizeof(addr); - int s = (intptr_t)opaque; - QEMUFile *f; - int c, err; - - do { - c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen); - err = errno; - } while (c < 0 && err == EINTR); - qemu_set_fd_handler(s, NULL, NULL, NULL); - close(s); - - DPRINTF("accepted migration\n"); - - if (c < 0) { - error_report("could not accept migration connection (%s)", - strerror(err)); - return; - } - - f = qemu_fopen_socket(c, "rb"); - if (f == NULL) { - error_report("could not qemu_fopen socket"); - goto out; - } - - process_incoming_migration(f); - return; - -out: - close(c); -} - -void unix_start_incoming_migration(const char *path, Error **errp) -{ - int s; - - s = unix_listen(path, NULL, 0, errp); - if (s < 0) { - return; - } - - qemu_set_fd_handler(s, unix_accept_incoming_migration, NULL, - (void *)(intptr_t)s); -} |