fix numa-related (and kernel-dependent) test failures

This change is required on some kernels due to the way a change in
the kernel's CONFIG_NR_CPUS propagates through the numa library.
* src/qemu_conf.c (qemudCapsInitNUMA): Pass numa_all_cpus_ptr->size/8
as the buffer-length-in-bytes in the call to numa_node_to_cpus, since
that's what is required on second and subseqent calls.
* src/uml_conf.c (umlCapsInitNUMA): Likewise.
This commit is contained in:
Jim Meyering 2008-12-17 07:05:45 +00:00
parent 0e459cbdfb
commit 7e6a06aeae
3 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,13 @@
Wed Dec 17 08:02:01 +0100 2008 Jim Meyering <meyering@redhat.com>
fix numa-related (and kernel-dependent) test failures
This change is required on some kernels due to the way a change in
the kernel's CONFIG_NR_CPUS propagates through the numa library.
* src/qemu_conf.c (qemudCapsInitNUMA): Pass numa_all_cpus_ptr->size/8
as the buffer-length-in-bytes in the call to numa_node_to_cpus, since
that's what is required on second and subseqent calls.
* src/uml_conf.c (umlCapsInitNUMA): Likewise.
Tue Dec 16 17:26:49 EST 2008 Cole Robinson <crobinso@redhat.com> Tue Dec 16 17:26:49 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/qemu_driver.c: Sanitize qemu monitor reads. * src/qemu_driver.c: Sanitize qemu monitor reads.

View File

@ -323,8 +323,8 @@ qemudCapsInitNUMA(virCapsPtr caps)
goto cleanup; goto cleanup;
for (n = 0 ; n <= numa_max_node() ; n++) { for (n = 0 ; n <= numa_max_node() ; n++) {
int mask_n_bytes = numa_all_cpus_ptr->size / 8;
if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN / 8) < 0) if (numa_node_to_cpus(n, mask, mask_n_bytes) < 0)
goto cleanup; goto cleanup;
for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++) for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)

View File

@ -79,8 +79,8 @@ umlCapsInitNUMA(virCapsPtr caps)
goto cleanup; goto cleanup;
for (n = 0 ; n <= numa_max_node() ; n++) { for (n = 0 ; n <= numa_max_node() ; n++) {
int mask_n_bytes = numa_all_cpus_ptr->size / 8;
if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN / 8) < 0) if (numa_node_to_cpus(n, mask, mask_n_bytes) < 0)
goto cleanup; goto cleanup;
for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++) for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)