]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
qemu: Use SOCK_STREAM for notify socket
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 13 Jun 2023 13:45:11 +0000 (15:45 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 13 Jun 2023 14:03:10 +0000 (16:03 +0200)
The CentOS 8 Stream kernel does not support SOCK_SEQPACKET for
AF_VSOCK so let's use SOCK_STREAM instead and explicitly instruct
systemd running in the VM to use SOCK_STREAM as well.

mkosi/qemu.py

index 6e7b538bcf6b0742368c56d197619935b7771d18..5ccbb5fb68299b924aad53f9d2509589a8fee2e5 100644 (file)
@@ -153,7 +153,7 @@ def vsock_notify_handler() -> Iterator[tuple[str, dict[str, str]]]:
     This yields a vsock address and a dict that will be filled in with the notifications from the VM. The
     dict should only be accessed after the context manager has been finalized.
     """
-    with socket.socket(socket.AF_VSOCK, socket.SOCK_SEQPACKET) as vsock:
+    with socket.socket(socket.AF_VSOCK, socket.SOCK_STREAM) as vsock:
         vsock.bind((socket.VMADDR_CID_ANY, socket.VMADDR_PORT_ANY))
         vsock.listen()
         vsock.setblocking(False)
@@ -186,7 +186,7 @@ def vsock_notify_handler() -> Iterator[tuple[str, dict[str, str]]]:
                     messages[k] = v
 
         with MkosiAsyncioThread(notify()):
-            yield f"vsock:{socket.VMADDR_CID_HOST}:{vsock.getsockname()[1]}", messages
+            yield f"vsock-stream:{socket.VMADDR_CID_HOST}:{vsock.getsockname()[1]}", messages
 
         logging.debug(f"Received {num_messages} notify messages totalling {format_bytes(num_bytes)} bytes")