diff options
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/vl.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c index 21e55718a6..6054f6f0b9 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2627,6 +2627,23 @@ void qmp_x_exit_preconfig(Error **errp) } } +#ifdef CONFIG_MODULES +void qemu_load_module_for_opts(const char *group) +{ + static bool spice_tried; + if (g_str_equal(group, "spice") && !spice_tried) { + ui_module_load_one("spice-core"); + spice_tried = true; + } + + static bool iscsi_tried; + if (g_str_equal(group, "iscsi") && !iscsi_tried) { + block_module_load_one("iscsi"); + iscsi_tried = true; + } +} +#endif + void qemu_init(int argc, char **argv, char **envp) { QemuOpts *opts; @@ -3387,10 +3404,6 @@ void qemu_init(int argc, char **argv, char **envp) case QEMU_OPTION_spice: olist = qemu_find_opts_err("spice", NULL); if (!olist) { - ui_module_load_one("spice-core"); - olist = qemu_find_opts("spice"); - } - if (!olist) { error_report("spice support is disabled"); exit(1); } |