From 1aa16f7de9626b4671de10c0bab6c63c0b4d1381 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sun, 8 Jan 2023 23:42:37 +0000 Subject: [PATCH] nixos/vms: Use legacy QMP client for now --- nixos/modules/vms.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/modules/vms.nix b/nixos/modules/vms.nix index 3b2f88a..3ef5739 100644 --- a/nixos/modules/vms.nix +++ b/nixos/modules/vms.nix @@ -25,7 +25,7 @@ let import sys import os - import qemu.qmp + import qemu.qmp.legacy if len(sys.argv) != 2: print(f'usage: {sys.argv[0]} ', file=sys.stderr) @@ -35,7 +35,8 @@ let # Special case: systemd is calling us after QEMU exited on its own sys.exit(0) - with qemu.qmp.QEMUMonitorProtocol(sys.argv[1]) as mon: + # TODO: Upgrade to async QMPClient + with qemu.qmp.legacy.QEMUMonitorProtocol(sys.argv[1]) as mon: mon.connect() mon.command('system_powerdown') while mon.pull_event(wait=True)['event'] != 'SHUTDOWN':