qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] restart a coroutine?
@ 2012-03-04 12:41 Michael Tokarev
  2012-03-04 16:08 ` Avi Kivity
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Tokarev @ 2012-03-04 12:41 UTC (permalink / raw)
  To: qemu-devel

Since all block (bdrv) layer is now implemented using
coroutines, I thought I'd give it a try.  But immediately
hit a question to which I don't know a good answer.

Suppose we've some networking block device (like NBD) and
want to be able to support reconnection - this is actually
very useful feature, in order to be able to reboot/restart
the NBD server without a need to restart all the clients.

For this to work, we should have an ability to reconnect
to the server and re-issue all requests which were waiting
for reply.

Traditionally, in asyncronous event-loop-based scheme, this
is implemented as a queue of requests linked to the block
driver state structure, and in case of reconnection we just
walk over all requests and requeue these.

But if the block driver is implemented as a set of coroutines
(like nbd currently does), I see no sane/safe way to restart
the requests.  Setjmp/longjmp can be uses with extra care
there, but with these it is extremly fragile.

Any hints on how to do that?

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-05  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-04 12:41 [Qemu-devel] restart a coroutine? Michael Tokarev
2012-03-04 16:08 ` Avi Kivity
2012-03-04 20:01   ` Michael Tokarev
2012-03-05  8:07     ` Paolo Bonzini
2012-03-05  9:20     ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).