diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-12-30 15:11:30 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-12-30 15:11:30 -0200 |
commit | cf9577525e94ff7972edf2b03979b41abdedb95b (patch) | |
tree | 092175ee62441fd1fb41178b6f01b7acf0c6494d /kvmx | |
parent | 8abd7921ce1ba37e1b35083dd9fb565680694079 (diff) | |
download | kvmx-cf9577525e94ff7972edf2b03979b41abdedb95b.tar.gz kvmx-cf9577525e94ff7972edf2b03979b41abdedb95b.tar.bz2 |
Adds monitor action
Diffstat (limited to 'kvmx')
-rwxr-xr-x | kvmx | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -166,6 +166,7 @@ function __kvmx_initialize { SPICELOG="$LOG_DIR/spice" XPRALOG="$LOG_DIR/xpra" XDMCPLOG="$LOG_DIR/xdmcp" + MONITORFILE="$STATE_DIR/monitor" if [ -e "$STORAGE/ssh/$VM.key" ]; then mkdir -p "$STORAGE/ssh" @@ -376,6 +377,7 @@ function kvmx_up { -device virtio-serial-pci \ -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \ -chardev spicevmc,id=spicechannel0,name=vdagent \ + -chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \ -smp $smp -soundhw ac97 -cpu host -balloon virtio \ -net nic,model=$nic_model \ -net user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd $qemu_opts &> $LOGFILE < /dev/null & @@ -1370,6 +1372,21 @@ function kvmx_mv { kvmx_rename $* } +# Interface to QEMU monitor +function kvmx_monitor { + if ! kvmx_running; then + echo "$BASENAME: guest $VM is not running" + exit 1 + fi + + if ! which socat &> /dev/null; then + echo "$BASENAME: please install socat" + exit 1 + fi + + socat $MONITORFILE STDIO +} + # Install system function kvmx_install { if kvmx_running; then |