Received: from eggs.gnu.org ([2001:4830:134:3::10]:59909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1IQx-0006pO-0w for qemu-devel@nongnu.org; Sun, 29 Jun 2014 12:58:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1IQq-0003Dm-TJ for qemu-devel@nongnu.org; Sun, 29 Jun 2014 12:58:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1IQq-0003Dd-MR for qemu-devel@nongnu.org; Sun, 29 Jun 2014 12:58:24 -0400 Date: Sun, 29 Jun 2014 19:58:44 +0300 From: "Michael S. Tsirkin" Message-ID: <1404060115-27410-13-git-send-email-mst@redhat.com> References: <1404060115-27410-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1404060115-27410-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 12/37] numa: Reject configuration if not all node IDs are present List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Eduardo Habkost , Hu Tao , Anthony Liguori , Paolo Bonzini , Wanlong Gao From: Eduardo Habkost We don't support sparse NUMA node IDs yet, so this changes QEMU to reject configs where not all nodes are present. Signed-off-by: Eduardo Habkost Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Eric Blake --- numa.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/numa.c b/numa.c index c254127..2fde740 100644 --- a/numa.c +++ b/numa.c @@ -160,9 +160,24 @@ error: void set_numa_nodes(void) { + int i; + + assert(max_numa_nodeid <= MAX_NODES); + + /* No support for sparse NUMA node IDs yet: */ + for (i = max_numa_nodeid - 1; i >= 0; i--) { + /* Report large node IDs first, to make mistakes easier to spot */ + if (!numa_info[i].present) { + error_report("numa: Node ID missing: %d", i); + exit(1); + } + } + + /* This must be always true if all nodes are present: */ + assert(nb_numa_nodes == max_numa_nodeid); + if (nb_numa_nodes > 0) { uint64_t numa_total; - int i; if (nb_numa_nodes > MAX_NODES) { nb_numa_nodes = MAX_NODES; -- MST