pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
PATCH 1/1 pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
pc_dimm_realize() validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.
--- hw/mem/pc-dimm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/mem/pc-dimm.c +3 -2
@@ -414,10 +414,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)error_setg (errp,"'" PC_DIMM_MEMDEV_PROP "' property is not set" );return ; } -if ((nb_numa_nodes >0 ) && (dimm->node >= nb_numa_nodes)) { +if (((nb_numa_nodes >0 ) && (dimm->node >= nb_numa_nodes)) || + (!nb_numa_nodes && dimm->node)) {error_setg (errp,"'DIMM property " PC_DIMM_NODE_PROP " has value %" PRIu32"' which exceeds the number of numa nodes: %d" , - dimm->node, nb_numa_nodes); + dimm->node, nb_numa_nodes ? nb_numa_nodes :1 );return ; } }
Signature · 1 line
2.1.0
Quoted 5 lines · Bharata B Rao
pc_dimm_realize()validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.Signed-off-by Bharata B Rao <[email protected]>
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 5 lines · On Fri, 17 Jul 2015 18:19:40 +0530 Bharata B Rao <[email protected]>…
pc_dimm_realize()validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.Signed-off-by Bharata B Rao <[email protected]>
Quoted 22 lines
--- hw/mem/pc-dimm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)hw/mem/pc-dimm.c +3
-2@@ -414,10 +414,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)error_setg (errp,"'" PC_DIMM_MEMDEV_PROP "' property is not set" );return ; } -if ((nb_numa_nodes >0 ) && (dimm->node >= nb_numa_nodes)) { +if (((nb_numa_nodes >0 ) && (dimm->node >= nb_numa_nodes)) || + (!nb_numa_nodes && dimm->node)) {error_setg (errp,"'DIMM property " PC_DIMM_NODE_PROP " has value %" PRIu32"' which exceeds the number of numa nodes: %d" , - dimm->node, nb_numa_nodes); + dimm->node, nb_numa_nodes ? nb_numa_nodes :1 );return ; } }
Quoted 24 lines · Igor Mammedov
Quoted 5 lines · On Fri, 17 Jul 2015 18:19:40 +0530 Bharata B Rao <[email protected]>…
pc_dimm_realize()validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.Signed-off-by Bharata B Rao <[email protected]>Reviewed-by Igor Mammedov <[email protected]>Quoted 14 lines
--- hw/mem/pc-dimm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)hw/mem/pc-dimm.c +1
-1@@ -414,10 +414,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)error_setg (errp,"'" PC_DIMM_MEMDEV_PROP "' property is not set" );return ; } -if ((nb_numa_nodes >0 ) && (dimm->node >= nb_numa_nodes)) { + if (((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) ||
Quoted 8 lines
hw/mem/pc-dimm.c static void pc_dimm_realize(DeviceState *dev, Error **errp) · line 424
Quoted 8 lines
hw/mem/pc-dimm.c +2
-1+ (!nb_numa_nodes && dimm->node)) {error_setg (errp,"'DIMM property " PC_DIMM_NODE_PROP " has value %" PRIu32"' which exceeds the number of numa nodes: %d" , - dimm->node, nb_numa_nodes); + dimm->node, nb_numa_nodes ? nb_numa_nodes :1 );return ; } }
Eduardo - Will this go via your tree ?
Regards,
Bharata.
Eduardo Habkost
AppliedApplied to the numa tree, with the following changes in the commit message:
Subject was changed to:
pc-dimm: Fail realization for invalid nodes in non-NUMA config
to make it shorter.
Quoted 3 lines · Bharata B Rao
pc_dimm_realize()validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.
Changed to "to fail for invalid nodes".
Quoted 2 lines
Signed-off-by Bharata B Rao <[email protected]>
Thanks!
Signature · 1 line
Eduardo
Quoted 6 lines · Eduardo Habkost
Applied to the numa tree, with the following changes in the commit message:
Subject was changed to:
pc-dimm: Fail realization for invalid nodes in non-NUMA config
to make it shorter.
Hmm I don't see it here:
https://github.com/ehabkost/qemu/commits/numa
Regards,
Bharata.
Quoted 10 lines · Bharata B Rao
Quoted 6 lines · Eduardo Habkost
Applied to the numa tree, with the following changes in the commit message:
Subject was changed to:
pc-dimm: Fail realization for invalid nodes in non-NUMA config
to make it shorter.Hmm I don't see it here:
https://github.com/ehabkost/qemu/commits/numa
Sorry, forgot to push it. It should be there, now.
Signature · 1 line
Eduardo