Commit ad1be899 authored by Alon Levy's avatar Alon Levy Committed by Gerd Hoffmann
Browse files

spice: fix broken initialization



Commit 1b71f7c1 moved MODULE_INIT_QOM to
way before MODULE_INIT_MACHINE, thereby breaking assumptions made in
spice-core.c which registered both a type initializer and a machine
intializer.

This fix removes the type registration, and replaces it with calling
qemu_spice_init in vl.c after command line parsing (second pass) is
done, and after timers are armed, required by spice server.

Signed-off-by: default avatarAlon Levy <alevy@redhat.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 5dba0d45
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -787,10 +787,3 @@ static void spice_register_config(void)
    qemu_add_opts(&qemu_spice_opts);
}
machine_init(spice_register_config);

static void spice_register_types(void)
{
    qemu_spice_init();
}

type_init(spice_register_types)
+5 −0
Original line number Diff line number Diff line
@@ -3369,6 +3369,11 @@ int main(int argc, char **argv, char **envp)
        exit(1);
    }

#ifdef CONFIG_SPICE
    /* spice needs the timers to be initialized by this point */
    qemu_spice_init();
#endif

    if (icount_option && (kvm_enabled() || xen_enabled())) {
        fprintf(stderr, "-icount is not allowed with kvm or xen\n");
        exit(1);