[elbe-devel] [PATCH] elbepack: initvm: handle stripped fdgroup arguments

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed Oct 2 15:51:20 CEST 2024


Some versions of libvirt strip the fdgroup attribute although
FDAssociate() exists. Handle this gracefully.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/initvm.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elbepack/initvm.py b/elbepack/initvm.py
index db5cd0d12fa2ee6fb247f0d2f4a5627a8e08a3da..e5ec0c299ffa3b9e6bb32ae62c223eb67d639656 100644
--- a/elbepack/initvm.py
+++ b/elbepack/initvm.py
@@ -234,6 +234,8 @@ class LibvirtInitVM(_InitVM):
         disk = xml.et.find('.//devices/disk')
 
         for source in disk.findall('.//source'):
+            if 'fdgroup' not in source.attrib:
+                continue
             flags = os.O_RDWR if source.getparent() is disk else os.O_RDONLY
             # Use raw unmanaged FDs as libvirt will take full ownership of them.
             domain.FDAssociate(source.attrib['fdgroup'], [

---
base-commit: 458e230e966344b41172dbfa7258fad73f7b1269
change-id: 20241002-fdgroup-b170283f8e21

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh at linutronix.de>



More information about the elbe-devel mailing list