[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 8/8] migration-unix: side channel support on unix in
From: |
Lei Li |
Subject: |
[Qemu-devel] [PATCH 8/8] migration-unix: side channel support on unix incoming |
Date: |
Wed, 25 Sep 2013 22:32:48 +0800 |
Add side channel support on incoming part of unix migration to enable
localhost migration with page flipping approach. If there is a pipe
available by checking recv_pipefd(), it will fetch the pipe file
descriptor and open it by qemu_fopen_pipe() with read mode for the
pipe protocol introduced.
Signed-off-by: Lei Li <address@hidden>
---
migration-unix.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/migration-unix.c b/migration-unix.c
index 0bfc1c7..878e063 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -85,6 +85,7 @@ static void unix_accept_incoming_migration(void *opaque)
int s = (intptr_t)opaque;
QEMUFile *f;
int c;
+ int pipefd;
do {
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen);
@@ -99,7 +100,18 @@ static void unix_accept_incoming_migration(void *opaque)
goto out;
}
- f = qemu_fopen_socket(c, "rb");
+ /* Check if there is a pipe fd to be recevied for a page-flipping
+ * migration */
+
+ pipefd = recv_pipefd(c);
+ if (pipefd > 0) {
+ DPRINTF("receive pipe file descriptor successfully\n");
+
+ f = qemu_fopen_pipe(pipefd, "r");
+ } else {
+ f = qemu_fopen_socket(c, "rb");
+ }
+
if (f == NULL) {
fprintf(stderr, "could not qemu_fopen socket\n");
goto out;
--
1.7.7.6
- [Qemu-devel] [PATCH 0/8 RFC] migration: Introduce side channel for RAM, Lei Li, 2013/09/25
- [Qemu-devel] [PATCH 1/8] migration-local: add pipe protocol for QEMUFileOps, Lei Li, 2013/09/25
- [Qemu-devel] [PATCH 3/8] migration-local: add send_pipefd(), Lei Li, 2013/09/25
- [Qemu-devel] [PATCH 5/8] QAPI: introduce magration capability unix_page_flipping, Lei Li, 2013/09/25
- [Qemu-devel] [PATCH 4/8] migration-local: add recv_pipefd(), Lei Li, 2013/09/25
- [Qemu-devel] [PATCH 6/8] migration: add migrate_unix_page_flipping(), Lei Li, 2013/09/25
- [Qemu-devel] [PATCH 7/8] migration-unix: side channel support on unix outgoing, Lei Li, 2013/09/25
- [Qemu-devel] [PATCH 8/8] migration-unix: side channel support on unix incoming,
Lei Li <=
- [Qemu-devel] [PATCH 2/8] migration-loca: add qemu_fopen_pipe(), Lei Li, 2013/09/25
- Re: [Qemu-devel] [PATCH 0/8 RFC] migration: Introduce side channel for RAM, Paolo Bonzini, 2013/09/25