java api: mergeTo error

Discussions related to using VirtualBox on Linux hosts.

java api: mergeTo error

Postby P.Pan » 27. Dec 2011, 20:51

Hi (hope this is the right location for this thread :D ),

I am trying to communicate with VirtualBox using the Java API. My OS is Ubuntu and i working with VirtualBox 4.1.4.

Right now I am trying to merge differential Images. I use differential Images instead of the Snapshot functionality, because
I can set the location of an IMedium directly (snapshots do not support this (or I found nothing to do it) and I do not like to copy my snapshots to the right location...).
Moreover the machine settings are stored separately, so a differential image is enough.

Here is my problem:
I created a base hard disk with createBaseStorage. Then I opened this base hard disk and used createDiffStorage to create a differential image.
Now I want to merge my base.vdi with the diff1.vdi (backward merge). So I used openMedium to open both vdis (first base.vdi (stored in IMedium base), second dif1.vdi (stored in IMedium diff1)). This is followed by this code:

Code: Select all   Expand viewCollapse view
      IProgress progress = diff1.mergeTo(base);
      progress.waitForCompletion(-1);


Here I get the following error:

Exception in thread "main" org.virtualbox_4_1.VBoxException: The function "mergeTo" returned an error condition: "Assertion failed: [this->lockHandle()->isWriteLockOnCurrentThread()] at '/home/vbox/vbox-4.1.4/src/VBox/Main/src-server/MediumImpl.cpp' (4285) in nsresult Medium::markForDeletion().
Please contact the product vendor!" (0x80004005)


All conditions of the method mergeTo are satisfied:
- the mediums are not attached
- they are not immutable
- the chain is linear
- medium state is not MediumState.LockedRead or MediumState.LockedWrite

Also the forward merge does not work.


I hope someone can find my error :wink:
P.Pan
 
Posts: 2
Joined: 27. Dec 2011, 20:00
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Ubuntu, Fedora, Windows

Re: java api: mergeTo error

Postby P.Pan » 6. Jan 2012, 12:18

*push*

Any suggestions :oops: ?
P.Pan
 
Posts: 2
Joined: 27. Dec 2011, 20:00
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Ubuntu, Fedora, Windows


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 18 guests