qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c
Date: Tue, 27 Apr 2010 20:49:09 +0100

On Tue, Apr 27, 2010 at 5:06 PM, Chunqiang (CQ) Tang <address@hidden> 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 for:

kvm-all.c:kvm_cpu_exec:
        qemu_mutex_unlock_iothread();
        ret = kvm_vcpu_ioctl(env, KVM_RUN, 0);
        qemu_mutex_lock_iothread();

and

vl.c:main_loop_wait:
    ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv);
    qemu_mutex_lock_iothread();
    if (ret > 0) {
        IOHandlerRecord *pioh;

        QLIST_FOREACH_SAFE(ioh, &io_handlers, next, pioh) {

If I understand correctly the global iothread mutex prevents block
driver code from executing concurrently.

Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]