qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH v6 5/6] char: unix/tcp: Add a non-blocking write


From: Amit Shah
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
User-agent: Mutt/1.5.19 (2009-01-05)

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 via email to

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