diff --git a/src/vmspawn/vmspawn-util.c b/src/vmspawn/vmspawn-util.c index 6e8a25baf5..72187b6731 100644 --- a/src/vmspawn/vmspawn-util.c +++ b/src/vmspawn/vmspawn-util.c @@ -151,6 +151,11 @@ static bool firmware_data_matches_machine(const FirmwareData *fwd, const char *a if (!streq((*t)->architecture, arch)) continue; + /* The machine types in firmware descriptions are glob patterns such as "pc-q35-*", but + * we pass the short alias (e.g. "q35") as the machine type to QEMU as it always points to + * the latest version. We can't use fnmatch() here because "q35" doesn't match the + * "pc-q35-*" glob, so instead we use substring matching to check if our machine type + * appears in the pattern. */ STRV_FOREACH(m, (*t)->machines) if (strstr(*m, machine)) return true;