Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-28 Thread Stefan Hajnoczi
On Tue, Apr 27, 2010 at 10:26 PM, Stefan Hajnoczi stefa...@gmail.com wrote: Can you double check that qemu-kvm.o is being linked in instead of kvm-all.o? I looked again and noticed that qemu-kvm.c is included from kvm-all.c. Please ignore my question of whether qemu-kvm.c is being linked in :).

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-28 Thread Kevin Wolf
Am 27.04.2010 22:39, schrieb Chunqiang (CQ) Tang: kvm-all.c:kvm_cpu_exec: qemu_mutex_unlock_iothread(); ret = kvm_vcpu_ioctl(env, KVM_RUN, 0); qemu_mutex_lock_iothread(); Thank you for the information. I also suspected that qemu_mutex_lock_iothread() does the

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-28 Thread Chunqiang (CQ) Tang
On Wed, Apr 28, 2010 at 4:13 AM, Stefan Hajnoczi stefa...@gmail.com wrote: On Tue, Apr 27, 2010 at 10:26 PM, Stefan Hajnoczi stefa...@gmail.com wrote: Can you double check that qemu-kvm.o is being linked in instead of kvm-all.o? I looked again and noticed that qemu-kvm.c is included from

[Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-27 Thread Chunqiang (CQ) Tang
Hi there, I just started to read the code of qemu-kvm-0.12.3 recently, and was puzzled by the thread synchronization issue in qcow2.c and qcow2-cluster.c. Could someone please enlighten me? Thanks! Specifically, I found that BDRVQcowState.cluster_allocs, which is a QLIST_HEAD, may be accessed

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-27 Thread Stefan Hajnoczi
On Tue, Apr 27, 2010 at 5:06 PM, Chunqiang (CQ) Tang tang...@gmail.com wrote: I just started to read the code of qemu-kvm-0.12.3 recently, and was puzzled by the thread synchronization issue in qcow2.c and qcow2-cluster.c. Could someone please enlighten me? Thanks! Is this what you are looking

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-27 Thread Chunqiang (CQ) Tang
kvm-all.c:kvm_cpu_exec:        qemu_mutex_unlock_iothread();        ret = kvm_vcpu_ioctl(env, KVM_RUN, 0);        qemu_mutex_lock_iothread(); Thank you for the information. I also suspected that qemu_mutex_lock_iothread() does the synchronization. However, my profiling showed that

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-27 Thread Stefan Hajnoczi
On Tue, Apr 27, 2010 at 9:39 PM, Chunqiang (CQ) Tang tang...@gmail.com wrote: Thank you for the information. I also suspected that qemu_mutex_lock_iothread() does the synchronization. However, my profiling showed that qemu-kvm.c:kvm_cpu_exec() in is actually executed, instead of