From 7032e08c858e99963009bec98984f94fd2ed4ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=B6hm?= Date: Mon, 15 May 2017 16:16:12 +0200 Subject: [PATCH] Fix #1384: add missing decrement to calculation of socket-id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For calculation of "current_core" the input variable id is decremented. For calculation of "current_socket" this decrement was missing resulting in a wrong value when "cores" is set to 1. Signed-off-by: Tobias Böhm --- PVE/QemuServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 2fb419db..f324a64a 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1725,7 +1725,7 @@ sub print_cpu_device { my $cores = $conf->{cores} || 1; my $current_core = ($id - 1) % $cores; - my $current_socket = int(($id - $current_core)/$cores); + my $current_socket = int(($id - 1 - $current_core)/$cores); return "$cpu-x86_64-cpu,id=cpu$id,socket-id=$current_socket,core-id=$current_core,thread-id=0"; }