/*
* Updates all snapshots of this VM.
*/
private synchronized void updateSnapshots(VirtualMachine vm) throws Exception {
SnapshotInfo snapInfo = vm.getSnapshot();
if (snapInfo != null) {
Map<ManagedObjectReference, VcSnapshotImpl> newMap =
new HashMap<ManagedObjectReference, VcSnapshotImpl>();
updateSnapshotTree(newMap, snapshots, snapInfo.getRootSnapshotList());
snapshots = newMap;
currentSnapshot = snapInfo.getCurrentSnapshot();
} else {
snapshots.clear();
currentSnapshot = null;
}
}