[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vbox-dev
Subject:    [vbox-dev] ISession API problem
From:       Andrea Turli <andrea.turli () gmail ! com>
Date:       2012-09-17 14:37:20
Message-ID: CAMDo-rH+BMOG6B5fdDeG=N3sjSsdULcJ1nExzKq90jTiP4HdXQ () mail ! gmail ! com
[Download RAW message or body]

Hi all,

looking at the documentation of void IMachine::lockMachine	(in
ISession session, in LockType lockType) here
https://www.virtualbox.org/sdkref/interface_i_machine.html#af28da645b00a821547d9cb8e92f8b7b0
 it seems that there are 2 strategies

lockType
if set to Write, then attempt to acquire an exclusive write lock or fail.
If set to Shared, then either acquire an exclusive write lock or
establish a link to an existing session.

In my test I lockSession with Write type and then I was trying to lock
with Shared type the same machine, but I get an exception

java.lang.RuntimeException: error locking
jclouds-image-0x0-machine-utils-live-test with Shared lock: VirtualBox
error: The given session is busy (0x80BB0007)
	at org.jclouds.virtualbox.util.MachineUtils.lockSession(MachineUtils.java:241)
	at org.jclouds.virtualbox.util.MachineUtils.lockSessionOnMachineAndApply(MachineUtils.java:198)
  at org.jclouds.virtualbox.util.MachineUtils.sharedLockMachineAndApplyToSession(MachineUtils.java:176)
  at org.jclouds.virtualbox.util.MachineUtilsLiveTest.sharedSession(MachineUtilsLiveTest.java:146)
  at org.jclouds.virtualbox.util.MachineUtilsLiveTest.access$0(MachineUtilsLiveTest.java:145)
  at org.jclouds.virtualbox.util.MachineUtilsLiveTest$3.apply(MachineUtilsLiveTest.java:135)
  at org.jclouds.virtualbox.util.MachineUtilsLiveTest$3.apply(MachineUtilsLiveTest.java:1)
  at org.jclouds.virtualbox.util.MachineUtils.lockSessionOnMachineAndApply(MachineUtils.java:200)
  at org.jclouds.virtualbox.util.MachineUtils.writeLockMachineAndApplyToSession(MachineUtils.java:130)
  at org.jclouds.virtualbox.util.MachineUtilsLiveTest.sharedLockCanBeAcquiredAfterWriteLockSessionOnMachine(MachineUtilsLiveTest.java:130)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
  at org.testng.internal.Invoker.invokeMethod(Invoker.java:701)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:893)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1218)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:768)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
	at org.testng.TestNG.run(TestNG.java:1022)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)
Caused by: org.virtualbox_4_1.VBoxException: VirtualBox error: The
given session is busy (0x80BB0007)
	at org.virtualbox_4_1.IMachine.lockMachine(IMachine.java:2072)
	at org.jclouds.virtualbox.util.MachineUtils.lockSession(MachineUtils.java:231)
	... 33 more


What am I missing?

Thanks.
Andrea

_______________________________________________
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic