From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH] xenconsoled: close logfile when cleaning up domain Date: Mon, 19 Jul 2010 09:03:03 +0100 Message-ID: <11da502b927fd098186c.1279526583@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org Without this we leak an fd on each domain shutdown and eventually run out of file descriptors meaning new the console of new domains are not logged. Seems to have been accidentally removed in 16638:28921e83000b. Signed-off-by: Ian Campbell diff -r 81cc627934c6 -r 11da502b927f tools/console/daemon/io.c --- a/tools/console/daemon/io.c Mon Jul 19 09:01:24 2010 +0100 +++ b/tools/console/daemon/io.c Mon Jul 19 09:01:24 2010 +0100 @@ -747,6 +747,11 @@ { domain_close_tty(d); + if (d->log_fd != -1) { + close(d->log_fd); + d->log_fd = -1; + } + free(d->buffer.data); d->buffer.data = NULL;