Add .INCOMPLETE file marker to flexnbd listen

We drop a marker onto the filesystem to say when we know the image we're
serving is not yet ready.
This commit is contained in:
Alex Young
2012-07-19 17:34:20 +01:00
parent 76bbdb4889
commit b0f1a027c6
4 changed files with 91 additions and 0 deletions

View File

@@ -83,6 +83,7 @@ int do_listen( struct listen * listen )
flexnbd_lock_switch( listen->flexnbd );
{
flexnbd_set_server( listen->flexnbd, listen->init_serve );
flexnbd_mark_incomplete( listen->flexnbd );
}
flexnbd_unlock_switch( listen->flexnbd );
@@ -93,6 +94,8 @@ int do_listen( struct listen * listen )
if( have_control ) {
flexnbd_mark_complete( listen->flexnbd );
info( "Taking control.");
flexnbd_switch( listen->flexnbd, listen_switch );
/* WATCH FOR RACES HERE: the server hasn't been