[vbox-dev] What do I do wrong when savestate and wait for it to finish?

Klaus Espenlaub Klaus.Espenlaub at Sun.COM
Wed Jun 2 07:59:46 GMT 2010


DavidW wrote:
> I do the following steps:
> 
>  
> 
> 1,  call  IConsole_saveState
> 
> 2,call IProgress_waitForCompletion
> 
> 3,call IProgress_getPercent, result is 100
> 
> 4, connect to session again, call IMachine_getState
> 
>  
> 
> I expect the result should be “Saved”, but I still get “Running”. But 
> the VM is saved, that means it does the savestate, but returns without 
> waiting for them to complete.

Your code sequence triggers a "live save state", as opposed to the 
regular save state which the GUI triggers - the latter requires the VM 
to be paused before calling saveState.

VBox.log should have more information - I suspect that the save state 
operation fails for some reason, and in that case the correct behavior 
is to go back to the previous state, i.e. "Running". A live save state 
can fail for many more reasons than a regular one, and tends to give a 
bigger saved state file.

I checked the code, and there should be really no opportunity for a race 
with updating the state - the completion is signalled after the state is 
updated.

Klaus




More information about the vbox-dev mailing list