Skip to content
Commit 1add4b76 authored by Sasha Levin's avatar Sasha Levin Committed by Will Deacon
Browse files

kvm tools: Allow remapping guest TTY into host PTS



This patch adds the '-tty' option to 'kvm run' which allows the user to
remap a guest TTY into a PTS on the host.

Usage:
        'kvm run --tty [id]'

The tty will be mapped to a pts and will be printed on the screen:
        '  Info: Assigned terminal 1 to pty /dev/pts/X'

At this point, it is possible to communicate with the guest using that pty.

This is useful for debugging guest kernel using KGDB:

1. Run the guest:
        'kvm run -k [vmlinuz] -p "kgdboc=ttyS1 kgdbwait" --tty 1'

And see which PTY got assigned to ttyS1.

2. Run GDB on the host:
        'gdb [vmlinuz]'

3. Connect to the guest (from within GDB):
        'target remote /dev/pty/X'

4. Start debugging! (enter 'continue' to continue boot).

Cc: David Evensky <evensky@dancer.ca.sandia.gov>
Signed-off-by: default avatarSasha Levin <levinsasha928@gmail.com>
parent d1f3131d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment