Differences From Artifact [f931d28fe4]:
- Executable file vws — part of check-in [942bcecae4] at 2018-07-13 15:00:38 on branch trunk — Added RemainAfterExit to service file to mark service running even if no autostart VMs exist. This allows to stop manually stared machines during system shutdown (user: vitus, size: 39255) [annotate] [blame] [check-ins using]
To Artifact [8e374cbb8b]:
- Executable file vws — part of check-in [3e92401463] at 2018-07-17 14:13:57 on branch trunk — Fix problem which occurs if stray (qemu) promt is left in the monitor socket before command execution (user: vitus, size: 39528) [annotate] [blame] [check-ins using]
| ︙ | |||
44 45 46 47 48 49 50 51 52 53 54 55 56 57 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | + + + + + + + |
dummy_greeting = sock.recv(1024)
return sock
def send_command(sock, command):
""" Sends monitor command to given socket and returns answer """
fcntl.flock(sock, fcntl.LOCK_EX)
try:
# There can be stray (qemu) prompt in the socket. Try to drain
# it
try:
sock.recv(64,socket.MSG_DONTWAIT)
except socket.error as e:
if e.errno != errno.EAGAIN and e.errno!=errno.EWOULDBLOCK:
raise e
sock.send(command + "\n")
answer = ""
while not answer.endswith("(qemu) "):
chunk = sock.recv(1024)
if chunk == '':
raise IOError("Unexpected EOF from monitor")
answer += chunk
|
| ︙ |