qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] s390-ccw.img: Fix waiting for virtio processing


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] s390-ccw.img: Fix waiting for virtio processing.
Date: Fri, 30 Aug 2013 10:38:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

Il 30/08/2013 09:59, Cornelia Huck ha scritto:
> +    vr->used_idx = vr->used->idx;
> +    /*
> +     * Wait until the used index has moved.
> +     * Note: This is only race-free if the host doesn't start draining
> +     * the queue out of its own accord.
> +     */
> +    while (vr->used->idx == vr->used_idx) {

Can you instead initialize vr->used_idx in virtio_setup_block, and then
update it _after_ the while loop?  This would be race-free.

Paolo



reply via email to

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