Patchwork [2/6] migration: close socket QEMUFile from socket_close

login
register
mail settings
Submitter Paolo Bonzini
Date Aug. 7, 2012, 3:51 p.m.
Message ID <1344354707-27315-3-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/175739/
State New
Headers show

Comments

Paolo Bonzini - Aug. 7, 2012, 3:51 p.m.
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 587413e..62a6891 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -137,6 +137,8 @@  static void tcp_accept_incoming_migration(void *opaque)
 
     process_incoming_migration(f);
     qemu_fclose(f);
+    return;
+
 out:
     close(c);
 }
diff --git a/migration-unix.c b/migration-unix.c
index a407af2..57aca11 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -147,6 +147,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 6e82b2d..57cae52 100644
--- a/savevm.c
+++ b/savevm.c
@@ -210,6 +210,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;
+    close(s->fd);
     g_free(s);
     return 0;
 }