3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-08 13:09:34 +01:00
pbot/applets/compiler_vm/host/devices/add-vsock
Pragmatic Software 1326b0ac5f compiler_vm: major refactor to support VM sockets (AF_VSOCK)
VM socket communication is superior to VM serial communication in
every way. Unfortunately at this time only Linux supports them.
Fortunately, that's 99% of PBot's userbase.

If you're not using Linux or if you're using an older Linux that
does not support VM sockets, the PBot VM scripts will gracefully
fallback to using the serial connection. You may explicitly
disable VM socket connection attempts by setting PBOTVM_CID=0.
2022-02-12 16:06:04 -08:00

15 lines
226 B
Bash
Executable File

#!/bin/sh
DOMAIN="${PBOTVM_DOMAIN:-pbot-vm}"
CID="${PBOTVM_CID:-7}"
cat > vsock.xml <<EOF
<vsock model='virtio'>
<cid auto='no' address='$CID'/>
</vsock>
EOF
virsh attach-device --config $DOMAIN vsock.xml
rm vsock.xml