From: Osier Yang Date: Mon, 14 Mar 2011 07:11:03 +0000 (+0800) Subject: virsh: Free stream when shutdown console X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=abfa97a2259e4b9cc8843b164e94c0e4aa26ec57;p=libvirt.git virsh: Free stream when shutdown console Otherwise connection of hypervisor driver will be leaked when one shutdown the guest in console. e.g. [root@localhost]# init 0 ...... init: Re-executing /sbin/init Halting system... Power down. error: Failed to disconnect from the hypervisor, 1 leaked reference(s) --- diff --git a/tools/console.c b/tools/console.c index b9dd26832d..0428239ab3 100644 --- a/tools/console.c +++ b/tools/console.c @@ -92,6 +92,8 @@ virConsoleShutdown(virConsolePtr con) { con->quit = true; virStreamEventRemoveCallback(con->st); + if (con->st) + virStreamFree(con->st); if (con->stdinWatch != -1) virEventRemoveHandle(con->stdinWatch); if (con->stdinWatch != -1)