[libvirt] [PATCH 8/9] Implement cpuBaseline in remote and qemu drivers

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c     |   15 ++++++++++++++-
 src/remote/remote_driver.c |   33 ++++++++++++++++++++++++++++++++-
 2 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index db07b66..ef164be 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8530,6 +8530,19 @@ qemuCPUCompare(virConnectPtr conn,
     return ret;
 }
 
+static char *
+qemuCPUBaseline(virConnectPtr conn,
+                unsigned int ncpus,
+                const char **xmlCPUs,
+                unsigned int flags ATTRIBUTE_UNUSED)
+{
+    char *cpu;
+
+    cpu = cpuBaselineXML(conn, ncpus, xmlCPUs, 0, NULL);
+
+    return cpu;
+}
+
 static virDriver qemuDriver = {
     VIR_DRV_QEMU,
     "QEMU",
@@ -8606,7 +8619,7 @@ static virDriver qemuDriver = {
     qemuDomainIsActive,
     qemuDomainIsPersistent,
     qemuCPUCompare, /* cpuCompare */
-    NULL, /* cpuBaseline */
+    qemuCPUBaseline, /* cpuBaseline */
 };
 
 
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 33c3cd3..3a8a10f 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -7535,6 +7535,37 @@ done:
     return rv;
 }
 
+
+static char *
+remoteCPUBaseline(virConnectPtr conn,
+                  unsigned int ncpus,
+                  const char **xmlCPUs,
+                  unsigned int flags)
+{
+    struct private_data *priv = conn->privateData;
+    remote_cpu_baseline_args args;
+    remote_cpu_baseline_ret ret;
+    char *cpu = NULL;
+
+    remoteDriverLock(priv);
+
+    args.xmlCPUs.xmlCPUs_len = ncpus;
+    args.xmlCPUs.xmlCPUs_val = (char **) xmlCPUs;
+    args.flags = flags;
+
+    memset(&ret, 0, sizeof (ret));
+    if (call(conn, priv, 0, REMOTE_PROC_CPU_BASELINE,
+             (xdrproc_t) xdr_remote_cpu_baseline_args, (char *) &args,
+             (xdrproc_t) xdr_remote_cpu_baseline_ret, (char *) &ret) == -1)
+        goto done;
+
+    cpu = ret.cpu;
+
+done:
+    remoteDriverUnlock(priv);
+    return cpu;
+}
+
 /*----------------------------------------------------------------------*/
 
 
@@ -8923,7 +8954,7 @@ static virDriver remote_driver = {
     remoteDomainIsActive, /* domainIsActive */
     remoteDomainIsPersistent, /* domainIsPersistent */
     remoteCPUCompare, /* cpuCompare */
-    NULL, /* cpuBaseline */
+    remoteCPUBaseline, /* cpuBaseline */
 };
 
 static virNetworkDriver network_driver = {
-- 
1.6.6.1

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