]> git.proxmox.com Git - qemu-server.git/commitdiff
Fix #1384: add missing decrement to calculation of socket-id
authorTobias Böhm <tb@robhost.de>
Mon, 15 May 2017 14:16:12 +0000 (16:16 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 23 May 2017 12:21:55 +0000 (14:21 +0200)
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 <tb@robhost.de>
PVE/QemuServer.pm

index 2fb419db835dbbe043e0892fcd479a0b882d1592..f324a64ac01a86097eca135fd25de6c9c1995c83 100644 (file)
@@ -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";
 }