Commit 2a0585e1 authored by Eduardo Habkost's avatar Eduardo Habkost
Browse files

pc: Fix error message on die-id validation



The error message for die-id range validation is incorrect.  Example:

  $ qemu-system-x86_64 -smp 1,sockets=6,maxcpus=6 \
    -device qemu64-x86_64-cpu,socket-id=1,die-id=1,core-id=0,thread-id=0
  qemu-system-x86_64: -device qemu64-x86_64-cpu,socket-id=1,die-id=1,core-id=0,thread-id=0: \
    Invalid CPU die-id: 1 must be in range 0:5

The actual range for die-id in this example is 0:0.

Fix the error message to use smp_dies and print the correct range.

Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190815183803.13346-2-ehabkost@redhat.com>
Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
Reviewed-by: default avatarVanderson M. do Rosario <vandersonmr2@gmail.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent 7e721e7b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2430,7 +2430,7 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
            return;
        } else if (cpu->die_id > pcms->smp_dies - 1) {
            error_setg(errp, "Invalid CPU die-id: %u must be in range 0:%u",
                       cpu->die_id, max_socket);
                       cpu->die_id, pcms->smp_dies - 1);
            return;
        }
        if (cpu->core_id < 0) {