@@ -112,62 +112,38 @@ void machine_parse_smp_config(MachineState *ms,
}
/*
- * If not supported by the machine, a topology parameter must be
- * omitted.
+ * If not supported by the machine, a topology parameter must
+ * not be set to a value greater than 1.
*/
- if (!mc->smp_props.clusters_supported && config->has_clusters) {
- if (config->clusters > 1) {
- error_setg(errp, "clusters not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here clusters only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported clusters parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.clusters_supported &&
+ config->has_clusters && config->clusters > 1) {
+ error_setg(errp,
+ "clusters > 1 not supported by this machine's CPU topology");
+ return;
}
clusters = clusters > 0 ? clusters : 1;
- if (!mc->smp_props.dies_supported && config->has_dies) {
- if (config->dies > 1) {
- error_setg(errp, "dies not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here dies only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported dies parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.dies_supported &&
+ config->has_dies && config->dies > 1) {
+ error_setg(errp,
+ "dies > 1 not supported by this machine's CPU topology");
+ return;
}
dies = dies > 0 ? dies : 1;
- if (!mc->smp_props.books_supported && config->has_books) {
- if (config->books > 1) {
- error_setg(errp, "books not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here books only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported books parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.books_supported &&
+ config->has_books && config->books > 1) {
+ error_setg(errp,
+ "books > 1 not supported by this machine's CPU topology");
+ return;
}
books = books > 0 ? books : 1;
- if (!mc->smp_props.drawers_supported && config->has_drawers) {
- if (config->drawers > 1) {
- error_setg(errp, "drawers not supported by this "
- "machine's CPU topology");
- return;
- } else {
- /* Here drawers only equals 1 since we've checked zero case. */
- warn_report("Deprecated CPU topology (considered invalid): "
- "Unsupported drawers parameter mustn't be "
- "specified as 1");
- }
+ if (!mc->smp_props.drawers_supported &&
+ config->has_drawers && config->drawers > 1) {
+ error_setg(errp,
+ "drawers > 1 not supported by this machine's CPU topology");
+ return;
}
drawers = drawers > 0 ? drawers : 1;
@@ -337,21 +337,21 @@ static const struct SMPTestData data_generic_invalid[] = {
{
/* config: -smp 2,dies=2 */
.config = SMP_CONFIG_WITH_DIES(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0),
- .expect_error = "dies not supported by this machine's CPU topology",
+ .expect_error = "dies > 1 not supported by this machine's CPU topology",
}, {
/* config: -smp 2,clusters=2 */
.config = SMP_CONFIG_WITH_CLUSTERS(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0),
- .expect_error = "clusters not supported by this machine's CPU topology",
+ .expect_error = "clusters > 1 not supported by this machine's CPU topology",
}, {
/* config: -smp 2,books=2 */
.config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, F, 0, T, 2, F,
0, F, 0, F, 0, F, 0),
- .expect_error = "books not supported by this machine's CPU topology",
+ .expect_error = "books > 1 not supported by this machine's CPU topology",
}, {
/* config: -smp 2,drawers=2 */
.config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, T, 2, F, 0, F,
0, F, 0, F, 0, F, 0),
- .expect_error = "drawers not supported by this machine's CPU topology",
+ .expect_error = "drawers > 1 not supported by this machine's CPU topology",
}, {
/* config: -smp 8,sockets=2,cores=4,threads=2,maxcpus=8 */
.config = SMP_CONFIG_GENERIC(T, 8, T, 2, T, 4, T, 2, T, 8),