Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232413

Re: node.getSnapshot() returns null

$
0
0

You are right.

 

By the way, C# version of this sample is correct:

private ManagedObjectReference traverseSnapshotInTree(

  VirtualMachineSnapshotTree[] snapTree, 

  String findName,

  Boolean print) {

  ManagedObjectReference snapmor = null; 

  if (snapTree == null) {

  return snapmor;

  }

  for (int i = 0; i < snapTree.Length && snapmor == null; i++) {

  VirtualMachineSnapshotTree node = snapTree[i];

  if (print) {

  Console.WriteLine("Snapshot Name : " + node.name); 

  }

  

  if (findName != null && node.name.Equals(findName)) {

  snapmor = node.snapshot;

  } else {

  VirtualMachineSnapshotTree[] childTree = node.childSnapshotList;

  snapmor = traverseSnapshotInTree(childTree, findName, print);

  }

  }

 

  return snapmor;

  }

 

 

Best regards,

Alexey Barabash


Viewing all articles
Browse latest Browse all 232413

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>