[PATCH 16/20] qemuagenttest: Test the filesystem trimming

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

 



---
 tests/qemuagenttest.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
index 7f22ff0..a3b8834 100644
--- a/tests/qemuagenttest.c
+++ b/tests/qemuagenttest.c
@@ -132,6 +132,36 @@ cleanup:


 static int
+testQemuAgentFSTrim(const void *data)
+{
+    virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
+    qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
+    int ret = -1;
+
+    if (!test)
+        return -1;
+
+    if (qemuMonitorTestAddAgentSyncResponse(test) < 0)
+        goto cleanup;
+
+    if (qemuMonitorTestAddItemParams(test, "guest-fstrim",
+                                     "{ \"return\" : {} }",
+                                     "minimum", "1337",
+                                     NULL) < 0)
+        goto cleanup;
+
+    if (qemuAgentFSTrim(qemuMonitorTestGetAgent(test), 1337) < 0)
+        goto cleanup;
+
+    ret = 0;
+
+cleanup:
+    qemuMonitorTestFree(test);
+    return ret;
+}
+
+
+static int
 mymain(void)
 {
     int ret = 0;
@@ -154,6 +184,7 @@ mymain(void)

     DO_TEST(FSFreeze);
     DO_TEST(FSThaw);
+    DO_TEST(FSTrim);

     virObjectUnref(xmlopt);

-- 
1.8.3.2

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