From acb785fede2eb77e87c266de6fbbd5546c1b7529 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 21 Oct 2025 08:54:01 -0400 Subject: [PATCH] lib/launch-libvirt.c: check if g->hv symlink matches libvirt default On fedora, ./configure will set QEMU=qemu-kvm, but libvirt domcaps will default to qemu-system-x86_64. The former is a symlink to the latter, but libguestfs doesn't know that, so determines the user requested a non-default hv override and changes some settings as a result (like disabling svirt). Check for the symlink case and consider it a non-custom config if realpath matches libvirt's default Signed-off-by: Cole Robinson --- lib/launch-libvirt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c index ed8a9a82f..84e581933 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libvirt.c @@ -869,11 +869,18 @@ parse_domcapabilities (guestfs_h *g, const char *domcapabilities_xml, static int is_custom_hv (guestfs_h *g, struct backend_libvirt_data *data) { + CLEANUP_FREE char *rawpath = NULL; + if (STREQ (g->hv, data->default_qemu)) return 0; - debug (g, "user passed custom hv=%s, libvirt default=%s", - g->hv, data->default_qemu); + /* ignore error here, let guest startup fail later */ + rawpath = realpath(g->hv, NULL); + if (rawpath && STREQ (rawpath, data->default_qemu)) + return 0; + + debug (g, "user passed custom hv=%s (realpath=%s) libvirt default=%s", + g->hv, rawpath, data->default_qemu); return 1; }