Commit 28c29f007955361121ebb34e0a6e3db5e39c07f7

  • avatar
  • Bryan Kearney <bkearney @red…at.com>
  • Tue May 18 23:10:48 CEST 2010
Complete the 0.7.5 api calls
  
55import org.libvirt.jna.virDomainBlockStats;
66import org.libvirt.jna.virDomainInfo;
77import org.libvirt.jna.virDomainInterfaceStats;
8import org.libvirt.jna.virDomainMemoryStats;
89import org.libvirt.jna.virSchedParameter;
910import org.libvirt.jna.virVcpuInfo;
1011
279279 return returnValue;
280280 }
281281
282 /**
282 /**
283 * This function provides memory statistics for the domain.
284 * @param number the number of stats to retrieve
285 * @return the collection of stats, or null if an error occurs.
286 * @throws LibvirtException
287 */
288 public MemoryStatistic[] memoryStats(int number) throws LibvirtException {
289 virDomainMemoryStats[] stats = new virDomainMemoryStats[number] ;
290 MemoryStatistic[] returnStats = null;
291 int result = libvirt.virDomainMemoryStats(VDP, stats, number, 0);
292 processError() ;
293 if (result >= 0) {
294 returnStats = new MemoryStatistic[result] ;
295 for (int x = 0 ; x < result ; x++) {
296 returnStats[x] = new MemoryStatistic(stats[x]);
297 }
298 }
299 return returnStats ;
300 }
301
302 /**
283303 * Gets the type of domain operation system.
284304 *
285305 * @return the type
  
1package org.libvirt;
2
3import org.libvirt.jna.virDomainMemoryStats;
4
5public class MemoryStatistic {
6
7 protected int tag;
8 protected long val;
9
10 public MemoryStatistic(virDomainMemoryStats stat) {
11 tag = stat.tag;
12 val = stat.val;
13 }
14
15 public int getTag() {
16 return tag;
17 }
18
19 public long getValue() {
20 return val;
21 }
22
23 public void setTag(int tag) {
24 this.tag = tag;
25 }
26
27 public void setValue(long val) {
28 this.val = val;
29 }
30}
  
180180 NativeLong flags, String dname, String uri, NativeLong bandwidth);
181181 public int virDomainMigrateToURI(DomainPointer virDomainPtr, String duri,
182182 NativeLong flags, String dname, NativeLong bandwidth);
183 public int virDomainMemoryStats(DomainPointer virDomainPtr, virDomainMemoryStats[] stats, int nr_stats, int flags);
183184 public int virDomainPinVcpu(DomainPointer virDomainPtr, int vcpu, byte[] cpumap, int maplen);
184185 public int virDomainReboot(DomainPointer virDomainPtr, int flags);
185186 public int virDomainRestore(ConnectionPointer virConnectPtr, String from);
  
1package org.libvirt.jna;
2
3import com.sun.jna.Structure;
4
5public class virDomainMemoryStats extends Structure {
6 public int tag ;
7 public long val ;
8}
  
99 public byte field[] = new byte[Libvirt.VIR_DOMAIN_SCHED_FIELD_LENGTH];
1010 public int type;
1111 public virSchedParameterValue value;
12
1312}