[PATCH 14/14] cpu: Drop cpuGuestData

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

 



The API is not used anywhere in the code.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/cpu/cpu.c            | 41 -----------------------------------------
 src/cpu/cpu.h            | 14 --------------
 src/cpu/cpu_arm.c        | 10 ----------
 src/cpu/cpu_ppc64.c      |  9 ---------
 src/cpu/cpu_s390.c       |  1 -
 src/cpu/cpu_x86.c        | 17 -----------------
 src/libvirt_private.syms |  1 -
 7 files changed, 93 deletions(-)

diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index 4a5fbb1..64419ee 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -373,47 +373,6 @@ cpuNodeData(virArch arch)
 
 
 /**
- * cpuGuestData:
- *
- * @host: host CPU definition
- * @guest: guest CPU definition
- * @data: computed guest CPU data
- * @msg: error message describing why the @guest and @host CPUs are considered
- *       incompatible
- *
- * Computes guest CPU data for the @guest CPU definition when run on the @host
- * CPU.
- *
- * Returns VIR_CPU_COMPARE_ERROR on error, VIR_CPU_COMPARE_INCOMPATIBLE when
- * the two CPUs are incompatible (@msg will describe the incompatibility),
- * VIR_CPU_COMPARE_IDENTICAL when the two CPUs are identical,
- * VIR_CPU_COMPARE_SUPERSET when the @guest CPU is a superset of the @host CPU.
- */
-virCPUCompareResult
-cpuGuestData(virCPUDefPtr host,
-             virCPUDefPtr guest,
-             virCPUDataPtr *data,
-             char **msg)
-{
-    struct cpuArchDriver *driver;
-
-    VIR_DEBUG("host=%p, guest=%p, data=%p, msg=%p", host, guest, data, msg);
-
-    if ((driver = cpuGetSubDriver(host->arch)) == NULL)
-        return VIR_CPU_COMPARE_ERROR;
-
-    if (driver->guestData == NULL) {
-        virReportError(VIR_ERR_NO_SUPPORT,
-                       _("cannot compute guest CPU data for %s architecture"),
-                       virArchToString(host->arch));
-        return VIR_CPU_COMPARE_ERROR;
-    }
-
-    return driver->guestData(host, guest, data, msg);
-}
-
-
-/**
  * cpuBaselineXML:
  *
  * @xmlCPUs: list of host CPU XML descriptions
diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index ff48fb5..69c17e7 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -73,12 +73,6 @@ typedef void
 typedef virCPUDataPtr
 (*cpuArchNodeData)  (virArch arch);
 
-typedef virCPUCompareResult
-(*cpuArchGuestData) (virCPUDefPtr host,
-                     virCPUDefPtr guest,
-                     virCPUDataPtr *data,
-                     char **message);
-
 typedef virCPUDefPtr
 (*cpuArchBaseline)  (virCPUDefPtr *cpus,
                      unsigned int ncpus,
@@ -124,7 +118,6 @@ struct cpuArchDriver {
     cpuArchEncode       encode;
     cpuArchDataFree     free;
     cpuArchNodeData     nodeData;
-    cpuArchGuestData    guestData;
     cpuArchBaseline     baseline;
     virCPUArchUpdate    update;
     virCPUArchCheckFeature checkFeature;
@@ -175,13 +168,6 @@ cpuDataFree (virCPUDataPtr data);
 virCPUDataPtr
 cpuNodeData (virArch arch);
 
-virCPUCompareResult
-cpuGuestData(virCPUDefPtr host,
-             virCPUDefPtr guest,
-             virCPUDataPtr *data,
-             char **msg)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-
 char *
 cpuBaselineXML(const char **xmlCPUs,
                unsigned int ncpus,
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index b5002c3..653b06b 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -78,15 +78,6 @@ virCPUarmUpdate(virCPUDefPtr guest,
 }
 
 
-static virCPUCompareResult
-armGuestData(virCPUDefPtr host ATTRIBUTE_UNUSED,
-             virCPUDefPtr guest ATTRIBUTE_UNUSED,
-             virCPUDataPtr *data ATTRIBUTE_UNUSED,
-             char **message ATTRIBUTE_UNUSED)
-{
-    return VIR_CPU_COMPARE_IDENTICAL;
-}
-
 static virCPUDefPtr
 armBaseline(virCPUDefPtr *cpus,
             unsigned int ncpus ATTRIBUTE_UNUSED,
@@ -128,7 +119,6 @@ struct cpuArchDriver cpuDriverArm = {
     .encode = NULL,
     .free = armDataFree,
     .nodeData = NULL,
-    .guestData = armGuestData,
     .baseline = armBaseline,
     .update = virCPUarmUpdate,
 };
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 8b71ef5..225fb6d 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -745,14 +745,6 @@ ppc64DriverNodeData(virArch arch)
     return NULL;
 }
 
-static virCPUCompareResult
-ppc64DriverGuestData(virCPUDefPtr host,
-                     virCPUDefPtr guest,
-                     virCPUDataPtr *data,
-                     char **message)
-{
-    return ppc64Compute(host, guest, data, message);
-}
 
 static int
 virCPUppc64Update(virCPUDefPtr guest,
@@ -911,7 +903,6 @@ struct cpuArchDriver cpuDriverPPC64 = {
     .encode     = NULL,
     .free       = ppc64DriverFree,
     .nodeData   = ppc64DriverNodeData,
-    .guestData  = ppc64DriverGuestData,
     .baseline   = ppc64DriverBaseline,
     .update     = virCPUppc64Update,
     .getModels  = virCPUppc64DriverGetModels,
diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c
index fb352a0..04a6bea 100644
--- a/src/cpu/cpu_s390.c
+++ b/src/cpu/cpu_s390.c
@@ -80,7 +80,6 @@ struct cpuArchDriver cpuDriverS390 = {
     .encode     = NULL,
     .free       = s390DataFree,
     .nodeData   = s390NodeData,
-    .guestData  = NULL,
     .baseline   = NULL,
     .update     = NULL,
 };
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 851ec5d..e91850f 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1725,22 +1725,6 @@ virCPUx86Compare(virCPUDefPtr host,
 }
 
 
-static virCPUCompareResult
-x86GuestData(virCPUDefPtr host,
-             virCPUDefPtr guest,
-             virCPUDataPtr *data,
-             char **message)
-{
-    if (!guest->model) {
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("no guest CPU model specified"));
-        return VIR_CPU_COMPARE_ERROR;
-    }
-
-    return x86Compute(host, guest, data, message);
-}
-
-
 /*
  * Checks whether a candidate model is a better fit for the CPU data than the
  * current model.
@@ -2761,7 +2745,6 @@ struct cpuArchDriver cpuDriverX86 = {
 #else
     .nodeData   = NULL,
 #endif
-    .guestData  = x86GuestData,
     .baseline   = x86Baseline,
     .update     = virCPUx86Update,
     .checkFeature = virCPUx86CheckFeature,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 38f8ecb..baff82b 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -978,7 +978,6 @@ cpuBaselineXML;
 cpuDataFree;
 cpuDecode;
 cpuEncode;
-cpuGuestData;
 cpuNodeData;
 virCPUCheckFeature;
 virCPUCompare;
-- 
2.10.2

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