Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serial: Add --device virtio-serial,pty support #113

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Mar 15, 2024

  1. Use gocleanup package

    pkg/vf/virtionet.go uses local adhoc solution to run cleanup tasks when
    vfkit exits.
    github.com/onsi/gocleanup achieves the same result in more generic code.
    
    Since there are more things I'd like to cleanup at exit time, let's make
    use of this package. It hasn't been changed in a long time, but its code
    is a short single file, at worse we can import this file in vfkit
    repository and make the changes we need.
    
    Signed-off-by: Christophe Fergeau <[email protected]>
    cfergeau committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    0589358 View commit details
    Browse the repository at this point in the history
  2. rest: Use gocleanup

    When using the REST API over a unix socket, this ensures the unix socket
    is removed from the filesystem when vfkit exits.
    cfergeau committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    9989850 View commit details
    Browse the repository at this point in the history
  3. serial: Add --device virtio-serial,pty support

    This new virtio-serial option allocates a pseudo-tty for the VM console.
    It can then be accessed using `screen` for example.
    This is a bit similar to the `--device virtio-serial,stdio` option,
    except that the console is not tied to the terminal running vfkit, it's
    possible to connect/disconnect from the pseudo-tty from any terminal.
    
    This fixes crc-org#48
    
    Signed-off-by: Christophe Fergeau <[email protected]>
    cfergeau committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    6836da5 View commit details
    Browse the repository at this point in the history
  4. virtio: Simplify setRawMode

    This uses more helper APIs from github.com/pkg/term/termios, and makes
    the code closer to Apple's recommendations in
    https://developer.apple.com/documentation/virtualization/running_linux_in_a_virtual_machine?language=objc#:~:text=Configure%20the%20Serial%20Port%20Device%20for%20Standard%20In%20and%20Out
    This also removes direct use of `syscall` in pkg/vf/virtio.go
    
    Signed-off-by: Christophe Fergeau <[email protected]>
    cfergeau committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    a570c1b View commit details
    Browse the repository at this point in the history