[vbox-dev] savestate operation and IProgress
klaus.espenlaub at oracle.com
Wed Nov 3 06:50:30 PDT 2010
On 03.11.2010 12:12, Ian Chapman wrote:
> 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?
Known issue. The root cause is that the progress object for this
operation lives in the VM process at the moment. This causes this weird
behavior, as the process is gone once the state was saved.
From what I can tell the same is true for teleportation. In both cases
it's possible with some API creativity to figure out that the operation
completed successfully, e.g. by querying the machine state.
The fact that the session for the machine is closed on completion is
normal, and by itself wouldn't cause any trouble with the progress if
this object would live in VBoxSVC.
Not sure when we get around fixing these quirks. It doesn't require a
publicly visible API change (only an internal one which we can do at any
time without violating our promise "we don't mess with the API in
>> 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.
Dr. Klaus Espenlaub | Principal Software Engineer
Phone: +49 7151 60405 205 <tel:+49715160405205>
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt
ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Komplementärin: ORACLE Deutschland Verwaltung B.V.
Rijnzathe 6, 3454PV De Meern, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment
More information about the vbox-dev