On Thu, Dec 06, 2012 at 08:35:55AM +0100, Paolo Bonzini wrote: > Il 05/12/2012 21:47, Stefan Hajnoczi ha scritto: > > + > > +/* Block until pending requests have completed > > + * > > + * The vring continues to be serviced so ensure no new requests will be > > added > > + * to avoid races. > > + */ > > +void virtio_blk_data_plane_drain(VirtIOBlockDataPlane *s) > > +{ > > + qemu_mutex_lock(&s->num_reqs_lock); > > + while (s->num_reqs > 0) { > > + qemu_cond_wait(&s->no_reqs_cond, &s->num_reqs_lock); > > + } > > + qemu_mutex_unlock(&s->num_reqs_lock); > > +} > > Hi Stefan, > > so this was not changed from v4?
It's unchanged. From the v5 cover letter: * Note I did not get rid of the mutex+condvar approach to draining requests. I've had good feedback on the performance of the patch series so I'm not worried about eliminating the lock (it's very rarely contended). Hope Michael and Paolo are okay with this approach. Stefan