Patchwork [09/12] migration: close socket QEMUFile from socket_close

login
register
mail settings
Submitter Paolo Bonzini
Date Nov. 2, 2012, 5:51 p.m.
Message ID <1351878665-32413-10-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/196740/
State New
Headers show

Comments

Paolo Bonzini - Nov. 2, 2012, 5:51 p.m.
The common suffix now is process_incoming_migration+qemu_fclose.

Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 migration-tcp.c  | 2 ++
 migration-unix.c | 2 ++
 savevm.c         | 1 +
 3 file modificati, 5 inserzioni(+)

Patch

diff --git a/migration-tcp.c b/migration-tcp.c
index bb27ce8..1279cc9 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -103,6 +103,8 @@  static void tcp_accept_incoming_migration(void *opaque)
 
     process_incoming_migration(f);
     qemu_fclose(f);
+    return;
+
 out:
     closesocket(c);
 }
diff --git a/migration-unix.c b/migration-unix.c
index 9b5521e..96ea71b 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -103,6 +103,8 @@  static void unix_accept_incoming_migration(void *opaque)
 
     process_incoming_migration(f);
     qemu_fclose(f);
+    return;
+
 out:
     close(c);
 }
diff --git a/savevm.c b/savevm.c
index 0ab1ad4..cdad3ad 100644
--- a/savevm.c
+++ b/savevm.c
@@ -213,6 +213,7 @@  static int socket_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)
 static int socket_close(void *opaque)
 {
     QEMUFileSocket *s = opaque;
+    closesocket(s->fd);
     g_free(s);
     return 0;
 }