]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: Show 'connected to console' message later
authorAndrea Bolognani <abologna@redhat.com>
Thu, 28 Mar 2024 22:36:40 +0000 (23:36 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 2 Apr 2024 16:26:35 +0000 (18:26 +0200)
commit16d37076be8e1c1bc5c683b303dfd93f5c2131a4
treecd47d099dea21968817572f5d2266729c6544f3c
parent1e853a64dd2fc9f9106003de138de3c284bc79b5
virsh: Show 'connected to console' message later

Right now, we display the message before actually attempting
to connect to the VM console. That operation, however, can
fail for a number of reasons: for example, is the VM doesn't
have a serial device, the output ends up looking like

  $ virsh console cirros
  Connected to domain 'cirros'
  Escape character is ^] (Ctrl + ])
  error: internal error: cannot find character device <null>

The initial message is misleading. Change things so that it's
only printed if we actually successfully connected to the VM
console.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tools/virsh-console.c
tools/virsh-domain.c