Plans for the next release
by Jiri Denemark
We are getting close to the next release of libvirt. To aim for the
release on Oct 01 I suggest entering the freeze on Thursday Sep 24 and
tagging RC2 on Tuesday Sep 29.
I hope this works for everyone.
Jirka
4 years, 3 months
[libvirt PATCH 00/14] rewrite DBus to use GLib instead of libdbus
by Pavel Hrdina
Pavel Hrdina (14):
remove HAL node device driver
tests: mock libdbus in networkxml2firewalltest
util: introduce helpers for GLib DBus implementation
tests/virmock: extend number of arguments
tests: introduce virgdbusmock to mock GLib DBus functions
src/util/virpolkit: convert to use GLib DBus
src/util/virfirewalld: convert to use GLib DBus
src/util/virsystemd: convert to use GLib DBus
src/lxc/lxc_controller: convert to use GLib DBus
src/network/bridge_driver: convert to use GLib DBus
src/nwfilter/nwfilter_driver: convert to use GLib DBus
src/remote/remote_daemon: convert to use GLib DBus
src/rpc/virnetdaemon: convert to use GLib DBus
drop libdbus from libvirt
libvirt.spec.in | 3 -
meson.build | 42 +-
meson_options.txt | 2 -
po/POTFILES.in | 3 +-
src/libvirt_private.syms | 31 +-
src/libvirt_probes.d | 6 -
src/lxc/lxc_controller.c | 6 +-
src/lxc/meson.build | 1 -
src/meson.build | 1 -
src/network/bridge_driver.c | 81 +-
src/network/meson.build | 2 -
src/node_device/meson.build | 5 -
src/node_device/node_device_driver.c | 10 +-
src/node_device/node_device_driver.h | 5 -
src/node_device/node_device_hal.c | 843 ------------
src/node_device/node_device_hal.h | 22 -
src/nwfilter/meson.build | 1 -
src/nwfilter/nwfilter_driver.c | 127 +-
src/remote/remote_daemon.c | 73 +-
src/remote/remote_daemon_dispatch.c | 1 -
src/rpc/meson.build | 1 -
src/rpc/virnetdaemon.c | 115 +-
src/util/meson.build | 3 +-
src/util/virdbus.c | 1871 --------------------------
src/util/virdbus.h | 76 --
src/util/virdbuspriv.h | 56 -
src/util/virfirewalld.c | 197 ++-
src/util/virgdbus.c | 425 ++++++
src/util/virgdbus.h | 79 ++
src/util/virpolkit.c | 115 +-
src/util/virsystemd.c | 371 ++---
tests/meson.build | 29 +-
tests/networkxml2firewalltest.c | 30 +-
tests/virdbusmock.c | 62 -
tests/virdbustest.c | 728 ----------
tests/virfirewalltest.c | 154 +--
tests/virgdbusmock.c | 85 ++
tests/virmock.h | 10 +-
tests/virpolkittest.c | 112 +-
tests/virsystemdtest.c | 173 +--
40 files changed, 1330 insertions(+), 4627 deletions(-)
delete mode 100644 src/node_device/node_device_hal.c
delete mode 100644 src/node_device/node_device_hal.h
delete mode 100644 src/util/virdbus.c
delete mode 100644 src/util/virdbus.h
delete mode 100644 src/util/virdbuspriv.h
create mode 100644 src/util/virgdbus.c
create mode 100644 src/util/virgdbus.h
delete mode 100644 tests/virdbusmock.c
delete mode 100644 tests/virdbustest.c
create mode 100644 tests/virgdbusmock.c
--
2.26.2
4 years, 3 months
[PULL v3 13/15] cphp: remove deprecated cpu-add command(s)
by Michael S. Tsirkin
From: Igor Mammedov <imammedo(a)redhat.com>
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(a)redhat.com>
Reviewed-by: Thomas Huth <thuth(a)redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert(a)redhat.com>
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Acked-by: Cornelia Huck <cohuck(a)redhat.com>
Message-Id: <20200915120403.1074579-1-imammedo(a)redhat.com>
Reviewed-by: Michael S. Tsirkin <mst(a)redhat.com>
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
---
qapi/machine.json | 24 ---------
include/hw/boards.h | 1 -
include/hw/i386/pc.h | 1 -
include/monitor/hmp.h | 1 -
hw/core/machine-hmp-cmds.c | 12 -----
hw/core/machine-qmp-cmds.c | 12 -----
hw/i386/pc.c | 27 ----------
hw/i386/pc_piix.c | 1 -
hw/s390x/s390-virtio-ccw.c | 12 -----
tests/qtest/cpu-plug-test.c | 100 ++++--------------------------------
tests/qtest/test-hmp.c | 1 -
docs/system/deprecated.rst | 25 +++++----
hmp-commands.hx | 15 ------
13 files changed, 21 insertions(+), 211 deletions(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index 0ac1880e4a..d8ed096e9a 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -307,30 +307,6 @@
##
{ 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
-##
-# @cpu-add:
-#
-# Adds CPU with specified ID.
-#
-# @id: ID of CPU to be created, valid values [0..max_cpus)
-#
-# Features:
-# @deprecated: This command is deprecated. Use `device_add` instead.
-# See the `query-hotpluggable-cpus` command for details.
-#
-# Returns: Nothing on success
-#
-# Since: 1.5
-#
-# Example:
-#
-# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'cpu-add', 'data': {'id': 'int'},
- 'features': [ 'deprecated' ] }
-
##
# @MachineInfo:
#
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 795910d01b..7abd5d889c 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -169,7 +169,6 @@ struct MachineClass {
void (*init)(MachineState *state);
void (*reset)(MachineState *state);
void (*wakeup)(MachineState *state);
- void (*hot_add_cpu)(MachineState *state, const int64_t id, Error **errp);
int (*kvm_type)(MachineState *machine, const char *arg);
void (*smp_parse)(MachineState *ms, QemuOpts *opts);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index c14e14dfe0..be42fe3599 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -134,7 +134,6 @@ extern int fd_bootchk;
void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
-void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp);
void pc_smp_parse(MachineState *ms, QemuOpts *opts);
void pc_guest_info_init(PCMachineState *pcms);
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index c986cfd28b..642e9e91f9 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -89,7 +89,6 @@ void hmp_chardev_add(Monitor *mon, const QDict *qdict);
void hmp_chardev_change(Monitor *mon, const QDict *qdict);
void hmp_chardev_remove(Monitor *mon, const QDict *qdict);
void hmp_chardev_send_break(Monitor *mon, const QDict *qdict);
-void hmp_cpu_add(Monitor *mon, const QDict *qdict);
void hmp_object_add(Monitor *mon, const QDict *qdict);
void hmp_object_del(Monitor *mon, const QDict *qdict);
void hmp_info_memdev(Monitor *mon, const QDict *qdict);
diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index 39999c47c5..f4092b98cc 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -46,18 +46,6 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
qapi_free_CpuInfoFastList(cpu_list);
}
-void hmp_cpu_add(Monitor *mon, const QDict *qdict)
-{
- int cpuid;
- Error *err = NULL;
-
- error_report("cpu_add is deprecated, please use device_add instead");
-
- cpuid = qdict_get_int(qdict, "id");
- qmp_cpu_add(cpuid, &err);
- hmp_handle_error(mon, err);
-}
-
void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 21551221ad..5362c80a18 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -284,18 +284,6 @@ HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
return machine_query_hotpluggable_cpus(ms);
}
-void qmp_cpu_add(int64_t id, Error **errp)
-{
- MachineClass *mc;
-
- mc = MACHINE_GET_CLASS(current_machine);
- if (mc->hot_add_cpu) {
- mc->hot_add_cpu(current_machine, id, errp);
- } else {
- error_setg(errp, "Not supported");
- }
-}
-
void qmp_set_numa_node(NumaOptions *cmd, Error **errp)
{
if (!runstate_check(RUN_STATE_PRECONFIG)) {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index b55369357e..5e1911fba0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -777,32 +777,6 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts)
}
}
-void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp)
-{
- X86MachineState *x86ms = X86_MACHINE(ms);
- int64_t apic_id = x86_cpu_apic_id_from_index(x86ms, id);
- Error *local_err = NULL;
-
- if (id < 0) {
- error_setg(errp, "Invalid CPU id: %" PRIi64, id);
- return;
- }
-
- if (apic_id >= ACPI_CPU_HOTPLUG_ID_LIMIT) {
- error_setg(errp, "Unable to add CPU: %" PRIi64
- ", resulting APIC ID (%" PRIi64 ") is too large",
- id, apic_id);
- return;
- }
-
-
- x86_cpu_new(X86_MACHINE(ms), apic_id, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
-}
-
static
void pc_machine_done(Notifier *notifier, void *data)
{
@@ -1699,7 +1673,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
mc->auto_enable_numa_with_memdev = true;
mc->has_hotpluggable_cpus = true;
mc->default_boot_order = "cad";
- mc->hot_add_cpu = pc_hot_add_cpu;
mc->smp_parse = pc_smp_parse;
mc->block_default_type = IF_IDE;
mc->max_cpus = 255;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 6f3e78bb60..2d8413a0ce 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -752,7 +752,6 @@ static void pc_i440fx_1_4_machine_options(MachineClass *m)
{
pc_i440fx_1_5_machine_options(m);
m->hw_version = "1.4.0";
- m->hot_add_cpu = NULL;
compat_props_add(m->compat_props, pc_compat_1_4, pc_compat_1_4_len);
}
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 3106bbea33..28266a3a35 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -553,17 +553,6 @@ static HotplugHandler *s390_get_hotplug_handler(MachineState *machine,
return NULL;
}
-static void s390_hot_add_cpu(MachineState *machine,
- const int64_t id, Error **errp)
-{
- ObjectClass *oc;
-
- g_assert(machine->possible_cpus->cpus[0].cpu);
- oc = OBJECT_CLASS(CPU_GET_CLASS(machine->possible_cpus->cpus[0].cpu));
-
- s390x_new_cpu(object_class_get_name(oc), id, errp);
-}
-
static void s390_nmi(NMIState *n, int cpu_index, Error **errp)
{
CPUState *cs = qemu_get_cpu(cpu_index);
@@ -604,7 +593,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
s390mc->hpage_1m_allowed = true;
mc->init = ccw_init;
mc->reset = s390_machine_reset;
- mc->hot_add_cpu = s390_hot_add_cpu;
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
mc->no_floppy = 1;
diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c
index e8ffbbce4b..a1c689414b 100644
--- a/tests/qtest/cpu-plug-test.c
+++ b/tests/qtest/cpu-plug-test.c
@@ -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);
}
diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
index aea1384bac..94a8023173 100644
--- a/tests/qtest/test-hmp.c
+++ b/tests/qtest/test-hmp.c
@@ -27,7 +27,6 @@ static const char *hmp_cmds[] = {
"chardev-change testchardev1 ringbuf",
"chardev-remove testchardev1",
"commit all",
- "cpu-add 1",
"cpu 0",
"device_add ?",
"device_add usb-mouse,id=mouse1",
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 0cb8b01424..cc31d79177 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -284,13 +284,6 @@ The ``query-cpus`` command is replaced by the ``query-cpus-fast`` command.
The ``arch`` output member of the ``query-cpus-fast`` command is
replaced by the ``target`` output member.
-``cpu-add`` (since 4.0)
-'''''''''''''''''''''''
-
-Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
-documentation of ``query-hotpluggable-cpus`` for additional
-details.
-
``query-events`` (since 4.0)
''''''''''''''''''''''''''''
@@ -306,12 +299,6 @@ the 'wait' field, which is only applicable to sockets in server mode
Human Monitor Protocol (HMP) commands
-------------------------------------
-``cpu-add`` (since 4.0)
-'''''''''''''''''''''''
-
-Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
-documentation of ``query-hotpluggable-cpus`` for additional details.
-
``acl_show``, ``acl_reset``, ``acl_policy``, ``acl_add``, ``acl_remove`` (since 4.0.0)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -529,6 +516,12 @@ QEMU Machine Protocol (QMP) commands
The "autoload" parameter has been ignored since 2.12.0. All bitmaps
are automatically loaded from qcow2 images.
+``cpu-add`` (removed in 5.2)
+''''''''''''''''''''''''''''
+
+Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
+documentation of ``query-hotpluggable-cpus`` for additional details.
+
Human Monitor Protocol (HMP) commands
-------------------------------------
@@ -538,6 +531,12 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0
The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and
'hostfwd_remove' HMP commands has been replaced by ``netdev_id``.
+``cpu-add`` (removed in 5.2)
+''''''''''''''''''''''''''''
+
+Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
+documentation of ``query-hotpluggable-cpus`` for additional details.
+
Guest Emulator ISAs
-------------------
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 60f395c276..d1e3e0e1c6 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1761,21 +1761,6 @@ SRST
Executes a qemu-io command on the given block device.
ERST
- {
- .name = "cpu-add",
- .args_type = "id:i",
- .params = "id",
- .help = "add cpu (deprecated, use device_add instead)",
- .cmd = hmp_cpu_add,
- },
-
-SRST
-``cpu-add`` *id*
- Add CPU with id *id*. This command is deprecated, please
- +use ``device_add`` instead. For details, refer to
- 'docs/cpu-hotplug.rst'.
-ERST
-
{
.name = "qom-list",
.args_type = "path:s?",
--
MST
4 years, 3 months
[PATCH] util: fix non-null pointer parameter annotations
by Daniel P. Berrangé
An extra parameter was added to virQEMUBuildQemuImgKeySecretOpts in
commit ecfc4094d832a23fb56e1825d799c93488c168d7
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Tue Sep 15 16:30:37 2020 +0100
storage: add support for qcow2 LUKS encryption
but the non-null pointer annotations were not adjusted to take account.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/util/virqemu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virqemu.h b/src/util/virqemu.h
index be14c04d51..2b33968158 100644
--- a/src/util/virqemu.h
+++ b/src/util/virqemu.h
@@ -63,4 +63,4 @@ void virQEMUBuildQemuImgKeySecretOpts(virBufferPtr buf,
int format,
virStorageEncryptionInfoDefPtr enc,
const char *alias)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
--
2.26.2
4 years, 3 months
[PATCH] smp: drop support for deprecated (invalid topologies)
by Igor Mammedov
it's was deprecated since 3.1
Support for invalid topologies is removed, the user must ensure
that topologies described with -smp include all possible cpus,
i.e. (sockets * cores * threads) == maxcpus or QEMU will
exit with error.
Signed-off-by: Igor Mammedov <imammedo(a)redhat.com>
---
docs/system/deprecated.rst | 26 +++++++++++++-------------
hw/core/machine.c | 16 ++++------------
hw/i386/pc.c | 16 ++++------------
3 files changed, 21 insertions(+), 37 deletions(-)
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 122717cfee..d737728fab 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -47,19 +47,6 @@ The 'file' driver for drives is no longer appropriate for character or host
devices and will only accept regular files (S_IFREG). The correct driver
for these file types is 'host_cdrom' or 'host_device' as appropriate.
-``-smp`` (invalid topologies) (since 3.1)
-'''''''''''''''''''''''''''''''''''''''''
-
-CPU topology properties should describe whole machine topology including
-possible CPUs.
-
-However, historically it was possible to start QEMU with an incorrect topology
-where *n* <= *sockets* * *cores* * *threads* < *maxcpus*,
-which could lead to an incorrect topology enumeration by the guest.
-Support for invalid topologies will be removed, the user must ensure
-topologies described with -smp include all possible cpus, i.e.
-*sockets* * *cores* * *threads* = *maxcpus*.
-
``-vnc acl`` (since 4.0.0)
''''''''''''''''''''''''''
@@ -618,6 +605,19 @@ New machine versions (since 5.1) will not accept the option but it will still
work with old machine types. User can check the QAPI schema to see if the legacy
option is supported by looking at MachineInfo::numa-mem-supported property.
+``-smp`` (invalid topologies) (removed 5.2)
+'''''''''''''''''''''''''''''''''''''''''''
+
+CPU topology properties should describe whole machine topology including
+possible CPUs.
+
+However, historically it was possible to start QEMU with an incorrect topology
+where *n* <= *sockets* * *cores* * *threads* < *maxcpus*,
+which could lead to an incorrect topology enumeration by the guest.
+Support for invalid topologies is removed, the user must ensure
+topologies described with -smp include all possible cpus, i.e.
+*sockets* * *cores* * *threads* = *maxcpus*.
+
Block devices
-------------
diff --git a/hw/core/machine.c b/hw/core/machine.c
index ea26d61237..09aee4ea52 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -754,23 +754,15 @@ static void smp_parse(MachineState *ms, QemuOpts *opts)
exit(1);
}
- if (sockets * cores * threads > ms->smp.max_cpus) {
- error_report("cpu topology: "
- "sockets (%u) * cores (%u) * threads (%u) > "
- "maxcpus (%u)",
+ if (sockets * cores * threads != ms->smp.max_cpus) {
+ error_report("Invalid CPU topology: "
+ "sockets (%u) * cores (%u) * threads (%u) "
+ "!= maxcpus (%u)",
sockets, cores, threads,
ms->smp.max_cpus);
exit(1);
}
- if (sockets * cores * threads != ms->smp.max_cpus) {
- warn_report("Invalid CPU topology deprecated: "
- "sockets (%u) * cores (%u) * threads (%u) "
- "!= maxcpus (%u)",
- sockets, cores, threads,
- ms->smp.max_cpus);
- }
-
ms->smp.cpus = cpus;
ms->smp.cores = cores;
ms->smp.threads = threads;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index d071da787b..fbde6b04e6 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -746,23 +746,15 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts)
exit(1);
}
- if (sockets * dies * cores * threads > ms->smp.max_cpus) {
- error_report("cpu topology: "
- "sockets (%u) * dies (%u) * cores (%u) * threads (%u) > "
- "maxcpus (%u)",
+ if (sockets * dies * cores * threads != ms->smp.max_cpus) {
+ error_report("Invalid CPU topology deprecated: "
+ "sockets (%u) * dies (%u) * cores (%u) * threads (%u) "
+ "!= maxcpus (%u)",
sockets, dies, cores, threads,
ms->smp.max_cpus);
exit(1);
}
- if (sockets * dies * cores * threads != ms->smp.max_cpus) {
- warn_report("Invalid CPU topology deprecated: "
- "sockets (%u) * dies (%u) * cores (%u) * threads (%u) "
- "!= maxcpus (%u)",
- sockets, dies, cores, threads,
- ms->smp.max_cpus);
- }
-
ms->smp.cpus = cpus;
ms->smp.cores = cores;
ms->smp.threads = threads;
--
2.27.0
4 years, 3 months
[PATCH v3 0/6] qemu: implementation of transient disk option
by Masayoshi Mizuma
This patchset tries to implement transient option for qcow2 and raw
format disk.
It gets user available to set <transient/> to the domain xml file like as:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/guest.qcow2'/>
<target dev='vda' bus='virtio'/>
<transient/>
</disk>
Any changes which the Guest does to the disk is dropped when the Guest
is shutdowned.
There are some limitations for transient disk option so far:
- Supported disk format is qcow2 and raw
- blockdev capability is required for qemu
- Following features are blocked with transient disk option
- blockjobs
- Migration
- Disk hotplug
Masayoshi Mizuma (6):
qemu: Block blockjobs when transient disk option is enabled
qemu: Block disk hotplug when transient disk option is enabled
qemu: Block migration when transient disk option is enabled
qemu: update the validation for transient disk option
qemu: Introduce to handle transient disk
qemu: Add transient disk handler to start and stop the guest
src/qemu/qemu_domain.c | 7 +++
src/qemu/qemu_hotplug.c | 6 +++
src/qemu/qemu_migration.c | 10 ++++
src/qemu/qemu_process.c | 10 ++++
src/qemu/qemu_snapshot.c | 103 +++++++++++++++++++++++++++++++++++---
src/qemu/qemu_snapshot.h | 5 ++
src/qemu/qemu_validate.c | 25 ++++++++-
src/util/virstoragefile.c | 2 +
src/util/virstoragefile.h | 4 ++
9 files changed, 164 insertions(+), 8 deletions(-)
--
2.27.0
4 years, 3 months
[libvirt PATCH v2 0/4] storage: fully support qcow2 with LUKS volumes
by Daniel P. Berrangé
We added support for LUKS with raw volumes, but never extended it to
cover qcow2 volumes.
In v2:
- Fixed confusion of src/dst volume types
- Fixed syntax check
- Now with unit tests
Daniel P. Berrang=C3=A9 (4):
scripts: fix logic error in argv wrapping code
util: detect LUKS encryption scheme in qcow2 files
tests: remove redundant LUKS volume data files
storage: add support for qcow2 LUKS encryption
scripts/test-wrap-argv.py | 2 +-
src/storage/storage_util.c | 70 ++++++++++++++-----
src/util/virqemu.c | 23 ++++--
src/util/virqemu.h | 1 +
src/util/virstoragefile.c | 16 +++++
.../luks-convert-encrypt.argv | 18 ++---
.../luks-convert-encrypt2fileqcow2.argv | 6 +-
.../luks-convert-encrypt2fileraw.argv | 6 +-
.../qcow2-luks-convert-encrypt.argv | 18 +++++
.../qcow2-luks-convert-encrypt2fileqcow2.argv | 14 ++++
.../qcow2-luks-convert-encrypt2fileraw.argv | 13 ++++
tests/storagevolxml2argvdata/qcow2-luks.argv | 8 +++
tests/storagevolxml2argvtest.c | 23 ++++--
...ncrypt2.xml =3D> vol-qcow2-luks-convert.xml} | 20 ++++--
.../{vol-encrypt1.xml =3D> vol-qcow2-luks.xml} | 18 +++--
tests/storagevolxml2xmlout/vol-qcow2-luks.xml | 31 ++++++++
tests/storagevolxml2xmltest.c | 1 +
17 files changed, 237 insertions(+), 51 deletions(-)
create mode 100644 tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.a=
rgv
create mode 100644 tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2f=
ileqcow2.argv
create mode 100644 tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2f=
ileraw.argv
create mode 100644 tests/storagevolxml2argvdata/qcow2-luks.argv
rename tests/storagevolxml2xmlin/{vol-encrypt2.xml =3D> vol-qcow2-luks-conve=
rt.xml} (50%)
rename tests/storagevolxml2xmlin/{vol-encrypt1.xml =3D> vol-qcow2-luks.xml} =
(52%)
create mode 100644 tests/storagevolxml2xmlout/vol-qcow2-luks.xml
--=20
2.26.2
4 years, 3 months
[PATCH] Modify virCPUarmCompare to perform compare actions
by Zhenyu Zheng
Modify virCPUarmCompare in cpu_arm.c to perform
actual compare actions. Compare host cpu vendor
and model info with guest cpu as initial implementation,
as most ARM clouds uses host-passthrogh mode.
Signed-off-by: Zhenyu Zheng <zheng.zhenyu(a)outlook.com>
---
src/cpu/cpu_arm.c | 188 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 184 insertions(+), 4 deletions(-)
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index 374a4d6f6c..98c5e551f5 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -118,6 +118,36 @@ virCPUarmMapNew(void)
return map;
}
+static int
+virCPUarmDataCopy(virCPUarmData *dst, const virCPUarmData *src)
+{
+ if (VIR_ALLOC(dst->features) < 0)
+ return -1;
+
+ dst->pvr = src->pvr;
+ dst->vendor_id = src->vendor_id;
+ dst->features = src->features;
+
+ return 0;
+}
+
+static virCPUDataPtr
+virCPUarmMakeCPUData(virArch arch,
+ virCPUarmData *data)
+{
+ virCPUDataPtr cpuData;
+
+ if (VIR_ALLOC(cpuData) < 0)
+ return NULL;
+
+ cpuData->arch = arch;
+
+ if (virCPUarmDataCopy(&cpuData->data.arm, data) < 0)
+ VIR_FREE(cpuData);
+
+ return cpuData;
+}
+
static void
virCPUarmDataClear(virCPUarmData *data)
{
@@ -376,6 +406,42 @@ virCPUarmModelParse(xmlXPathContextPtr ctxt,
return 0;
}
+static virCPUarmModelPtr
+virCPUarmModelCopy(virCPUarmModelPtr model)
+{
+ virCPUarmModelPtr copy;
+
+ copy = g_new0(virCPUarmModel, 1);
+ copy->name = g_strdup(model->name);
+ virCPUarmDataCopy(©->data, &model->data);
+ copy->vendor = model->vendor;
+
+ return g_steal_pointer(©);
+}
+
+static virCPUarmModelPtr
+virCPUarmModelFromCPU(const virCPUDef *cpu,
+ virCPUarmMapPtr map)
+{
+ g_autoptr(virCPUarmModel) model = NULL;
+
+ if (!cpu->model) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("no CPU model specified"));
+ return NULL;
+ }
+
+ if (!(model = virCPUarmModelFind(map, cpu->model))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU model %s"), cpu->model);
+ return NULL;
+ }
+
+ model = virCPUarmModelCopy(model);
+
+ return g_steal_pointer(&model);
+}
+
static virCPUarmMapPtr
virCPUarmLoadMap(void)
{
@@ -463,11 +529,125 @@ virCPUarmBaseline(virCPUDefPtr *cpus,
}
static virCPUCompareResult
-virCPUarmCompare(virCPUDefPtr host G_GNUC_UNUSED,
- virCPUDefPtr cpu G_GNUC_UNUSED,
- bool failMessages G_GNUC_UNUSED)
+armCompute(virCPUDefPtr host,
+ virCPUDefPtr cpu,
+ virCPUDataPtr *guestData,
+ char **message)
{
- return VIR_CPU_COMPARE_IDENTICAL;
+ virCPUarmMapPtr map = NULL;
+ virCPUarmModelPtr host_model = NULL;
+ virCPUarmModelPtr guest_model = NULL;
+ virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR;
+ virArch arch;
+ size_t i;
+
+ if (cpu->arch != VIR_ARCH_NONE) {
+ bool found = false;
+
+ for (i = 0; i < G_N_ELEMENTS(archs); i++) {
+ if (archs[i] == cpu->arch) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ VIR_DEBUG("CPU arch %s does not match host arch",
+ virArchToString(cpu->arch));
+ if (message)
+ *message = g_strdup_printf(_("CPU arch %s does not match host arch"),
+ virArchToString(cpu->arch));
+
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
+ }
+ arch = cpu->arch;
+ } else {
+ arch = host->arch;
+ }
+
+ if (cpu->vendor &&
+ (!host->vendor || STRNEQ(cpu->vendor, host->vendor))) {
+ VIR_DEBUG("host CPU vendor does not match required CPU vendor %s",
+ cpu->vendor);
+ if (message) {
+ *message = g_strdup_printf(_("host CPU vendor does not match required "
+ "CPU vendor %s"),
+ cpu->vendor);
+ }
+
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
+ }
+
+ if (!(map = virCPUarmLoadMap()))
+ goto cleanup;
+
+ /* Host CPU information */
+ if (!(host_model = virCPUarmModelFromCPU(host, map)))
+ goto cleanup;
+
+ /* Guest CPU information */
+ if (!(guest_model = virCPUarmModelFromCPU(cpu, map)))
+ goto cleanup;
+
+ if (STRNEQ(guest_model->name, host_model->name)) {
+ VIR_DEBUG("host CPU model does not match required CPU model %s",
+ guest_model->name);
+ if (message) {
+ *message = g_strdup_printf(_("host CPU model does not match required "
+ "CPU model %s"),
+ guest_model->name);
+ }
+
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
+ }
+
+ if (guestData)
+ if (!(*guestData = virCPUarmMakeCPUData(arch, &guest_model->data)))
+ goto cleanup;
+
+ ret = VIR_CPU_COMPARE_IDENTICAL;
+
+ cleanup:
+ virCPUarmModelFree(host_model);
+ virCPUarmModelFree(guest_model);
+ return ret;
+}
+
+static virCPUCompareResult
+virCPUarmCompare(virCPUDefPtr host,
+ virCPUDefPtr cpu,
+ bool failIncompatible)
+{
+ virCPUCompareResult ret;
+ char *message = NULL;
+
+ if (!host || !host->model) {
+ if (failIncompatible) {
+ virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s",
+ _("unknown host CPU"));
+ } else {
+ VIR_WARN("unknown host CPU");
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+ return -1;
+ }
+
+ ret = armCompute(host, cpu, NULL, &message);
+
+ if (failIncompatible && ret == VIR_CPU_COMPARE_INCOMPATIBLE) {
+ ret = VIR_CPU_COMPARE_ERROR;
+ if (message) {
+ virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", message);
+ } else {
+ virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL);
+ }
+ }
+ VIR_FREE(message);
+
+ return ret;
}
static int
--
2.20.1
4 years, 3 months
[PULL v2 13/15] cphp: remove deprecated cpu-add command(s)
by Michael S. Tsirkin
From: Igor Mammedov <imammedo(a)redhat.com>
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(a)redhat.com>
Reviewed-by: Thomas Huth <thuth(a)redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert(a)redhat.com>
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Acked-by: Cornelia Huck <cohuck(a)redhat.com>
Message-Id: <20200915120403.1074579-1-imammedo(a)redhat.com>
Reviewed-by: Michael S. Tsirkin <mst(a)redhat.com>
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
---
qapi/machine.json | 24 ---------
include/hw/boards.h | 1 -
include/hw/i386/pc.h | 1 -
include/monitor/hmp.h | 1 -
hw/core/machine-hmp-cmds.c | 12 -----
hw/core/machine-qmp-cmds.c | 12 -----
hw/i386/pc.c | 27 ----------
hw/i386/pc_piix.c | 1 -
hw/s390x/s390-virtio-ccw.c | 12 -----
tests/qtest/cpu-plug-test.c | 100 ++++--------------------------------
tests/qtest/test-hmp.c | 1 -
docs/system/deprecated.rst | 25 +++++----
hmp-commands.hx | 15 ------
13 files changed, 21 insertions(+), 211 deletions(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index 0ac1880e4a..d8ed096e9a 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -307,30 +307,6 @@
##
{ 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
-##
-# @cpu-add:
-#
-# Adds CPU with specified ID.
-#
-# @id: ID of CPU to be created, valid values [0..max_cpus)
-#
-# Features:
-# @deprecated: This command is deprecated. Use `device_add` instead.
-# See the `query-hotpluggable-cpus` command for details.
-#
-# Returns: Nothing on success
-#
-# Since: 1.5
-#
-# Example:
-#
-# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'cpu-add', 'data': {'id': 'int'},
- 'features': [ 'deprecated' ] }
-
##
# @MachineInfo:
#
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 795910d01b..7abd5d889c 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -169,7 +169,6 @@ struct MachineClass {
void (*init)(MachineState *state);
void (*reset)(MachineState *state);
void (*wakeup)(MachineState *state);
- void (*hot_add_cpu)(MachineState *state, const int64_t id, Error **errp);
int (*kvm_type)(MachineState *machine, const char *arg);
void (*smp_parse)(MachineState *ms, QemuOpts *opts);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index c14e14dfe0..be42fe3599 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -134,7 +134,6 @@ extern int fd_bootchk;
void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
-void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp);
void pc_smp_parse(MachineState *ms, QemuOpts *opts);
void pc_guest_info_init(PCMachineState *pcms);
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index c986cfd28b..642e9e91f9 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -89,7 +89,6 @@ void hmp_chardev_add(Monitor *mon, const QDict *qdict);
void hmp_chardev_change(Monitor *mon, const QDict *qdict);
void hmp_chardev_remove(Monitor *mon, const QDict *qdict);
void hmp_chardev_send_break(Monitor *mon, const QDict *qdict);
-void hmp_cpu_add(Monitor *mon, const QDict *qdict);
void hmp_object_add(Monitor *mon, const QDict *qdict);
void hmp_object_del(Monitor *mon, const QDict *qdict);
void hmp_info_memdev(Monitor *mon, const QDict *qdict);
diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index 39999c47c5..f4092b98cc 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -46,18 +46,6 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
qapi_free_CpuInfoFastList(cpu_list);
}
-void hmp_cpu_add(Monitor *mon, const QDict *qdict)
-{
- int cpuid;
- Error *err = NULL;
-
- error_report("cpu_add is deprecated, please use device_add instead");
-
- cpuid = qdict_get_int(qdict, "id");
- qmp_cpu_add(cpuid, &err);
- hmp_handle_error(mon, err);
-}
-
void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 21551221ad..5362c80a18 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -284,18 +284,6 @@ HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
return machine_query_hotpluggable_cpus(ms);
}
-void qmp_cpu_add(int64_t id, Error **errp)
-{
- MachineClass *mc;
-
- mc = MACHINE_GET_CLASS(current_machine);
- if (mc->hot_add_cpu) {
- mc->hot_add_cpu(current_machine, id, errp);
- } else {
- error_setg(errp, "Not supported");
- }
-}
-
void qmp_set_numa_node(NumaOptions *cmd, Error **errp)
{
if (!runstate_check(RUN_STATE_PRECONFIG)) {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index b55369357e..5e1911fba0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -777,32 +777,6 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts)
}
}
-void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp)
-{
- X86MachineState *x86ms = X86_MACHINE(ms);
- int64_t apic_id = x86_cpu_apic_id_from_index(x86ms, id);
- Error *local_err = NULL;
-
- if (id < 0) {
- error_setg(errp, "Invalid CPU id: %" PRIi64, id);
- return;
- }
-
- if (apic_id >= ACPI_CPU_HOTPLUG_ID_LIMIT) {
- error_setg(errp, "Unable to add CPU: %" PRIi64
- ", resulting APIC ID (%" PRIi64 ") is too large",
- id, apic_id);
- return;
- }
-
-
- x86_cpu_new(X86_MACHINE(ms), apic_id, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
-}
-
static
void pc_machine_done(Notifier *notifier, void *data)
{
@@ -1699,7 +1673,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
mc->auto_enable_numa_with_memdev = true;
mc->has_hotpluggable_cpus = true;
mc->default_boot_order = "cad";
- mc->hot_add_cpu = pc_hot_add_cpu;
mc->smp_parse = pc_smp_parse;
mc->block_default_type = IF_IDE;
mc->max_cpus = 255;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 6f3e78bb60..2d8413a0ce 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -752,7 +752,6 @@ static void pc_i440fx_1_4_machine_options(MachineClass *m)
{
pc_i440fx_1_5_machine_options(m);
m->hw_version = "1.4.0";
- m->hot_add_cpu = NULL;
compat_props_add(m->compat_props, pc_compat_1_4, pc_compat_1_4_len);
}
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 3106bbea33..28266a3a35 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -553,17 +553,6 @@ static HotplugHandler *s390_get_hotplug_handler(MachineState *machine,
return NULL;
}
-static void s390_hot_add_cpu(MachineState *machine,
- const int64_t id, Error **errp)
-{
- ObjectClass *oc;
-
- g_assert(machine->possible_cpus->cpus[0].cpu);
- oc = OBJECT_CLASS(CPU_GET_CLASS(machine->possible_cpus->cpus[0].cpu));
-
- s390x_new_cpu(object_class_get_name(oc), id, errp);
-}
-
static void s390_nmi(NMIState *n, int cpu_index, Error **errp)
{
CPUState *cs = qemu_get_cpu(cpu_index);
@@ -604,7 +593,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
s390mc->hpage_1m_allowed = true;
mc->init = ccw_init;
mc->reset = s390_machine_reset;
- mc->hot_add_cpu = s390_hot_add_cpu;
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
mc->no_floppy = 1;
diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c
index e8ffbbce4b..a1c689414b 100644
--- a/tests/qtest/cpu-plug-test.c
+++ b/tests/qtest/cpu-plug-test.c
@@ -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);
}
diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
index aea1384bac..94a8023173 100644
--- a/tests/qtest/test-hmp.c
+++ b/tests/qtest/test-hmp.c
@@ -27,7 +27,6 @@ static const char *hmp_cmds[] = {
"chardev-change testchardev1 ringbuf",
"chardev-remove testchardev1",
"commit all",
- "cpu-add 1",
"cpu 0",
"device_add ?",
"device_add usb-mouse,id=mouse1",
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 0cb8b01424..cc31d79177 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -284,13 +284,6 @@ The ``query-cpus`` command is replaced by the ``query-cpus-fast`` command.
The ``arch`` output member of the ``query-cpus-fast`` command is
replaced by the ``target`` output member.
-``cpu-add`` (since 4.0)
-'''''''''''''''''''''''
-
-Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
-documentation of ``query-hotpluggable-cpus`` for additional
-details.
-
``query-events`` (since 4.0)
''''''''''''''''''''''''''''
@@ -306,12 +299,6 @@ the 'wait' field, which is only applicable to sockets in server mode
Human Monitor Protocol (HMP) commands
-------------------------------------
-``cpu-add`` (since 4.0)
-'''''''''''''''''''''''
-
-Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
-documentation of ``query-hotpluggable-cpus`` for additional details.
-
``acl_show``, ``acl_reset``, ``acl_policy``, ``acl_add``, ``acl_remove`` (since 4.0.0)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -529,6 +516,12 @@ QEMU Machine Protocol (QMP) commands
The "autoload" parameter has been ignored since 2.12.0. All bitmaps
are automatically loaded from qcow2 images.
+``cpu-add`` (removed in 5.2)
+''''''''''''''''''''''''''''
+
+Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
+documentation of ``query-hotpluggable-cpus`` for additional details.
+
Human Monitor Protocol (HMP) commands
-------------------------------------
@@ -538,6 +531,12 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0
The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and
'hostfwd_remove' HMP commands has been replaced by ``netdev_id``.
+``cpu-add`` (removed in 5.2)
+''''''''''''''''''''''''''''
+
+Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
+documentation of ``query-hotpluggable-cpus`` for additional details.
+
Guest Emulator ISAs
-------------------
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 60f395c276..d1e3e0e1c6 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1761,21 +1761,6 @@ SRST
Executes a qemu-io command on the given block device.
ERST
- {
- .name = "cpu-add",
- .args_type = "id:i",
- .params = "id",
- .help = "add cpu (deprecated, use device_add instead)",
- .cmd = hmp_cpu_add,
- },
-
-SRST
-``cpu-add`` *id*
- Add CPU with id *id*. This command is deprecated, please
- +use ``device_add`` instead. For details, refer to
- 'docs/cpu-hotplug.rst'.
-ERST
-
{
.name = "qom-list",
.args_type = "path:s?",
--
MST
4 years, 3 months
[PULL 13/15] cphp: remove deprecated cpu-add command(s)
by Michael S. Tsirkin
From: Igor Mammedov <imammedo(a)redhat.com>
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(a)redhat.com>
Reviewed-by: Thomas Huth <thuth(a)redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert(a)redhat.com>
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Acked-by: Cornelia Huck <cohuck(a)redhat.com>
Message-Id: <20200915120403.1074579-1-imammedo(a)redhat.com>
Reviewed-by: Michael S. Tsirkin <mst(a)redhat.com>
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
---
qapi/machine.json | 24 ---------
include/hw/boards.h | 1 -
include/hw/i386/pc.h | 1 -
include/monitor/hmp.h | 1 -
hw/core/machine-hmp-cmds.c | 12 -----
hw/core/machine-qmp-cmds.c | 12 -----
hw/i386/pc.c | 27 ----------
hw/i386/pc_piix.c | 1 -
hw/s390x/s390-virtio-ccw.c | 12 -----
tests/qtest/cpu-plug-test.c | 100 ++++--------------------------------
tests/qtest/test-hmp.c | 1 -
docs/system/deprecated.rst | 25 +++++----
hmp-commands.hx | 15 ------
13 files changed, 21 insertions(+), 211 deletions(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index 0ac1880e4a..d8ed096e9a 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -307,30 +307,6 @@
##
{ 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
-##
-# @cpu-add:
-#
-# Adds CPU with specified ID.
-#
-# @id: ID of CPU to be created, valid values [0..max_cpus)
-#
-# Features:
-# @deprecated: This command is deprecated. Use `device_add` instead.
-# See the `query-hotpluggable-cpus` command for details.
-#
-# Returns: Nothing on success
-#
-# Since: 1.5
-#
-# Example:
-#
-# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'cpu-add', 'data': {'id': 'int'},
- 'features': [ 'deprecated' ] }
-
##
# @MachineInfo:
#
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 795910d01b..7abd5d889c 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -169,7 +169,6 @@ struct MachineClass {
void (*init)(MachineState *state);
void (*reset)(MachineState *state);
void (*wakeup)(MachineState *state);
- void (*hot_add_cpu)(MachineState *state, const int64_t id, Error **errp);
int (*kvm_type)(MachineState *machine, const char *arg);
void (*smp_parse)(MachineState *ms, QemuOpts *opts);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 421a77acc2..79b7ab17bc 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -135,7 +135,6 @@ extern int fd_bootchk;
void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
-void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp);
void pc_smp_parse(MachineState *ms, QemuOpts *opts);
void pc_guest_info_init(PCMachineState *pcms);
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index c986cfd28b..642e9e91f9 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -89,7 +89,6 @@ void hmp_chardev_add(Monitor *mon, const QDict *qdict);
void hmp_chardev_change(Monitor *mon, const QDict *qdict);
void hmp_chardev_remove(Monitor *mon, const QDict *qdict);
void hmp_chardev_send_break(Monitor *mon, const QDict *qdict);
-void hmp_cpu_add(Monitor *mon, const QDict *qdict);
void hmp_object_add(Monitor *mon, const QDict *qdict);
void hmp_object_del(Monitor *mon, const QDict *qdict);
void hmp_info_memdev(Monitor *mon, const QDict *qdict);
diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index 39999c47c5..f4092b98cc 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -46,18 +46,6 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
qapi_free_CpuInfoFastList(cpu_list);
}
-void hmp_cpu_add(Monitor *mon, const QDict *qdict)
-{
- int cpuid;
- Error *err = NULL;
-
- error_report("cpu_add is deprecated, please use device_add instead");
-
- cpuid = qdict_get_int(qdict, "id");
- qmp_cpu_add(cpuid, &err);
- hmp_handle_error(mon, err);
-}
-
void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 21551221ad..5362c80a18 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -284,18 +284,6 @@ HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
return machine_query_hotpluggable_cpus(ms);
}
-void qmp_cpu_add(int64_t id, Error **errp)
-{
- MachineClass *mc;
-
- mc = MACHINE_GET_CLASS(current_machine);
- if (mc->hot_add_cpu) {
- mc->hot_add_cpu(current_machine, id, errp);
- } else {
- error_setg(errp, "Not supported");
- }
-}
-
void qmp_set_numa_node(NumaOptions *cmd, Error **errp)
{
if (!runstate_check(RUN_STATE_PRECONFIG)) {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index d11daacc23..d071da787b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -777,32 +777,6 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts)
}
}
-void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp)
-{
- X86MachineState *x86ms = X86_MACHINE(ms);
- int64_t apic_id = x86_cpu_apic_id_from_index(x86ms, id);
- Error *local_err = NULL;
-
- if (id < 0) {
- error_setg(errp, "Invalid CPU id: %" PRIi64, id);
- return;
- }
-
- if (apic_id >= ACPI_CPU_HOTPLUG_ID_LIMIT) {
- error_setg(errp, "Unable to add CPU: %" PRIi64
- ", resulting APIC ID (%" PRIi64 ") is too large",
- id, apic_id);
- return;
- }
-
-
- x86_cpu_new(X86_MACHINE(ms), apic_id, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
-}
-
static void rtc_set_cpus_count(ISADevice *rtc, uint16_t cpus_count)
{
if (cpus_count > 0xff) {
@@ -1966,7 +1940,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
mc->auto_enable_numa_with_memdev = true;
mc->has_hotpluggable_cpus = true;
mc->default_boot_order = "cad";
- mc->hot_add_cpu = pc_hot_add_cpu;
mc->smp_parse = pc_smp_parse;
mc->block_default_type = IF_IDE;
mc->max_cpus = 255;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 33fa035fb7..8ce7dda464 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -752,7 +752,6 @@ static void pc_i440fx_1_4_machine_options(MachineClass *m)
{
pc_i440fx_1_5_machine_options(m);
m->hw_version = "1.4.0";
- m->hot_add_cpu = NULL;
compat_props_add(m->compat_props, pc_compat_1_4, pc_compat_1_4_len);
}
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 3106bbea33..28266a3a35 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -553,17 +553,6 @@ static HotplugHandler *s390_get_hotplug_handler(MachineState *machine,
return NULL;
}
-static void s390_hot_add_cpu(MachineState *machine,
- const int64_t id, Error **errp)
-{
- ObjectClass *oc;
-
- g_assert(machine->possible_cpus->cpus[0].cpu);
- oc = OBJECT_CLASS(CPU_GET_CLASS(machine->possible_cpus->cpus[0].cpu));
-
- s390x_new_cpu(object_class_get_name(oc), id, errp);
-}
-
static void s390_nmi(NMIState *n, int cpu_index, Error **errp)
{
CPUState *cs = qemu_get_cpu(cpu_index);
@@ -604,7 +593,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
s390mc->hpage_1m_allowed = true;
mc->init = ccw_init;
mc->reset = s390_machine_reset;
- mc->hot_add_cpu = s390_hot_add_cpu;
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
mc->no_floppy = 1;
diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c
index e8ffbbce4b..a1c689414b 100644
--- a/tests/qtest/cpu-plug-test.c
+++ b/tests/qtest/cpu-plug-test.c
@@ -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);
}
diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
index aea1384bac..94a8023173 100644
--- a/tests/qtest/test-hmp.c
+++ b/tests/qtest/test-hmp.c
@@ -27,7 +27,6 @@ static const char *hmp_cmds[] = {
"chardev-change testchardev1 ringbuf",
"chardev-remove testchardev1",
"commit all",
- "cpu-add 1",
"cpu 0",
"device_add ?",
"device_add usb-mouse,id=mouse1",
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 0cb8b01424..cc31d79177 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -284,13 +284,6 @@ The ``query-cpus`` command is replaced by the ``query-cpus-fast`` command.
The ``arch`` output member of the ``query-cpus-fast`` command is
replaced by the ``target`` output member.
-``cpu-add`` (since 4.0)
-'''''''''''''''''''''''
-
-Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
-documentation of ``query-hotpluggable-cpus`` for additional
-details.
-
``query-events`` (since 4.0)
''''''''''''''''''''''''''''
@@ -306,12 +299,6 @@ the 'wait' field, which is only applicable to sockets in server mode
Human Monitor Protocol (HMP) commands
-------------------------------------
-``cpu-add`` (since 4.0)
-'''''''''''''''''''''''
-
-Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
-documentation of ``query-hotpluggable-cpus`` for additional details.
-
``acl_show``, ``acl_reset``, ``acl_policy``, ``acl_add``, ``acl_remove`` (since 4.0.0)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -529,6 +516,12 @@ QEMU Machine Protocol (QMP) commands
The "autoload" parameter has been ignored since 2.12.0. All bitmaps
are automatically loaded from qcow2 images.
+``cpu-add`` (removed in 5.2)
+''''''''''''''''''''''''''''
+
+Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
+documentation of ``query-hotpluggable-cpus`` for additional details.
+
Human Monitor Protocol (HMP) commands
-------------------------------------
@@ -538,6 +531,12 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0
The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and
'hostfwd_remove' HMP commands has been replaced by ``netdev_id``.
+``cpu-add`` (removed in 5.2)
+''''''''''''''''''''''''''''
+
+Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
+documentation of ``query-hotpluggable-cpus`` for additional details.
+
Guest Emulator ISAs
-------------------
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 60f395c276..d1e3e0e1c6 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1761,21 +1761,6 @@ SRST
Executes a qemu-io command on the given block device.
ERST
- {
- .name = "cpu-add",
- .args_type = "id:i",
- .params = "id",
- .help = "add cpu (deprecated, use device_add instead)",
- .cmd = hmp_cpu_add,
- },
-
-SRST
-``cpu-add`` *id*
- Add CPU with id *id*. This command is deprecated, please
- +use ``device_add`` instead. For details, refer to
- 'docs/cpu-hotplug.rst'.
-ERST
-
{
.name = "qom-list",
.args_type = "path:s?",
--
MST
4 years, 3 months