qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: Paul Brook <paul@codesourcery.com>,
	qemu list <qemu-devel@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] Re: [PATCH v6 5/6] char: unix/tcp: Add a non-blocking write handler
Date: Wed, 5 May 2010 01:28:20 +0530	[thread overview]
Message-ID: <20100504195820.GB1109@amit-x200.redhat.com> (raw)
In-Reply-To: <m3wrvj1lzy.fsf@trasno.mitica>

On (Tue) May 04 2010 [21:54:09], Juan Quintela wrote:
> >  static void tcp_chr_connect(void *opaque)
> >  {
> >      CharDriverState *chr = opaque;
> >      TCPCharDriver *s = chr->opaque;
> > +    IOHandler *write_cb;
> > +    int flags;
> > +    bool nonblock;
> > +
> > +    flags = fcntl(s->fd, F_GETFL);
> > +    if (flags == -1) {
> > +        flags = 0;
> > +    }
> > +    nonblock = flags & O_NONBLOCK;
> > +
> > +    write_cb = NULL;
> > +    chr->nonblock = false;
> > +    if (nonblock && chr->chr_write_unblocked) {
> > +        write_cb = chr->chr_write_unblocked;
> > +        chr->nonblock = true;
> > +    }
> >  
> > +    chr->write_blocked = false;
> >      s->connected = 1;
> >      qemu_set_fd_handler2(s->fd, tcp_chr_read_poll,
> 
> write_cb is a write-only variable, no?

Leftover from previous design.

I'll clean this up in the next series (already applied to my local
branch).

Thanks,
		Amit

  reply	other threads:[~2010-05-04 20:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04 18:23 [Qemu-devel] [PATCH v6 0/6] char: non-blocking writes, virtio-console flow control Amit Shah
2010-05-04 18:23 ` [Qemu-devel] [PATCH v6 1/6] virtio-console: Factor out common init between console and generic ports Amit Shah
2010-05-04 18:23   ` [Qemu-devel] [PATCH v6 2/6] char: Add a QemuChrHandlers struct to initialise chardev handlers Amit Shah
2010-05-04 18:23     ` [Qemu-devel] [PATCH v6 3/6] char: Let writers know how much data was written in case of errors Amit Shah
2010-05-04 18:23       ` [Qemu-devel] [PATCH v6 4/6] char: Add qemu_chr_write_nb() for nonblocking writes Amit Shah
2010-05-04 18:23         ` [Qemu-devel] [PATCH v6 5/6] char: unix/tcp: Add a non-blocking write handler Amit Shah
2010-05-04 18:23           ` [Qemu-devel] [PATCH v6 6/6] virtio-console: Throttle virtio-serial-bus if we can't consume any more guest data Amit Shah
2010-05-04 20:28             ` [Qemu-devel] " Juan Quintela
2010-05-04 19:54           ` [Qemu-devel] Re: [PATCH v6 5/6] char: unix/tcp: Add a non-blocking write handler Juan Quintela
2010-05-04 19:58             ` Amit Shah [this message]
2010-05-04 19:23 ` [Qemu-devel] Re: [PATCH v6 0/6] char: non-blocking writes, virtio-console flow control Gerd Hoffmann

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=20100504195820.GB1109@amit-x200.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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).