Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-24 Thread Matthias Bolte
2010/8/23 Daniel P. Berrange berra...@redhat.com: On Mon, Aug 23, 2010 at 01:25:50PM +0200, Soren Hansen wrote: Like the comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file

[libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-23 Thread Soren Hansen
Like the comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file for input for a chardev and this also mimics what e.g. QEmu does internally. Signed-off-by: Soren Hansen

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-23 Thread Daniel P. Berrange
On Mon, Aug 23, 2010 at 12:19:51PM +0200, Soren Hansen wrote: Like the comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file for input for a chardev and this also mimics what

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-23 Thread Soren Hansen
On 23-08-2010 12:42, Daniel P. Berrange wrote: +/* + * At the moment, the only thing that populates keepfd is + * umlBuildCommandLineChr. We want to close every fd it opens. + */ +openmax = sysconf (_SC_OPEN_MAX); +for (i = 0; i openmax; i++) +if

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-23 Thread Daniel P. Berrange
On Mon, Aug 23, 2010 at 12:59:16PM +0200, Soren Hansen wrote: On 23-08-2010 12:42, Daniel P. Berrange wrote: +/* + * At the moment, the only thing that populates keepfd is + * umlBuildCommandLineChr. We want to close every fd it opens. + */ +openmax = sysconf

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-23 Thread Soren Hansen
On 23-08-2010 13:04, Daniel P. Berrange wrote: Ok, I'll fix that up, but just so that I understand: Your concern is that there might be an open file descriptor between FD_SETSIZE and _SC_OPEN_MAX that we don't want to close? No, its that if you try to run FD_ISSET for i FD_SETSIZE, you'll

[libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-23 Thread Soren Hansen
Like the comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file for input for a chardev and this also mimics what e.g. QEmu does internally. Signed-off-by: Soren Hansen

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-23 Thread Daniel P. Berrange
On Mon, Aug 23, 2010 at 01:25:50PM +0200, Soren Hansen wrote: Like the comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file for input for a chardev and this also mimics what

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-19 Thread Daniel P. Berrange
On Wed, Aug 18, 2010 at 01:35:29PM +0200, so...@linux2go.dk wrote: From: Soren Hansen so...@linux2go.dk Like that comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file for

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-19 Thread Soren Hansen
On 19-08-2010 15:41, Daniel P. Berrange wrote: + case VIR_DOMAIN_CHR_TYPE_PIPE: +/* XXX could open the pipe just pass the FDs */ Any reason not to let the code deal with PIPE too ? It seems like the code should work equally well for both PIPE FILE. (well drop the O_CREATE|O_APPEND

[libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-18 Thread soren
From: Soren Hansen so...@linux2go.dk Like that comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file for input for a chardev and this also mimics what e.g. QEmu does internally.

Re: [libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-18 Thread Soren Hansen
On 18-08-2010 12:45, so...@linux2go.dk wrote: diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 04493ba..5f73ce2 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -737,10 +737,6 @@ static int umlMonitorCommand(const struct uml_driver *driver,

[libvirt] [PATCH] Allow chardev of type 'file' for UML domains.

2010-08-18 Thread soren
From: Soren Hansen so...@linux2go.dk Like that comment suggested, we just open the file and pass the file descriptor to uml. The input stream is set to null, since I couldn't find any useful way to actually use a file for input for a chardev and this also mimics what e.g. QEmu does internally.