|
@@ -391,12 +391,17 @@ void qemu_plugin_vcpu_syscall_ret(CPUState *cpu, int64_t num, int64_t ret)
|
|
|
|
|
|
void qemu_plugin_vcpu_idle_cb(CPUState *cpu)
|
|
|
{
|
|
|
- plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_IDLE);
|
|
|
+ /* idle and resume cb may be called before init, ignore in this case */
|
|
|
+ if (cpu->cpu_index < plugin.num_vcpus) {
|
|
|
+ plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_IDLE);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void qemu_plugin_vcpu_resume_cb(CPUState *cpu)
|
|
|
{
|
|
|
- plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_RESUME);
|
|
|
+ if (cpu->cpu_index < plugin.num_vcpus) {
|
|
|
+ plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_RESUME);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id,
|