[PATCH 8/8] test driver: Implement testNodeGetFreePages.

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

 



Signed-off-by: Tomáš Ryšavý <tom.rysavy.0@xxxxxxxxx>
---
 src/test/test_driver.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 7c64dcd..cbebc75 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2795,6 +2795,30 @@ testNodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
     return ret;
 }
 
+static int
+testNodeGetFreePages(virConnectPtr conn ATTRIBUTE_UNUSED,
+                     unsigned int npages,
+                     unsigned int *pages ATTRIBUTE_UNUSED,
+                     int startCell ATTRIBUTE_UNUSED,
+                     unsigned int cellCount,
+                     unsigned long long *counts,
+                     unsigned int flags)
+{
+    size_t i = 0, j = 0;
+    int x = 6;
+
+    virCheckFlags(0, -1);
+
+    for (i = 0; i < cellCount; i++) {
+        for (j = 0; j < npages; j++) {
+            x = x * 2 + 7;
+            counts[(i * npages) +  j] = x;
+        }
+    }
+
+    return 0;
+}
+
 static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
 {
     testDriverPtr privconn = domain->conn->privateData;
@@ -6788,6 +6812,7 @@ static virHypervisorDriver testHypervisorDriver = {
     .nodeGetInfo = testNodeGetInfo, /* 0.1.1 */
     .nodeGetCPUStats = testNodeGetCPUStats, /* 2.3.0 */
     .nodeGetFreeMemory = testNodeGetFreeMemory, /* 2.3.0 */
+    .nodeGetFreePages = testNodeGetFreePages, /* 2.3.0 */
     .connectGetCapabilities = testConnectGetCapabilities, /* 0.2.1 */
     .connectGetSysinfo = testConnectGetSysinfo, /* 2.3.0 */
     .connectGetType = testConnectGetType, /* 2.3.0 */
-- 
2.9.3

--
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]