[PATCH] test_driver: implement virDomainGetHostname

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

 



Always return "domain_name" + "host".

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

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2f58a1da95..aad7bb6036 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1910,6 +1910,27 @@ static int testDomainReboot(virDomainPtr domain,
     return ret;
 }

+static char *
+testDomainGetHostname(virDomainPtr domain,
+                      unsigned int flags)
+{
+    char *ret = NULL;
+    virDomainObjPtr vm = NULL;
+
+    virCheckFlags(0, NULL);
+
+    if (!(vm = testDomObjFromDomain(domain)))
+        goto cleanup;
+
+    if (virDomainObjCheckActive(vm) < 0)
+        goto cleanup;
+
+    ignore_value(virAsprintf(&ret, "%shost", domain->name));
+
+ cleanup:
+    return ret;
+}
+
 static int testDomainGetInfo(virDomainPtr domain,
                              virDomainInfoPtr info)
 {
@@ -6950,6 +6971,7 @@ static virHypervisorDriver testHypervisorDriver = {
     .domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */
     .domainSetMaxMemory = testDomainSetMaxMemory, /* 0.1.1 */
     .domainSetMemory = testDomainSetMemory, /* 0.1.4 */
+    .domainGetHostname = testDomainGetHostname, /* 5.5.0 */
     .domainGetInfo = testDomainGetInfo, /* 0.1.1 */
     .domainGetState = testDomainGetState, /* 0.9.2 */
     .domainGetTime = testDomainGetTime, /* 5.4.0 */
--
2.21.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