[vbox-dev] savestate operation and IProgress

Ian Chapman packages at amiga-hardware.com
Wed Nov 3 04:12:02 PDT 2010


Ok so it seems VB automatically closes the session when the guest's 
state is saved (make sense I suppose, but doesn't seem to entirely agree 
with the SDK). This also seems to destroy the associated IProgress 
object. How is one supposed to monitor the percentage complete of the 
savestate operation? You could check to see if the session is still 
open, but VB may still close the session before IProgress::getCompleted 
is called which is probably more likely to happen using SOAP because of 
the higher latencies between calls. It would seem I can only reliably 
use IProgress::waitForCompletion and not report the percentage complete 
of the operation. Has anybody else seen this, or is it just BS?

> I'm using VB 3.2.10 on Linux via the SOAP interface. Is there something
> intrinsically different about monitoring the completion of an operation
> using an IProgress object returned from IConsole::saveState() as opposed
> to any other method?
> I'm finding that if I use IProgress::getPercent on this object, when it
> reaches 100 (ie its supposed to be complete), getting the return code
> using IProgress::getResultCode results in an error saying that there is
> no returncode because the operation has not completed. The SDK states
> that 100 will only ever be returned when the operation is complete.
> Alternatively, if I use IProgress_getCompleted instead and wait until it
> returns true, when using IProgress::getResultCode, I get the error that
> the IProgress reference is (no longer) a managed object.
> The same code seems to work without issue on IProgress objects returned
> from IMedium::createBaseStorage, IVirtualBox::openRemoteSession etc.
> FWIW, the ISession object seems to get closed without me explicitly
> closing it in my code.

Ian Chapman.

More information about the vbox-dev mailing list