#! /bin/bash
# vim: shiftwidth=4 tabstop=4 expandtab

function _console() {
    run_external ssh -t "$2" "$REAL_VIRSH" console "$1"
}

_simple_command \
    --function _console \
    --long-help \
        "Connect to VM serial console" \
        "" \
        "Note: Serial console must be enable in VM on ttyS0. To enable it:" \
        " * run 'sudo systemctl enable --now serial-getty@ttyS0.service'" \
        " * edit /etc/default/grub to add 'console=tty0 console=ttyS0,115200n8' in the" \
        "   GRUB_CMDLINE_LINUX_DEFAULT variable" \
        " * run 'sudo update-grub' command"
