Skip to contentSkip to conversation

xenconsoled: close logfile when cleaning up domain

PATCH New Ian Campbell 1 participant 1 message Jul 19, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenconsoled: close logfile when cleaning up domain

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.

tools/console/daemon/io.c +5 -0
diff -r 81cc627934c6 -r 11da502b927f tools/console/daemon/io.c
@@ -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;