[PATCH 2/4] Revert "qemu: Pass migratable host model to virCPUUpdate"

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

 



This reverts commit 959e72d323d06d67a5c3a759869af6da49da0e0e which was
pushed accidentally.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c | 19 +++++--------------
 src/qemu/qemu_capabilities.h |  3 +--
 src/qemu/qemu_command.c      |  2 +-
 src/qemu/qemu_process.c      |  4 ++--
 tests/cputest.c              |  7 +------
 5 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index d2eef4321..964299b01 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2446,20 +2446,12 @@ virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
 
 virCPUDefPtr
 virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps,
-                        virDomainVirtType type,
-                        bool migratable)
+                        virDomainVirtType type)
 {
-    virQEMUCapsCPUModelPtr model;
-
     if (type == VIR_DOMAIN_VIRT_KVM)
-        model = &qemuCaps->hostCPU.kvm;
+        return qemuCaps->hostCPU.kvm.full;
     else
-        model = &qemuCaps->hostCPU.tcg;
-
-    if (migratable)
-        return model->migratable;
-    else
-        return model->full;
+        return qemuCaps->hostCPU.tcg.full;
 }
 
 
@@ -2477,7 +2469,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps,
                virQEMUCapsGuestIsNative(caps->host.arch, qemuCaps->arch);
 
     case VIR_CPU_MODE_HOST_MODEL:
-        return !!virQEMUCapsGetHostModel(qemuCaps, type, false);
+        return !!virQEMUCapsGetHostModel(qemuCaps, type);
 
     case VIR_CPU_MODE_CUSTOM:
         if (type == VIR_DOMAIN_VIRT_KVM)
@@ -5542,8 +5534,7 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps,
 
     if (virQEMUCapsIsCPUModeSupported(qemuCaps, caps, domCaps->virttype,
                                       VIR_CPU_MODE_HOST_MODEL)) {
-        virCPUDefPtr cpu = virQEMUCapsGetHostModel(qemuCaps, domCaps->virttype,
-                                                   false);
+        virCPUDefPtr cpu = virQEMUCapsGetHostModel(qemuCaps, domCaps->virttype);
         domCaps->cpu.hostModel = virCPUDefCopy(cpu);
     }
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 9959c71a6..cca9a12b5 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -450,8 +450,7 @@ int virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
                                  char ***names,
                                  size_t *count);
 virCPUDefPtr virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps,
-                                     virDomainVirtType type,
-                                     bool migratable);
+                                     virDomainVirtType type);
 bool virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps,
                                    virCapsPtr caps,
                                    virDomainVirtType type,
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7049be20a..445c696d6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6887,7 +6887,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
             if (def->cpu->mode == VIR_CPU_MODE_CUSTOM)
                 cpuDef = def->cpu;
             else if (def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH)
-                cpuDef = virQEMUCapsGetHostModel(qemuCaps, def->virtType, false);
+                cpuDef = virQEMUCapsGetHostModel(qemuCaps, def->virtType);
 
             if (cpuDef) {
                 int svm = virCPUCheckFeature(def->os.arch, cpuDef, "svm");
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b4499beaf..8323a1831 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5304,12 +5304,12 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
 
     if (def->cpu->check == VIR_CPU_CHECK_PARTIAL &&
         virCPUCompare(caps->host.arch,
-                      virQEMUCapsGetHostModel(qemuCaps, def->virtType, false),
+                      virQEMUCapsGetHostModel(qemuCaps, def->virtType),
                       def->cpu, true) < 0)
         return -1;
 
     if (virCPUUpdate(def->os.arch, def->cpu,
-                     virQEMUCapsGetHostModel(qemuCaps, def->virtType, true)) < 0)
+                     virQEMUCapsGetHostModel(qemuCaps, def->virtType)) < 0)
         goto cleanup;
 
     if (virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType,
diff --git a/tests/cputest.c b/tests/cputest.c
index d5e023c40..528030754 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -393,7 +393,6 @@ cpuTestUpdate(const void *arg)
     const struct data *data = arg;
     int ret = -1;
     virCPUDefPtr host = NULL;
-    virCPUDefPtr migHost = NULL;
     virCPUDefPtr cpu = NULL;
     char *result = NULL;
 
@@ -401,10 +400,7 @@ cpuTestUpdate(const void *arg)
         !(cpu = cpuTestLoadXML(data->arch, data->name)))
         goto cleanup;
 
-    if (!(migHost = virCPUCopyMigratable(data->arch, host)))
-        goto cleanup;
-
-    if (virCPUUpdate(host->arch, cpu, migHost) < 0)
+    if (virCPUUpdate(host->arch, cpu, host) < 0)
         goto cleanup;
 
     if (virAsprintf(&result, "%s+%s", data->host, data->name) < 0)
@@ -415,7 +411,6 @@ cpuTestUpdate(const void *arg)
  cleanup:
     virCPUDefFree(host);
     virCPUDefFree(cpu);
-    virCPUDefFree(migHost);
     VIR_FREE(result);
     return ret;
 }
-- 
2.12.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]
  Powered by Linux