@@ -248,8 +248,6 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
248
248
CPUX86State * env = & cpu -> env ;
249
249
MachineState * ms = MACHINE (hotplug_dev );
250
250
X86MachineState * x86ms = X86_MACHINE (hotplug_dev );
251
- unsigned int smp_cores = ms -> smp .cores ;
252
- unsigned int smp_threads = ms -> smp .threads ;
253
251
X86CPUTopoInfo topo_info ;
254
252
255
253
if (!object_dynamic_cast (OBJECT (cpu ), ms -> cpu_type )) {
@@ -329,17 +327,17 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
329
327
if (cpu -> core_id < 0 ) {
330
328
error_setg (errp , "CPU core-id is not set" );
331
329
return ;
332
- } else if (cpu -> core_id > (smp_cores - 1 )) {
330
+ } else if (cpu -> core_id > (ms -> smp . cores - 1 )) {
333
331
error_setg (errp , "Invalid CPU core-id: %u must be in range 0:%u" ,
334
- cpu -> core_id , smp_cores - 1 );
332
+ cpu -> core_id , ms -> smp . cores - 1 );
335
333
return ;
336
334
}
337
335
if (cpu -> thread_id < 0 ) {
338
336
error_setg (errp , "CPU thread-id is not set" );
339
337
return ;
340
- } else if (cpu -> thread_id > (smp_threads - 1 )) {
338
+ } else if (cpu -> thread_id > (ms -> smp . threads - 1 )) {
341
339
error_setg (errp , "Invalid CPU thread-id: %u must be in range 0:%u" ,
342
- cpu -> thread_id , smp_threads - 1 );
340
+ cpu -> thread_id , ms -> smp . threads - 1 );
343
341
return ;
344
342
}
345
343
0 commit comments