Re: [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter()

2015-02-19 Thread Stefan Hajnoczi
On Wed, Feb 18, 2015 at 03:20:26PM +0100, Kevin Wolf wrote: > Am 18.02.2015 um 14:50 hat Stefan Hajnoczi geschrieben: > > On Tue, Feb 10, 2015 at 11:41:27AM +0100, Kevin Wolf wrote: > > > qemu_coroutine_enter() is now the only user of coroutine_swap(). Both > > > functions are short, so inline it.

Re: [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter()

2015-02-18 Thread Kevin Wolf
Am 18.02.2015 um 14:50 hat Stefan Hajnoczi geschrieben: > On Tue, Feb 10, 2015 at 11:41:27AM +0100, Kevin Wolf wrote: > > qemu_coroutine_enter() is now the only user of coroutine_swap(). Both > > functions are short, so inline it. > > > > Also, using COROUTINE_YIELD is now even more confusing beca

Re: [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter()

2015-02-18 Thread Stefan Hajnoczi
On Tue, Feb 10, 2015 at 11:41:27AM +0100, Kevin Wolf wrote: > qemu_coroutine_enter() is now the only user of coroutine_swap(). Both > functions are short, so inline it. > > Also, using COROUTINE_YIELD is now even more confusing because this code > is never called during qemu_coroutine_yield() any

Re: [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter()

2015-02-10 Thread Paolo Bonzini
On 10/02/2015 12:09, Kevin Wolf wrote: >> > >> > 4 mutex->locked = false; >> > qemu_co_queue_next(&mutex->queue); >> >'--> qemu_co_queue_do_restart(queue, true); >> > '--> QTAILQ_REMOVE(&queue->entries, next, co_queue_next); >> > QTAILQ_INSERT_TAIL(&self->co_queue_wake

Re: [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter()

2015-02-10 Thread Kevin Wolf
Am 10.02.2015 um 11:55 hat Paolo Bonzini geschrieben: > > > On 10/02/2015 11:41, Kevin Wolf wrote: > > +ret = qemu_coroutine_switch(self, co, COROUTINE_ENTER); > > + > > +qemu_co_queue_run_restart(co); > > + > > +switch (ret) { > > +case COROUTINE_YIELD: > > +return; > > +

Re: [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter()

2015-02-10 Thread Paolo Bonzini
On 10/02/2015 11:41, Kevin Wolf wrote: > +ret = qemu_coroutine_switch(self, co, COROUTINE_ENTER); > + > +qemu_co_queue_run_restart(co); > + > +switch (ret) { > +case COROUTINE_YIELD: > +return; > +case COROUTINE_TERMINATE: > +trace_qemu_coroutine_terminate(co);

[Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter()

2015-02-10 Thread Kevin Wolf
qemu_coroutine_enter() is now the only user of coroutine_swap(). Both functions are short, so inline it. Also, using COROUTINE_YIELD is now even more confusing because this code is never called during qemu_coroutine_yield() any more. In fact, this value is never read back, so we can just introduce