]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Ensure stream is aborted when exiting console
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 1 Mar 2011 14:59:45 +0000 (14:59 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 16 Aug 2011 21:38:11 +0000 (14:38 -0700)
After running 'virsh console' in interactive mode, there was a
missing call to virStreamAbort, which meant the server kept the
stream resources open

* tools/console.c: Abort stream when exiting

tools/console.c

index 171ebc9845ba73f91dded9eda8715605543a41bb..82ef53700368a3ae7e5f91502819291e59a8946d 100644 (file)
@@ -90,9 +90,11 @@ static void
 virConsoleShutdown(virConsolePtr con)
 {
     con->quit = true;
-    virStreamEventRemoveCallback(con->st);
-    if (con->st)
+    if (con->st) {
+        virStreamEventRemoveCallback(con->st);
+        virStreamAbort(con->st);
         virStreamFree(con->st);
+    }
     if (con->stdinWatch != -1)
         virEventRemoveHandle(con->stdinWatch);
     if (con->stdoutWatch != -1)