[PATCH 3/4] qemu: Use virCPUCheckFeature in qemuMigrationIsAllowed

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_migration.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index f5711bcf7..1e052a197 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2324,19 +2324,12 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver,
             return false;
 
         if (vm->def->cpu) {
-            for (i = 0; i < vm->def->cpu->nfeatures; i++) {
-                virCPUFeatureDefPtr feature = &vm->def->cpu->features[i];
-
-                if (feature->policy != VIR_CPU_FEATURE_REQUIRE)
-                    continue;
-
-                /* QEMU blocks migration and save with invariant TSC enabled */
-                if (STREQ(feature->name, "invtsc")) {
-                    virReportError(VIR_ERR_OPERATION_INVALID,
-                                   _("domain has CPU feature: %s"),
-                                   feature->name);
-                    return false;
-                }
+            /* QEMU blocks migration and save with invariant TSC enabled */
+            if (virCPUCheckFeature(vm->def->os.arch, vm->def->cpu,
+                                   "invtsc") == 1) {
+                virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                               _("domain has 'invtsc' CPU feature"));
+                return false;
             }
         }
 
-- 
2.12.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]
  Powered by Linux