vm.go
func (v *VM) RootSnapshot(index int) (*Snapshot, error) {
	var snapshotHandle C.VixHandle = C.VIX_INVALID_HANDLE
	var err C.VixError = C.VIX_OK

	err = C.VixVM_GetRootSnapshot(v.handle,
		C.int(index),
		&snapshotHandle)

	if C.VIX_OK != err {
		return nil, &Error{
			Operation: "vm.RootSnapshot",
			Code:      int(err & 0xFFFF),
			Text:      C.GoString(C.Vix_GetErrorText(err, nil)),
		}
	}

	snapshot := &Snapshot{handle: snapshotHandle}

	runtime.SetFinalizer(snapshot, cleanupSnapshot)

	return snapshot, nil
}
func (v *VM) RootSnapshot(index int) (*Snapshot, error) {
	var snapshotHandle C.VixHandle = C.VIX_INVALID_HANDLE
	var err C.VixError = C.VIX_OK

	err = C.VixVM_GetRootSnapshot(v.handle,
		C.int(index),
		&snapshotHandle)

	if C.VIX_OK != err {
		return nil, &Error{
			Operation: "vm.RootSnapshot",
			Code:      int(err & 0xFFFF),
			Text:      C.GoString(C.Vix_GetErrorText(err, nil)),
		}
	}

	snapshot := &Snapshot{handle: snapshotHandle}

	runtime.SetFinalizer(snapshot, cleanupSnapshot)

	return snapshot, nil
}
// RootSnapshot returns a root Snapshot instance belonging to the current virtual machine.
//
// Parameters:
//
//   index: Identifies a root snapshot. See below for range of values.
//
// Remarks:
//
//   * Snapshots are indexed from 0 to n-1, where n is the number of root
//     snapshots. Use the function VM.TotalRootSnapshots to get the value of n.
//
//   * VMware Server can manage only a single snapshot for each virtual machine.
//     The value of index can only be 0.
//
//   * This function is not supported when using the VMWARE_PLAYER provider
//
// Since VMware Server 1.0
//