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

[libvirt] [PATCH v2 2/2] test_driver: implement virDomainSetTime



Signed-off-by: Ilias Stamatis <stamatis iliass gmail com>
Reviewed-by: Erik Skultety <eskultet redhat com>
---
 src/test/test_driver.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 3e2cd3a9a4..6f18baa265 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2135,6 +2135,35 @@ testDomainGetTime(virDomainPtr dom,
     return ret;
 }

+
+static int
+testDomainSetTime(virDomainPtr dom,
+                  long long seconds,
+                  unsigned int nseconds,
+                  unsigned int flags)
+{
+    virDomainObjPtr vm = NULL;
+    testDomainObjPrivatePtr priv;
+    int ret = -1;
+
+    virCheckFlags(VIR_DOMAIN_TIME_SYNC, ret);
+
+    if (!(vm = testDomObjFromDomain(dom)))
+        return -1;
+
+    if (virDomainObjCheckActive(vm) < 0)
+        goto cleanup;
+
+    priv = vm->privateData;
+    priv->seconds = seconds;
+    priv->nseconds = nseconds;
+
+    ret = 0;
+ cleanup:
+    virDomainObjEndAPI(&vm);
+    return ret;
+}
+
 #define TEST_SAVE_MAGIC "TestGuestMagic"


@@ -8923,6 +8952,7 @@ static virHypervisorDriver testHypervisorDriver = {
     .domainGetInfo = testDomainGetInfo, /* 0.1.1 */
     .domainGetState = testDomainGetState, /* 0.9.2 */
     .domainGetTime = testDomainGetTime, /* 5.4.0 */
+    .domainSetTime = testDomainSetTime, /* 5.7.0 */
     .domainSave = testDomainSave, /* 0.3.2 */
     .domainSaveFlags = testDomainSaveFlags, /* 0.9.4 */
     .domainRestore = testDomainRestore, /* 0.3.2 */
--
2.22.0


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