Commit c643bed9 authored by Andreas Färber's avatar Andreas Färber
Browse files

cpu: Change qemu_init_vcpu() argument to CPUState



This allows to move the call into CPUState's realizefn.
Therefore move the stub into libqemustub.a.

Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
parent 10a9021d
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1053,11 +1053,8 @@ static void qemu_dummy_start_vcpu(CPUState *cpu)
    }
}

void qemu_init_vcpu(void *_env)
void qemu_init_vcpu(CPUState *cpu)
{
    CPUArchState *env = _env;
    CPUState *cpu = ENV_GET_CPU(env);

    cpu->nr_cores = smp_cores;
    cpu->nr_threads = smp_threads;
    cpu->stopped = true;
+0 −8
Original line number Diff line number Diff line
@@ -295,14 +295,6 @@ struct qemu_work_item {
    int done;
};

#ifdef CONFIG_USER_ONLY
static inline void qemu_init_vcpu(void *env)
{
}
#else
void qemu_init_vcpu(void *env);
#endif


/**
 * Sends a (part of) iovec down a socket, yielding when the socket is full, or
+8 −0
Original line number Diff line number Diff line
@@ -428,6 +428,14 @@ void cpu_exit(CPUState *cpu);
 */
void cpu_resume(CPUState *cpu);

/**
 * qemu_init_vcpu:
 * @cpu: The vCPU to initialize.
 *
 * Initializes a vCPU.
 */
void qemu_init_vcpu(CPUState *cpu);

#ifdef CONFIG_SOFTMMU
extern const struct VMStateDescription vmstate_cpu_common;
#else
+2 −0
Original line number Diff line number Diff line
@@ -209,6 +209,8 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp)
{
    CPUState *cpu = CPU(dev);

    qemu_init_vcpu(cpu);

    if (dev->hotplugged) {
        cpu_synchronize_post_init(cpu);
        notifier_list_notify(&cpu_added_notifiers, dev);
+4 −0
Original line number Diff line number Diff line
@@ -4,3 +4,7 @@
void cpu_resume(CPUState *cpu)
{
}

void qemu_init_vcpu(CPUState *cpu)
{
}
Loading