[vbox-dev] Machine state RESETING Event

Klaus Espenlaub klaus.espenlaub at oracle.com
Mon Nov 16 12:09:26 GMT 2015


Hi Max,

On 13.11.2015 21:24, Maxime Dor wrote:
> Hi,
>
> Following up on this topic
> (https://forums.virtualbox.org/viewtopic.php?f=9&t=69975) and this
> specific statement that no OnMachineStateChanged event is being sent
> when the VM state change to RESETTING.

The VM states are not directly visible through the API, and there is no 
corresponding MachineState for VMSTATE_RESETTING.

> I have tried in Java to get that event, on IVirtualBox and IConsole on a
> shared locked ISession but with no luck. Is that specific state
> restricted to the process with a Write lock or the process actually
> running the VM? Could it be possible to get an event for that VM state
> change?

Why? From the MachineState perspective a reset keeps the VM in state 
Running. Introducing a new transient MachineState for this is effort 
(and causes some incompatibility), and as it is extremely short term I 
wonder how useful it is in general.

Bolting actions to this event is race-prone, because the VM keeps going 
(with a brief pause, in the order of 100msec).

> If not, could you consider adding some kind of event to inform API
> clients that a VM was reset? This is definitly a useful event to get
> from a developper PoV.

There's an undocumented flag for turning resets into VM poweroff (with 
additional information recorded to be able to distinguish it from a 
regular poweroff).

Wonder if that would be the cleaner approach, for the forum post and in 
general.

Klaus
>
> Max




More information about the vbox-dev mailing list