[PATCH 4/4] test_driver: implement virDomainFSTrim

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

 



Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
---
 src/test/test_driver.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 097720bb0a..b491247e49 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3561,6 +3561,37 @@ testDomainFSThaw(virDomainPtr dom,
 }


+static int
+testDomainFSTrim(virDomainPtr dom,
+                 const char *mountPoint,
+                 unsigned long long minimum ATTRIBUTE_UNUSED,
+                 unsigned int flags)
+{
+    virDomainObjPtr vm;
+    int ret = -1;
+
+    virCheckFlags(0, -1);
+
+    if (!(vm = testDomObjFromDomain(dom)))
+        return -1;
+
+    if (virDomainObjCheckActive(vm) < 0)
+        goto cleanup;
+
+    if (mountPoint && STRNEQ(mountPoint, "/") && STRNEQ(mountPoint, "/boot")) {
+        virReportError(VIR_ERR_OPERATION_INVALID,
+                       _("mount point not found: %s"),
+                       mountPoint);
+        goto cleanup;
+    }
+
+    ret = 0;
+ cleanup:
+    virDomainObjEndAPI(&vm);
+    return ret;
+}
+
+
 static int testDomainGetAutostart(virDomainPtr domain,
                                   int *autostart)
 {
@@ -7805,6 +7836,7 @@ static virHypervisorDriver testHypervisorDriver = {
     .domainUndefineFlags = testDomainUndefineFlags, /* 0.9.4 */
     .domainFSFreeze = testDomainFSFreeze, /* 5.6.0 */
     .domainFSThaw = testDomainFSThaw, /* 5.6.0 */
+    .domainFSTrim = testDomainFSTrim, /* 5.6.0 */
     .domainGetAutostart = testDomainGetAutostart, /* 0.3.2 */
     .domainSetAutostart = testDomainSetAutostart, /* 0.3.2 */
     .domainGetDiskErrors = testDomainGetDiskErrors, /* 5.4.0 */
--
2.22.0

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

  Powered by Linux