qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: wangyunjian <wangyunjian@huawei.com>
Cc: berrange@redhat.com, qemu-devel@nongnu.org, caihe <caihe@huawei.com>
Subject: Re: [Qemu-devel] A question about this commit "char: convert from GIOChannel to QIOChannel"
Date: Mon, 17 Oct 2016 10:47:30 -0400 (EDT)	[thread overview]
Message-ID: <1176407847.4084049.1476715650328.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <34EFBCA9F01B0748BEB6B629CE643AE60B058318@szxeml561-mbx.china.huawei.com>



----- Original Message -----
> From: "wangyunjian" <wangyunjian@huawei.com>
> To: "Paolo Bonzini" <pbonzini@redhat.com>
> Cc: berrange@redhat.com, qemu-devel@nongnu.org, "caihe" <caihe@huawei.com>
> Sent: Monday, October 17, 2016 4:17:45 PM
> Subject: RE: A question about this commit "char: convert from GIOChannel to QIOChannel"
> 
> 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);

This is done in tcp_chr_free_connection.  Maybe your tree does not have
commit 5b498459b441f4639fd4c39c35345637bfc6c16c?

Paolo

> Thanks
> 
> Yunjian
> 
> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Monday, October 17, 2016 9:20 PM
> To: wangyunjian
> Cc: berrange@redhat.com; qemu-devel@nongnu.org; caihe
> Subject: Re: A question about this commit "char: convert from GIOChannel to
> QIOChannel"
> 
> 
> 
> ----- Original Message -----
> > From: "wangyunjian" <wangyunjian@huawei.com>
> > To: berrange@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org
> > Cc: "caihe" <caihe@huawei.com>
> > 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	other threads:[~2016-10-17 14:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 13:02 [Qemu-devel] A question about this commit "char: convert from GIOChannel to QIOChannel" wangyunjian
2016-10-17 13:20 ` Paolo Bonzini
2016-10-17 14:17   ` wangyunjian
2016-10-17 14:47     ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1176407847.4084049.1476715650328.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=caihe@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wangyunjian@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).