cphp: remove deprecated cpu-add command(s)

These were deprecated since 4.0, remove both HMP and QMP variants.

Users should use device_add command instead. To get list of
possible CPUs and options, use 'info hotpluggable-cpus' HMP
or query-hotpluggable-cpus QMP command.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20200915120403.1074579-1-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Igor Mammedov 2020-09-15 08:04:03 -04:00 committed by Michael S. Tsirkin
parent 892040dc8b
commit 63e79833c4
13 changed files with 21 additions and 211 deletions

View file

@ -25,54 +25,6 @@ struct PlugTestData {
};
typedef struct PlugTestData PlugTestData;
static void test_plug_with_cpu_add(gconstpointer data)
{
const PlugTestData *s = data;
char *args;
QDict *response;
unsigned int i;
args = g_strdup_printf("-machine %s -cpu %s "
"-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u",
s->machine, s->cpu_model,
s->sockets, s->cores, s->threads, s->maxcpus);
qtest_start(args);
for (i = 1; i < s->maxcpus; i++) {
response = qmp("{ 'execute': 'cpu-add',"
" 'arguments': { 'id': %d } }", i);
g_assert(response);
g_assert(!qdict_haskey(response, "error"));
qobject_unref(response);
}
qtest_end();
g_free(args);
}
static void test_plug_without_cpu_add(gconstpointer data)
{
const PlugTestData *s = data;
char *args;
QDict *response;
args = g_strdup_printf("-machine %s -cpu %s "
"-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u",
s->machine, s->cpu_model,
s->sockets, s->cores, s->threads, s->maxcpus);
qtest_start(args);
response = qmp("{ 'execute': 'cpu-add',"
" 'arguments': { 'id': %d } }",
s->sockets * s->cores * s->threads);
g_assert(response);
g_assert(qdict_haskey(response, "error"));
qobject_unref(response);
qtest_end();
g_free(args);
}
static void test_plug_with_device_add(gconstpointer data)
{
const PlugTestData *td = data;
@ -144,36 +96,13 @@ static void add_pc_test_case(const char *mname)
data->cores = 3;
data->threads = 2;
data->maxcpus = data->sockets * data->cores * data->threads;
if (g_str_has_suffix(mname, "-1.4") ||
(strcmp(mname, "pc-1.3") == 0) ||
(strcmp(mname, "pc-1.2") == 0) ||
(strcmp(mname, "pc-1.1") == 0) ||
(strcmp(mname, "pc-1.0") == 0)) {
path = g_strdup_printf("cpu-plug/%s/init/%ux%ux%u&maxcpus=%u",
mname, data->sockets, data->cores,
data->threads, data->maxcpus);
qtest_add_data_func_full(path, data, test_plug_without_cpu_add,
test_data_free);
g_free(path);
} else {
PlugTestData *data2 = g_memdup(data, sizeof(PlugTestData));
data2->machine = g_strdup(data->machine);
data2->device_model = g_strdup(data->device_model);
path = g_strdup_printf("cpu-plug/%s/cpu-add/%ux%ux%u&maxcpus=%u",
mname, data->sockets, data->cores,
data->threads, data->maxcpus);
qtest_add_data_func_full(path, data, test_plug_with_cpu_add,
test_data_free);
g_free(path);
path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
mname, data2->sockets, data2->cores,
data2->threads, data2->maxcpus);
qtest_add_data_func_full(path, data2, test_plug_with_device_add,
test_data_free);
g_free(path);
}
path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
mname, data->sockets, data->cores,
data->threads, data->maxcpus);
qtest_add_data_func_full(path, data, test_plug_with_device_add,
test_data_free);
g_free(path);
}
static void add_pseries_test_case(const char *mname)
@ -205,7 +134,7 @@ static void add_pseries_test_case(const char *mname)
static void add_s390x_test_case(const char *mname)
{
char *path;
PlugTestData *data, *data2;
PlugTestData *data;
if (!g_str_has_prefix(mname, "s390-ccw-virtio-")) {
return;
@ -220,21 +149,10 @@ static void add_s390x_test_case(const char *mname)
data->threads = 1;
data->maxcpus = data->sockets * data->cores * data->threads;
data2 = g_memdup(data, sizeof(PlugTestData));
data2->machine = g_strdup(data->machine);
data2->device_model = g_strdup(data->device_model);
path = g_strdup_printf("cpu-plug/%s/cpu-add/%ux%ux%u&maxcpus=%u",
path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
mname, data->sockets, data->cores,
data->threads, data->maxcpus);
qtest_add_data_func_full(path, data, test_plug_with_cpu_add,
test_data_free);
g_free(path);
path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
mname, data2->sockets, data2->cores,
data2->threads, data2->maxcpus);
qtest_add_data_func_full(path, data2, test_plug_with_device_add,
qtest_add_data_func_full(path, data, test_plug_with_device_add,
test_data_free);
g_free(path);
}