libblockdriver: clear IPC only on stateful restart

This removes a race condition when the block driver performs a
complete restart after a crash (the new default). If any user of
the driver finds out its new endpoint and sends a request to the
new driver instance before this instance has had the chance to
initialize, then its initialization would clear all IPC state and
thereby erroneously cancel the incoming request. Clearing IPC
state is only desired upon a stateful restart (where the driver's
endpoint is retained). This information is now passed to and used
by libblockdriver accordingly.
This commit is contained in:
David van Moolenbroek
2011-12-11 22:36:19 +01:00
parent 95d1f25b28
commit 4005bba437
7 changed files with 19 additions and 16 deletions

View File

@@ -32,7 +32,7 @@ struct blockdriver {
/* Functions defined by libblockdriver. These can be used for both
* singlethreaded and multithreaded drivers.
*/
_PROTOTYPE( void blockdriver_announce, (void) );
_PROTOTYPE( void blockdriver_announce, (int type) );
#ifndef _BLOCKDRIVER_MT_API
/* Additional functions for the singlethreaded version. These allow the driver