From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6uXI-0002ge-AA for qemu-devel@nongnu.org; Thu, 10 Dec 2015 01:17:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6uXE-00037R-Ue for qemu-devel@nongnu.org; Thu, 10 Dec 2015 01:17:04 -0500 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:39210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6uXE-00037C-BU for qemu-devel@nongnu.org; Thu, 10 Dec 2015 01:17:00 -0500 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Dec 2015 16:16:58 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id F05B22BB0052 for ; Thu, 10 Dec 2015 17:16:55 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tBA6Glu423068698 for ; Thu, 10 Dec 2015 17:16:55 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tBA6GMvU030270 for ; Thu, 10 Dec 2015 17:16:23 +1100 From: Bharata B Rao Date: Thu, 10 Dec 2015 11:45:40 +0530 Message-Id: <1449728144-6223-6-git-send-email-bharata@linux.vnet.ibm.com> In-Reply-To: <1449728144-6223-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1449728144-6223-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v0 5/9] vl: Create CPU socket backend objects List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, ehabkost@redhat.com, Bharata B Rao , agraf@suse.de, borntraeger@de.ibm.com, imammedo@redhat.com, pbonzini@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au Create as many CPU socket objects as necessary to contain the max_cpus. Signed-off-by: Bharata B Rao --- vl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vl.c b/vl.c index e656f53..83d08c6 100644 --- a/vl.c +++ b/vl.c @@ -124,6 +124,7 @@ int main(int argc, char **argv) #include "crypto/init.h" #include "sysemu/replay.h" #include "qapi/qmp/qerror.h" +#include "hw/cpu/socket.h" #define MAX_VIRTIO_CONSOLES 1 #define MAX_SCLP_CONSOLES 1 @@ -3014,6 +3015,7 @@ int main(int argc, char **argv, char **envp) FILE *vmstate_dump_file = NULL; Error *main_loop_err = NULL; Error *err = NULL; + int sockets; qemu_init_cpu_loop(); qemu_mutex_lock_iothread(); @@ -4154,6 +4156,17 @@ int main(int argc, char **argv, char **envp) } /* + * Create CPU socket objects which house CPU cores. + */ + sockets = DIV_ROUND_UP(max_cpus, smp_cores * smp_threads); + for (i = 0; i < sockets; i++) { + char id[32]; + + snprintf(id, 32, "" TYPE_CPU_SOCKET "%d", i); + object_add(TYPE_CPU_SOCKET, id, NULL, NULL, &error_abort); + } + + /* * Get the default machine options from the machine if it is not already * specified either by the configuration file or by the command line. */ -- 2.1.0