diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2013-02-04 16:27:48 -0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-04 14:38:33 -0600 |
commit | ca4c6d363153f19abf3ffdf0ca1532daa581867d (patch) | |
tree | 02d873a0f7bf05c8df778d1975f4db9b519098f2 /vl.c | |
parent | 12e53a9d59c8cb272a423e1db036324579a3c697 (diff) |
vl.c: Check for NUMA node limit inside numa_add()
Instead of checking the limit before calling numa_add(), check the limit
only when we already know we're going to add a new node.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1258,6 +1258,12 @@ static void numa_add(const char *optarg) optarg++; } if (!strcmp(option, "node")) { + + if (nb_numa_nodes >= MAX_NODES) { + fprintf(stderr, "qemu: too many NUMA nodes\n"); + exit(1); + } + if (get_param_value(option, 128, "nodeid", optarg) == 0) { nodenr = nb_numa_nodes; } else { @@ -3003,10 +3009,6 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_numa: - if (nb_numa_nodes >= MAX_NODES) { - fprintf(stderr, "qemu: too many NUMA nodes\n"); - exit(1); - } numa_add(optarg); break; case QEMU_OPTION_display: |