Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-17 Thread Blue Swirl
On Tue, Nov 17, 2009 at 11:12 AM, Kevin Wolf wrote: > Am 17.11.2009 00:05, schrieb Jamie Lokier: >> Blue Swirl wrote: >>> On Mon, Nov 16, 2009 at 2:47 PM, Kevin Wolf wrote: Am 13.11.2009 22:05, schrieb Blue Swirl: > On Fri, Nov 13, 2009 at 5:17 PM, Kevin Wolf wrote: >> We're leaking

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-17 Thread Kevin Wolf
Am 17.11.2009 00:05, schrieb Jamie Lokier: > Blue Swirl wrote: >> On Mon, Nov 16, 2009 at 2:47 PM, Kevin Wolf wrote: >>> Am 13.11.2009 22:05, schrieb Blue Swirl: On Fri, Nov 13, 2009 at 5:17 PM, Kevin Wolf wrote: > We're leaking file descriptors to child processes. Set FD_CLOEXEC on file

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-17 Thread Kevin Wolf
Am 17.11.2009 00:26, schrieb Anthony Liguori: > Kevin Wolf wrote: >> We're leaking file descriptors to child processes. Set FD_CLOEXEC on file >> descriptors that don't need to be passed to children to stop this >> misbehaviour. >> >> Signed-off-by: Kevin Wolf >> > > pid = fork(); > i

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-16 Thread Jamie Lokier
Anthony Liguori wrote: > Kevin Wolf wrote: > >We're leaking file descriptors to child processes. Set FD_CLOEXEC on file > >descriptors that don't need to be passed to children to stop this > >misbehaviour. > > > >Signed-off-by: Kevin Wolf > > > >pid = fork(); >if (pid == 0) { >

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-16 Thread Anthony Liguori
Kevin Wolf wrote: We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf pid = fork(); if (pid == 0) { int open_max = sysconf(_SC_OPEN_MAX), i;

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-16 Thread Jamie Lokier
Jamie Lokier wrote: > Blue Swirl wrote: > > On Mon, Nov 16, 2009 at 2:47 PM, Kevin Wolf wrote: > > > Am 13.11.2009 22:05, schrieb Blue Swirl: > > >> On Fri, Nov 13, 2009 at 5:17 PM, Kevin Wolf wrote: > > >>> We're leaking file descriptors to child processes. Set FD_CLOEXEC on > > >>> file > > >>

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-16 Thread Jamie Lokier
Blue Swirl wrote: > On Mon, Nov 16, 2009 at 2:47 PM, Kevin Wolf wrote: > > Am 13.11.2009 22:05, schrieb Blue Swirl: > >> On Fri, Nov 13, 2009 at 5:17 PM, Kevin Wolf wrote: > >>> We're leaking file descriptors to child processes. Set FD_CLOEXEC on file > >>> descriptors that don't need to be passe

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-16 Thread Avi Kivity
On 11/16/2009 06:21 PM, Blue Swirl wrote: How exactly would you do that? The only way I see to do it would be using void*, but I'm not sure if this really is an improvement. Instead of sockaddr_in vs. sockaddr and the lame casts in between, we could have QSockAddr which magically works.

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-16 Thread Blue Swirl
On Mon, Nov 16, 2009 at 2:47 PM, Kevin Wolf wrote: > Am 13.11.2009 22:05, schrieb Blue Swirl: >> On Fri, Nov 13, 2009 at 5:17 PM, Kevin Wolf wrote: >>> We're leaking file descriptors to child processes. Set FD_CLOEXEC on file >>> descriptors that don't need to be passed to children to stop this

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-16 Thread Kevin Wolf
Am 13.11.2009 22:05, schrieb Blue Swirl: > On Fri, Nov 13, 2009 at 5:17 PM, Kevin Wolf wrote: >> We're leaking file descriptors to child processes. Set FD_CLOEXEC on file >> descriptors that don't need to be passed to children to stop this >> misbehaviour. > >> -c = accept(s, (struct soc

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-15 Thread Jamie Lokier
Scott Tsai wrote: > On Fri, Nov 13, 2009 at 11:17 PM, Kevin Wolf wrote: > > We're leaking file descriptors to child processes. Set FD_CLOEXEC on file > > descriptors that don't need to be passed to children to stop this > > misbehaviour. > > Since qemu is a multi threaded program, how about open

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-13 Thread Blue Swirl
On Fri, Nov 13, 2009 at 5:17 PM, Kevin Wolf wrote: > We're leaking file descriptors to child processes. Set FD_CLOEXEC on file > descriptors that don't need to be passed to children to stop this > misbehaviour. > -        c = accept(s, (struct sockaddr *)&addr, &addrlen); > +        c = qemu_acc

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-13 Thread Kevin Wolf
Am 13.11.2009 16:41, schrieb Nathan Froyd: > On Fri, Nov 13, 2009 at 04:17:16PM +0100, Kevin Wolf wrote: >> We're leaking file descriptors to child processes. Set FD_CLOEXEC on file >> descriptors that don't need to be passed to children to stop this >> misbehaviour. >> >>> --- a/gdbstub.c >> +++ b

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-13 Thread Nathan Froyd
On Fri, Nov 13, 2009 at 04:17:16PM +0100, Kevin Wolf wrote: > We're leaking file descriptors to child processes. Set FD_CLOEXEC on file > descriptors that don't need to be passed to children to stop this > misbehaviour. > >> --- a/gdbstub.c > +++ b/gdbstub.c > @@ -2356,6 +2356,9 @@ static void gdb_

Re: [Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-13 Thread Scott Tsai
On Fri, Nov 13, 2009 at 11:17 PM, Kevin Wolf wrote: > We're leaking file descriptors to child processes. Set FD_CLOEXEC on file > descriptors that don't need to be passed to children to stop this > misbehaviour. Since qemu is a multi threaded program, how about opening those file descriptors wit

[Qemu-devel] [PATCH] Don't leak file descriptors

2009-11-13 Thread Kevin Wolf
We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf --- block/raw-posix.c |1 + gdbstub.c |6 ++ kvm-all.c |1 + migration-tcp.c|