[PATCH] test_driver: implement virConnectCompareCPU

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

 



Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
---

Probably we need to extend the host CPU's capabilities as well along
with this patch. Currently virCPUx86Compare reports "unknown host CPU".

 src/test/test_driver.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index c39eef2d4b..b1037f4eab 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1529,6 +1529,26 @@ static int testConnectGetMaxVcpus(virConnectPtr conn ATTRIBUTE_UNUSED,
     return 32;
 }

+
+static int
+testConnectCompareCPU(virConnectPtr conn,
+                      const char *xmlDesc,
+                      unsigned int flags)
+{
+    testDriverPtr privconn = conn->privateData;
+    bool failIncompatible = !!(flags & VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE);
+    int ret = VIR_CPU_COMPARE_ERROR;
+
+    virCheckFlags(VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE,
+                  VIR_CPU_COMPARE_ERROR);
+
+    ret = virCPUCompareXML(privconn->caps->host.arch, privconn->caps->host.cpu,
+                           xmlDesc, failIncompatible);
+
+    return ret;
+}
+
+
 static char *
 testConnectBaselineCPU(virConnectPtr conn ATTRIBUTE_UNUSED,
                        const char **xmlCPUs,
@@ -9510,6 +9530,7 @@ static virHypervisorDriver testHypervisorDriver = {
     .domainRevertToSnapshot = testDomainRevertToSnapshot, /* 1.1.4 */
     .domainSnapshotDelete = testDomainSnapshotDelete, /* 1.1.4 */

+    .connectCompareCPU =  testConnectCompareCPU, /* 5.7.0 */
     .connectBaselineCPU = testConnectBaselineCPU, /* 1.2.0 */
     .domainCheckpointCreateXML = testDomainCheckpointCreateXML, /* 5.6.0 */
     .domainCheckpointGetXMLDesc = testDomainCheckpointGetXMLDesc, /* 5.6.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