qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vl.c: make sure maxcpus matches topology to prevent migration failure
@ 2018-08-23 14:51 Igor Mammedov
  2018-08-23 16:32 ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Igor Mammedov @ 2018-08-23 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, ehabkost, dgilbert

Topology (threads*cores*sockets) must match maxcpus to be valid,
otherwise we could start QEMU with invalid topology that throws
a error on migration destination side, that should not be reachable:
Source:
  -smp 8,maxcpus=64,cores=1,threads=8,sockets=1
// hotplug cpus upto maxcpus
Destination:
  -smp 64,maxcpus=64,cores=1,threads=8,sockets=1
  qemu: cpu topology: sockets (1) * cores (1) * threads (8) < smp_cpus (64)

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 vl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vl.c b/vl.c
index 16b913f..2b35e0c 100644
--- a/vl.c
+++ b/vl.c
@@ -1238,10 +1238,10 @@ static void smp_parse(QemuOpts *opts)
             exit(1);
         }
 
-        if (sockets * cores * threads > max_cpus) {
+        if (sockets * cores * threads != max_cpus) {
             error_report("cpu topology: "
-                         "sockets (%u) * cores (%u) * threads (%u) > "
-                         "maxcpus (%u)",
+                         "sockets (%u) * cores (%u) * threads (%u) not equal to"
+                         " maxcpus (%u)",
                          sockets, cores, threads, max_cpus);
             exit(1);
         }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-08-27 11:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-23 14:51 [Qemu-devel] [PATCH] vl.c: make sure maxcpus matches topology to prevent migration failure Igor Mammedov
2018-08-23 16:32 ` Paolo Bonzini
2018-08-23 18:03   ` Eduardo Habkost
2018-08-24  9:15     ` Igor Mammedov
2018-08-27 11:21     ` Andrew Jones
2018-08-24  9:13   ` Igor Mammedov
2018-08-24 11:11     ` Eduardo Habkost
2018-08-24 11:26       ` Igor Mammedov
2018-08-24 13:53         ` Eduardo Habkost
2018-08-24 14:03           ` [Qemu-devel] [libvirt] " Daniel P. Berrangé
2018-08-24 15:24           ` [Qemu-devel] " Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).