From d144dce428219f75f9311c097e8002ca840a5b23 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 17 Aug 2026 16:38:44 -0700 Subject: [PATCH] container: Fix failure with defining a new VM - We write to a file and immediately this file is consumed by the virsh command. If the file is not flushed, the virsh command will see an empty file. Tests: - Without the change, virsh fails with an error message that the definition file is empty. With the change, the failure goes away. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- container | 1 + 1 file changed, 1 insertion(+) diff --git a/container b/container index 46fd47e94..0450bafa6 100755 --- a/container +++ b/container @@ -1392,6 +1392,7 @@ class VM(Machine): with tempfile.NamedTemporaryFile() as file_handle: file_handle.write(domain_xml.encode()) + file_handle.flush() logger.info('Running `virsh define %s`', file_handle.name) self._virsh(['define', file_handle.name], stdout=subprocess.DEVNULL)