Beispiel #1
0
        public void RevertToSnapshot(string snapshotName)
        {
            VixCOM.ISnapshot snapshot;
            _virtualMachine.GetNamedSnapshot(snapshotName, out snapshot);

            VixCOM.IJob job = _virtualMachine.RevertToSnapshot(snapshot, 0, null, null);
            UInt64      err = job.WaitWithoutResults();

            if (lib.ErrorIndicatesFailure(err))
            {
                short  errCode = lib.ErrorCode(err);
                string errMsg;
                errMsg = lib.GetErrorText(err, null);

                throw new Exception("RevertToSnapshot: " + errMsg);
            }

            WaitForToolsInGuest();
        }