From 1b791fdcd378d0b80797f60aa8dbfa5e35764deb Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 21 Oct 2025 08:58:53 -0400 Subject: [PATCH] lib/launch-libvirt.c: avoid libvirt svirt validation error If a user passes a custom hv, and uses add_libvirt_dom (like in test820RHBZ912499.py) , this hits a bogus libvirt validation check which rejects disabling svirt at both domain and disk level. Work around it by skipping the redundant disk override when svirt is disabled at the domain level. Signed-off-by: Cole Robinson --- lib/launch-libvirt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c index 84e581933..d12fc24c7 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libvirt.c @@ -570,6 +570,13 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri) params.is_custom = is_custom_hv (g, data); params.enable_svirt = !params.is_custom; + /* workaround a libvirt validation bug that rejects disabling selinux + * at domain level and also at disk level, as of libvirt 11.8.0 + * https://gitlab.com/libvirt/libvirt/-/issues/826 + * */ + if (!params.enable_svirt) + data->selinux_norelabel_disks = true; + xml = construct_libvirt_xml (g, ¶ms); if (!xml) goto cleanup;