vl:c: make sure that sockets are calculated correctly in '-smp X' case
commit268430be5e411d34808e824b4714eee30c7d157a
authorIgor Mammedov <imammedo@redhat.com>
Thu, 13 Sep 2018 11:06:02 +0000 (13 13:06 +0200)
committerEduardo Habkost <ehabkost@redhat.com>
Wed, 24 Oct 2018 09:44:59 +0000 (24 06:44 -0300)
tree8bb06ce98d2e57dda0f43741d25f1c5eb3a126eb
parentbc1fb850a31468ac4976f3895f01a6d981e06d0a
vl:c: make sure that sockets are calculated correctly in '-smp X' case

commit
  (5cdc9b76e3 vl.c: Remove dead assignment)
removed sockets calculation when 'sockets' weren't provided on CLI
since there wasn't any users for it back then. Exiting checks
are neither reachable
   } else if (sockets * cores * threads < cpus) {
or nor triggerable
   if (sockets * cores * threads > max_cpus)
so we weren't noticing wrong topology since then, since users
recalculate sockets adhoc on their own.

However with deprecation check it becomes noticable, for example
  -smp 2
will start printing warning:
  "warning: Invalid CPU topology deprecated: sockets (1) * cores (1) * threads (1) != maxcpus (2)"
calculating sockets if they weren't specified.

Fix it by returning back sockets calculation if it's omitted on CLI.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-Id: <1536836762-273036-3-git-send-email-imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
vl.c