mirror of
https://github.com/arehnman/yttrium-virtio-gpu.git
synced 2026-11-07 02:06:32 +00:00
Vioconnect.py and violisten.py are very primitive client and server running on the host to check basic virtio socket functionality. Cid:port pair is hardocoded as 3:401, use the same port parameter to run virtiolib-test.exe in the guest to check connectivity. Vioconnect tries to upload viosock.inf file by default, modify code or put this file along with vioconnect.py. Violisten recv and store any data as viosock.inf. Use python3.8 to run scripts. Signed-off-by: Ilya Rudakov <[email protected]>
21 lines
366 B
Python
21 lines
366 B
Python
#!/usr/bin/python
|
|
|
|
import socket
|
|
import os, os.path
|
|
import time
|
|
from collections import deque
|
|
|
|
with open('viosock.inf') as f:
|
|
read_data = f.read()
|
|
|
|
client = socket.socket(socket.AF_VSOCK, socket.SOCK_STREAM)
|
|
client.connect((3,401))
|
|
client.send(read_data.encode('utf-8'))
|
|
|
|
packet = client.recv(65536)
|
|
if packet:
|
|
print('Recv: ' + str(packet))
|
|
|
|
client.close()
|
|
|