]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Free stream when shutdown console
authorOsier Yang <jyang@redhat.com>
Mon, 14 Mar 2011 07:11:03 +0000 (15:11 +0800)
committerOsier Yang <jyang@redhat.com>
Mon, 14 Mar 2011 07:11:03 +0000 (15:11 +0800)
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)

tools/console.c

index b9dd26832d6f9e92d02aa1ff8ff34d7317297b62..0428239ab3ab93dc7338b000345f430f3978713d 100644 (file)
@@ -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)