kvm: qemu: support ioperm for vcpu hotplug
A message that is not in the archive (sent off-list or not yet received): [email protected]
Review static void *ap_main_loop(void *_env) · line 463
Quoted 11 lines · On Tue, 11 Nov 2008 16:28:04 -0000 Avi Kivity <[email protected]> wrote:
(quoted diff) +4
-0@@ -450,6 +454,10 @@ static void *ap_main_loop(void *_env) kvm_create_vcpu(kvm_context, env->cpu_index); kvm_qemu_init_env(env); + /* do ioperm for io ports of assigned devices */ + LIST_FOREACH(data, &ioperm_head, entries) + on_vcpu(env, kvm_arch_do_ioperm, data); + /* signal VCPU creation */ pthread_mutex_lock(&qemu_mutex); vcpu->created = 1;
kvm_arch_do_ioperm() is defined if USE_KVM_DEVICE_ASSIGNMENT is defined. So this should be wrapped by:
#ifdef USE_KVM_DEVICE_ASSIGNMENT
/* do ioperm for io ports of assigned devices */
LIST_FOREACH(data, &ioperm_head, entries)
on_vcpu(env, kvm_arch_do_ioperm, data);#endif
no?
Best regards,
Guillaume
Quoted 19 lines · Guillaume Thouvenin
Review static void *ap_main_loop(void *_env) · line 463
Quoted 11 lines · On Tue, 11 Nov 2008 16:28:04 -0000 Avi Kivity <[email protected]> wrote:
(quoted diff) +4
-0@@ -450,6 +454,10 @@ static void *ap_main_loop(void *_env) kvm_create_vcpu(kvm_context, env->cpu_index); kvm_qemu_init_env(env); + /* do ioperm for io ports of assigned devices */ + LIST_FOREACH(data, &ioperm_head, entries) + on_vcpu(env, kvm_arch_do_ioperm, data); + /* signal VCPU creation */ pthread_mutex_lock(&qemu_mutex); vcpu->created = 1;
kvm_arch_do_ioperm()is defined ifUSE_KVM_DEVICE_ASSIGNMENTis defined. So this should be wrapped by:
Quoted 7 lines
#ifdef USE_KVM_DEVICE_ASSIGNMENT /* do ioperm for io ports of assigned devices */ LIST_FOREACH(data, &ioperm_head, entries) on_vcpu(env, kvm_arch_do_ioperm, data);#endif
no?
yes, it is better to wrap it. Thanks.
Regards,
Weidong
Quoted 3 lines
Best regards,
Guillaume