[libvirt] [PATCH] Re-write LXC controller end-of-file I/O handling yet again

Daniel P. Berrange berrange at redhat.com
Thu Jan 12 20:32:42 UTC 2012


On Thu, Jan 12, 2012 at 12:56:23PM -0700, Eric Blake wrote:
> On 01/12/2012 10:20 AM, Daniel P. Berrange wrote:
> > @@ -1103,9 +1163,32 @@ static int lxcControllerMain(int serverFd,
> >      }
> >  
> >      for (i = 0 ; i < nFds ; i++) {
> > +        consoles[i].epollFd = -1;
> > +        consoles[i].epollFd = -1;
> 
> Why do you have this line twice?  Did you mean to initialize epollWatch
> instead?

Yes, it should have been epollWatch.

> > +        consoles[i].hostWatch = -1;
> > +        consoles[i].contWatch = -1;
> > +    }
> > +
> > +    for (i = 0 ; i < nFds ; i++) {
> >          consoles[i].hostFd = hostFds[i];
> >          consoles[i].contFd = contFds[i];
> >  
> > +        if ((consoles[i].epollFd = epoll_create(2)) < 0) {
> 
> Should we be using epoll_create1(EPOLL_CLOEXEC)?

We don't fork anything more, but I'll change it anyway just in case.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list