Note missing module package name

Debian ships different modules in different packages.
By default qemu ignores the fact that it can not load
a module, pretending this module never existed.
Give a useful hint about the package where the module
in question resides.

This is a hack, but it makes qemu a bit more user-friendly.

Gbp-Pq: Name note-missing-module-pkg-name.diff
Signed-off-by: Cong Liu <liucong2@kylinos.cn>
This commit is contained in:
Michael Tokarev 2021-08-22 15:16:25 +03:00 committed by Cong Liu
parent 59164a8de4
commit 62830bfba1
1 changed files with 13 additions and 0 deletions

View File

@ -298,6 +298,19 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail)
}
if (!success) {
/* notify user about extra package */
const char *pkg = NULL;
if (!strcmp(prefix, "block-"))
pkg = "qemu-block-extra";
else if (!strcmp(prefix, "ui-")
|| !strcmp(prefix, "audio-")
|| !strcmp(module_name, "virtio-gpu-gl"))
pkg = "qemu-system-gui";
if (pkg)
fprintf(stderr, "qemu: module %s%s not found, do you want to install %s package?\n",
prefix, module_name, pkg);
g_hash_table_remove(loaded_modules, module_name);
g_free(module_name);
}