Commit 28c29f007955361121ebb34e0a6e3db5e39c07f7
Complete the 0.7.5 api calls
| |   |
| 5 | 5 | import org.libvirt.jna.virDomainBlockStats; |
| 6 | 6 | import org.libvirt.jna.virDomainInfo; |
| 7 | 7 | import org.libvirt.jna.virDomainInterfaceStats; |
| import org.libvirt.jna.virDomainMemoryStats; |
| 8 | 9 | import org.libvirt.jna.virSchedParameter; |
| 9 | 10 | import org.libvirt.jna.virVcpuInfo; |
| 10 | 11 | |
| … | … | |
| 279 | 279 | return returnValue; |
| 280 | 280 | } |
| 281 | 281 | |
| /** |
| /** |
| * This function provides memory statistics for the domain. |
| * @param number the number of stats to retrieve |
| * @return the collection of stats, or null if an error occurs. |
| * @throws LibvirtException |
| */ |
| public MemoryStatistic[] memoryStats(int number) throws LibvirtException { |
| virDomainMemoryStats[] stats = new virDomainMemoryStats[number] ; |
| MemoryStatistic[] returnStats = null; |
| int result = libvirt.virDomainMemoryStats(VDP, stats, number, 0); |
| processError() ; |
| if (result >= 0) { |
| returnStats = new MemoryStatistic[result] ; |
| for (int x = 0 ; x < result ; x++) { |
| returnStats[x] = new MemoryStatistic(stats[x]); |
| } |
| } |
| return returnStats ; |
| } |
| |
| /** |
| 283 | 303 | * Gets the type of domain operation system. |
| 284 | 304 | * |
| 285 | 305 | * @return the type |
| |   |
| package org.libvirt; |
|
| import org.libvirt.jna.virDomainMemoryStats; |
|
| public class MemoryStatistic { |
|
| protected int tag; |
| protected long val; |
|
| public MemoryStatistic(virDomainMemoryStats stat) { |
| tag = stat.tag; |
| val = stat.val; |
| } |
|
| public int getTag() { |
| return tag; |
| } |
|
| public long getValue() { |
| return val; |
| } |
|
| public void setTag(int tag) { |
| this.tag = tag; |
| } |
|
| public void setValue(long val) { |
| this.val = val; |
| } |
| } |
| |   |
| 180 | 180 | NativeLong flags, String dname, String uri, NativeLong bandwidth); |
| 181 | 181 | public int virDomainMigrateToURI(DomainPointer virDomainPtr, String duri, |
| 182 | 182 | NativeLong flags, String dname, NativeLong bandwidth); |
| public int virDomainMemoryStats(DomainPointer virDomainPtr, virDomainMemoryStats[] stats, int nr_stats, int flags); |
| 183 | 184 | public int virDomainPinVcpu(DomainPointer virDomainPtr, int vcpu, byte[] cpumap, int maplen); |
| 184 | 185 | public int virDomainReboot(DomainPointer virDomainPtr, int flags); |
| 185 | 186 | public int virDomainRestore(ConnectionPointer virConnectPtr, String from); |
| |   |
| package org.libvirt.jna; |
|
| import com.sun.jna.Structure; |
|
| public class virDomainMemoryStats extends Structure { |
| public int tag ; |
| public long val ; |
| } |
| |   |
| 9 | 9 | public byte field[] = new byte[Libvirt.VIR_DOMAIN_SCHED_FIELD_LENGTH]; |
| 10 | 10 | public int type; |
| 11 | 11 | public virSchedParameterValue value; |
|
| 13 | 12 | } |