Revision d0f2c4c6 migration-fd.c
b/migration-fd.c | ||
---|---|---|
24 | 24 |
//#define DEBUG_MIGRATION_FD |
25 | 25 |
|
26 | 26 |
#ifdef DEBUG_MIGRATION_FD |
27 |
#define dprintf(fmt, ...) \
|
|
27 |
#define DPRINTF(fmt, ...) \
|
|
28 | 28 |
do { printf("migration-fd: " fmt, ## __VA_ARGS__); } while (0) |
29 | 29 |
#else |
30 |
#define dprintf(fmt, ...) \
|
|
30 |
#define DPRINTF(fmt, ...) \
|
|
31 | 31 |
do { } while (0) |
32 | 32 |
#endif |
33 | 33 |
|
... | ... | |
43 | 43 |
|
44 | 44 |
static int fd_close(FdMigrationState *s) |
45 | 45 |
{ |
46 |
dprintf("fd_close\n");
|
|
46 |
DPRINTF("fd_close\n");
|
|
47 | 47 |
if (s->fd != -1) { |
48 | 48 |
close(s->fd); |
49 | 49 |
s->fd = -1; |
... | ... | |
64 | 64 |
|
65 | 65 |
s->fd = monitor_get_fd(mon, fdname); |
66 | 66 |
if (s->fd == -1) { |
67 |
dprintf("fd_migration: invalid file descriptor identifier\n");
|
|
67 |
DPRINTF("fd_migration: invalid file descriptor identifier\n");
|
|
68 | 68 |
goto err_after_alloc; |
69 | 69 |
} |
70 | 70 |
|
71 | 71 |
if (fcntl(s->fd, F_SETFL, O_NONBLOCK) == -1) { |
72 |
dprintf("Unable to set nonblocking mode on file descriptor\n");
|
|
72 |
DPRINTF("Unable to set nonblocking mode on file descriptor\n");
|
|
73 | 73 |
goto err_after_open; |
74 | 74 |
} |
75 | 75 |
|
... | ... | |
112 | 112 |
goto err; |
113 | 113 |
} |
114 | 114 |
qemu_announce_self(); |
115 |
dprintf("successfully loaded vm state\n");
|
|
115 |
DPRINTF("successfully loaded vm state\n");
|
|
116 | 116 |
/* we've successfully migrated, close the fd */ |
117 | 117 |
qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL); |
118 | 118 |
if (autostart) |
... | ... | |
127 | 127 |
int fd; |
128 | 128 |
QEMUFile *f; |
129 | 129 |
|
130 |
dprintf("Attempting to start an incoming migration via fd\n");
|
|
130 |
DPRINTF("Attempting to start an incoming migration via fd\n");
|
|
131 | 131 |
|
132 | 132 |
fd = strtol(infd, NULL, 0); |
133 | 133 |
f = qemu_fdopen(fd, "rb"); |
134 | 134 |
if(f == NULL) { |
135 |
dprintf("Unable to apply qemu wrapper to file descriptor\n");
|
|
135 |
DPRINTF("Unable to apply qemu wrapper to file descriptor\n");
|
|
136 | 136 |
return -errno; |
137 | 137 |
} |
138 | 138 |
|
Also available in: Unified diff