|
@@ -213,6 +213,7 @@ void qemu_plugin_vcpu_init_hook(CPUState *cpu)
|
|
|
bool success;
|
|
|
|
|
|
qemu_rec_mutex_lock(&plugin.lock);
|
|
|
+ plugin.num_vcpus = MAX(plugin.num_vcpus, cpu->cpu_index + 1);
|
|
|
plugin_cpu_update__locked(&cpu->cpu_index, NULL, NULL);
|
|
|
success = g_hash_table_insert(plugin.cpu_ht, &cpu->cpu_index,
|
|
|
&cpu->cpu_index);
|
|
@@ -570,3 +571,8 @@ static void __attribute__((__constructor__)) plugin_init(void)
|
|
|
QHT_MODE_AUTO_RESIZE);
|
|
|
atexit(qemu_plugin_atexit_cb);
|
|
|
}
|
|
|
+
|
|
|
+int plugin_num_vcpus(void)
|
|
|
+{
|
|
|
+ return plugin.num_vcpus;
|
|
|
+}
|