Re: [PATCH] virsh: Allow graceful console shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/23/19 7:40 PM, Roman Bolshakov wrote:
On Fri, Aug 23, 2019 at 03:33:36PM +0200, Michal Privoznik wrote:
Currently, whenever there's a regular EOF on the console stream
or an error the virStreamAbort() is called regardless. While this
may not actually break anything, we should call virStreamFinish()
to let the daemon know we've successfully received all the data
and are shutting down the stream gracefully.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
  tools/virsh-console.c | 41 +++++++++++++++++++++++++----------------
  1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/tools/virsh-console.c b/tools/virsh-console.c
index a235a9a283..900faa5087 100644
--- a/tools/virsh-console.c
+++ b/tools/virsh-console.c
@@ -193,7 +202,7 @@ virConsoleEventOnStream(virStreamPtr st,
          if (done == -2)
              goto cleanup; /* blocking */
          if (done < 0) {
-            virConsoleShutdown(con);
+            virConsoleShutdown(con, done == 0);
              goto cleanup;
          }
          memmove(con->terminalToStream.data,

done is always non-zero here. If that's expected, a constant would be a
bit more cleaner here to sign explicit abort, rather than conditional.

Ah, good point.


Reviewed-by: Roman Bolshakov <r.bolshakov@xxxxxxxxx>


Thanks, I've pushed this.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux