Revision d0f2c4c6 migration-tcp.c
b/migration-tcp.c | ||
---|---|---|
22 | 22 |
//#define DEBUG_MIGRATION_TCP |
23 | 23 |
|
24 | 24 |
#ifdef DEBUG_MIGRATION_TCP |
25 |
#define dprintf(fmt, ...) \
|
|
25 |
#define DPRINTF(fmt, ...) \
|
|
26 | 26 |
do { printf("migration-tcp: " fmt, ## __VA_ARGS__); } while (0) |
27 | 27 |
#else |
28 |
#define dprintf(fmt, ...) \
|
|
28 |
#define DPRINTF(fmt, ...) \
|
|
29 | 29 |
do { } while (0) |
30 | 30 |
#endif |
31 | 31 |
|
... | ... | |
41 | 41 |
|
42 | 42 |
static int tcp_close(FdMigrationState *s) |
43 | 43 |
{ |
44 |
dprintf("tcp_close\n");
|
|
44 |
DPRINTF("tcp_close\n");
|
|
45 | 45 |
if (s->fd != -1) { |
46 | 46 |
close(s->fd); |
47 | 47 |
s->fd = -1; |
... | ... | |
56 | 56 |
int val, ret; |
57 | 57 |
socklen_t valsize = sizeof(val); |
58 | 58 |
|
59 |
dprintf("connect completed\n");
|
|
59 |
DPRINTF("connect completed\n");
|
|
60 | 60 |
do { |
61 | 61 |
ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize); |
62 | 62 |
} while (ret == -1 && (s->get_error(s)) == EINTR); |
... | ... | |
71 | 71 |
if (val == 0) |
72 | 72 |
migrate_fd_connect(s); |
73 | 73 |
else { |
74 |
dprintf("error connecting %d\n", val);
|
|
74 |
DPRINTF("error connecting %d\n", val);
|
|
75 | 75 |
migrate_fd_error(s); |
76 | 76 |
} |
77 | 77 |
} |
... | ... | |
127 | 127 |
} while (ret == -EINTR); |
128 | 128 |
|
129 | 129 |
if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) { |
130 |
dprintf("connect failed\n");
|
|
130 |
DPRINTF("connect failed\n");
|
|
131 | 131 |
close(s->fd); |
132 | 132 |
qemu_free(s); |
133 | 133 |
return NULL; |
... | ... | |
149 | 149 |
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen); |
150 | 150 |
} while (c == -1 && socket_error() == EINTR); |
151 | 151 |
|
152 |
dprintf("accepted migration\n");
|
|
152 |
DPRINTF("accepted migration\n");
|
|
153 | 153 |
|
154 | 154 |
if (c == -1) { |
155 | 155 |
fprintf(stderr, "could not accept migration connection\n"); |
... | ... | |
168 | 168 |
goto out_fopen; |
169 | 169 |
} |
170 | 170 |
qemu_announce_self(); |
171 |
dprintf("successfully loaded vm state\n");
|
|
171 |
DPRINTF("successfully loaded vm state\n");
|
|
172 | 172 |
|
173 | 173 |
/* we've successfully migrated, close the server socket */ |
174 | 174 |
qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL); |
Also available in: Unified diff