[vbox-dev] deleteConfig in VirtualBox 4.3.x

Klaus Espenlaub klaus.espenlaub at oracle.com
Tue Mar 4 18:55:45 GMT 2014


On 04.03.2014 14:44, john alexander sanabria ordonez wrote:
> Hi,
> I wrote a Groovy script to use the Java binding to manage virtual
> machines through the VirtualBox web service interface. My script worked
> well in VirtualBox 4.2.x but when I updated to version 4.3 I noted that
> my unregistervm procedure does not work. First, the IMachine.delete
> method was not available and it was changed by IMachine.deleteConfig
> which basically works similarly to the delete method. I made the
> corresponding modifications however it does not delete the mediums
> returned by the IMachine.unregister method.

This is documented in the SDK reference, for the API changes in 4.3.
> My unregistervm methods looks similar to this
> def mediums = machine.unregister(CleanupMode.DetachAllReturnHardDisksOnly)
> def iprogress = machine.deleteConfig(mediums)
> while (iprogress.percent < 100) {
>    out << "."
> }
> and it never ends because the iprogress.percent never reaches 100.
> What I am doing wrong? Thanks for your help.

The percentage will never reach 100 if there is any error. You should be 
adding more flexible progress checking (there should be enough working 
samples out there, including the Java sample code). What you have is 
asking for hangs. Also, you should at least have some wait for 
completion (if you prefer with very low timeout), as otherwise you're 
simply burning CPU cycles.


> John,

More information about the vbox-dev mailing list