mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Expose thread_id in info cpus
Based on patch by Glauber Costa: To allow management applications like libvirt to apply CPU affinities to the VCPU threads, expose their ID via info cpus. This patch provides the pre-existing and used interface from qemu-kvm. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
f2574737f6
commit
dc7a09cfe4
8 changed files with 29 additions and 0 deletions
2
cpus.c
2
cpus.c
|
@ -776,6 +776,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
|
|||
|
||||
qemu_mutex_lock(&qemu_global_mutex);
|
||||
qemu_thread_get_self(env->thread);
|
||||
env->thread_id = qemu_get_thread_id();
|
||||
|
||||
r = kvm_init_vcpu(env);
|
||||
if (r < 0) {
|
||||
|
@ -817,6 +818,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
|
|||
/* signal CPU creation */
|
||||
qemu_mutex_lock(&qemu_global_mutex);
|
||||
for (env = first_cpu; env != NULL; env = env->next_cpu) {
|
||||
env->thread_id = qemu_get_thread_id();
|
||||
env->created = 1;
|
||||
}
|
||||
qemu_cond_signal(&qemu_cpu_cond);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue