projects
/
qemu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tcg: Don't make exitreq flag a local temporary
[qemu.git]
/
migration-tcp.c
diff --git
a/migration-tcp.c
b/migration-tcp.c
index 46f6ac545cb08b9347e7e020017b58eac7d22a73..e78a296137dde435a4a320f5225620cbb5ad9dac 100644
(file)
--- a/
migration-tcp.c
+++ b/
migration-tcp.c
@@
-14,11
+14,10
@@
*/
#include "qemu-common.h"
*/
#include "qemu-common.h"
-#include "qemu_socket.h"
-#include "migration.h"
-#include "qemu-char.h"
-#include "buffered_file.h"
-#include "block.h"
+#include "qemu/sockets.h"
+#include "migration/migration.h"
+#include "migration/qemu-file.h"
+#include "block/block.h"
//#define DEBUG_MIGRATION_TCP
//#define DEBUG_MIGRATION_TCP
@@
-44,11
+43,8
@@
static int tcp_close(MigrationState *s)
{
int r = 0;
DPRINTF("tcp_close\n");
{
int r = 0;
DPRINTF("tcp_close\n");
- if (s->fd != -1) {
- if (close(s->fd) < 0) {
- r = -errno;
- }
- s->fd = -1;
+ if (closesocket(s->fd) < 0) {
+ r = -socket_error();
}
return r;
}
}
return r;
}
@@
-64,6
+60,7
@@
static void tcp_wait_for_connect(int fd, void *opaque)
} else {
DPRINTF("migrate connect success\n");
s->fd = fd;
} else {
DPRINTF("migrate connect success\n");
s->fd = fd;
+ socket_set_block(s->fd);
migrate_fd_connect(s);
}
}
migrate_fd_connect(s);
}
}
@@
-88,12
+85,14
@@
static void tcp_accept_incoming_migration(void *opaque)
do {
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen);
} while (c == -1 && socket_error() == EINTR);
do {
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen);
} while (c == -1 && socket_error() == EINTR);
+ qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
+ closesocket(s);
DPRINTF("accepted migration\n");
if (c == -1) {
fprintf(stderr, "could not accept migration connection\n");
DPRINTF("accepted migration\n");
if (c == -1) {
fprintf(stderr, "could not accept migration connection\n");
- goto out
2
;
+ goto out;
}
f = qemu_fopen_socket(c);
}
f = qemu_fopen_socket(c);
@@
-103,12
+102,10
@@
static void tcp_accept_incoming_migration(void *opaque)
}
process_incoming_migration(f);
}
process_incoming_migration(f);
- qemu_fclose(f);
+ return;
+
out:
out:
- close(c);
-out2:
- qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
- close(s);
+ closesocket(c);
}
void tcp_start_incoming_migration(const char *host_port, Error **errp)
}
void tcp_start_incoming_migration(const char *host_port, Error **errp)
This page took
0.025292 seconds
and
4
git commands to generate.