[java] [PATCH] add missing virDomainSetMemoryStatsPeriod API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

The attached patch adds the missing virDomainSetMemoryStatsPeriod API, which was introduced since around 2013.

Cheers,
Wei Mingzhi

--
"The best way to predict the future is to invent it." -Alan Kay

diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
index 83a500c..6fecd35 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -1313,6 +1313,17 @@ public class Domain {
     }
 
     /**
+     * Dynamically change the domain memory balloon driver statistics collection
+     * period. Use 0 to disable and a positive value to enable.
+     *
+     * @param period
+     * @throws LibvirtException
+     */
+    public void setMemoryStatsPeriod(int period) throws LibvirtException {
+        processError(libvirt.virDomainSetMemoryStatsPeriod(VDP, period, 0));
+    }
+
+    /**
      * * Dynamically change the maximum amount of physical memory allocated to a
      * domain. This function requires priviledged access to the hypervisor.
      *
diff --git a/src/main/java/org/libvirt/jna/Libvirt.java b/src/main/java/org/libvirt/jna/Libvirt.java
index 024e268..da1aac2 100644
--- a/src/main/java/org/libvirt/jna/Libvirt.java
+++ b/src/main/java/org/libvirt/jna/Libvirt.java
@@ -340,6 +340,7 @@ public interface Libvirt extends Library {
     int virDomainSendKey(DomainPointer virDomainPtr, int codeset, int holdtime, int[] keycodes, int nkeycodes, int flags);
     CString virDomainScreenshot(DomainPointer virDomainPtr, StreamPointer virStreamPtr, int screen, int flags);
     int virDomainSetAutostart(DomainPointer virDomainPtr, int autoStart);
+    int virDomainSetMemoryStatsPeriod(DomainPointer virDomainPtr, int period, int flags);
     int virDomainSetMaxMemory(DomainPointer virDomainPtr, NativeLong maxMemory);
     int virDomainSetMemory(DomainPointer virDomainPtr, NativeLong maxMemory);
     int virDomainSetSchedulerParameters(DomainPointer virDomainPtr, virSchedParameter[] params, int nparams);
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]