qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] A question about this commit "char: convert from GIOCha


From: wangyunjian
Subject: Re: [Qemu-devel] A question about this commit "char: convert from GIOChannel to QIOChannel"
Date: Mon, 17 Oct 2016 14:17:45 +0000

In function tcp_chr_close, the s->sioc needs call object_unref() to be released 
? 

About the below code:

@@ -3205,10 +3205,13 @@ static void tcp_chr_close(CharDriverState *chr)
         s->listen_tag = 0;
     }
     if (s->listen_ioc) {
         object_unref(OBJECT(s->listen_ioc));
     }
+    if (s->sioc) {
+        object_unref(OBJECT(s->sioc));
+    }
     if (s->read_msgfds_num) {
         for (i = 0; i < s->read_msgfds_num; i++) {
             close(s->read_msgfds[i]);
         }
         g_free(s->read_msgfds);

Thanks

Yunjian

-----Original Message-----
From: Paolo Bonzini [mailto:address@hidden 
Sent: Monday, October 17, 2016 9:20 PM
To: wangyunjian
Cc: address@hidden; address@hidden; caihe
Subject: Re: A question about this commit "char: convert from GIOChannel to 
QIOChannel"



----- Original Message -----
> From: "wangyunjian" <address@hidden>
> To: address@hidden, address@hidden, address@hidden
> Cc: "caihe" <address@hidden>
> Sent: Monday, October 17, 2016 3:02:32 PM
> Subject: A question about this commit "char: convert from GIOChannel to 
> QIOChannel"
> 
> Commit 9894dc0cdcc397ee5b26370bc53da6d360a363c2 “char: convert from 
> GIOChannel to QIOChannel”, the old version will call closesocket when 
> tcp_chr_close and udp_chr_close are called. But the new version will 
> not call closesocket.
> 
> This can bring to a socket leak?

Hi, closesocket is called in io/channel-socket.c (qio_channel_socket_finalize).

Thanks,

Paolo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]