diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index e6c378f..7019c14 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -324,7 +324,7 @@ qemudCapsInitNUMA(virCapsPtr caps)
 
     for (n = 0 ; n <= numa_max_node() ; n++) {
 
-        if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN) < 0)
+        if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN / 8) < 0)
             goto cleanup;
 
         for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
diff --git a/src/uml_conf.c b/src/uml_conf.c
index 7eb630d..3659c6b 100644
--- a/src/uml_conf.c
+++ b/src/uml_conf.c
@@ -80,7 +80,7 @@ umlCapsInitNUMA(virCapsPtr caps)
 
     for (n = 0 ; n <= numa_max_node() ; n++) {
 
-        if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN) < 0)
+        if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN / 8) < 0)
             goto cleanup;
 
         for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
