mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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 <crobinso@redhat.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user