* [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug
@ 2018-10-30 12:35 Kashyap Chamarthy
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add` Kashyap Chamarthy
` (4 more replies)
0 siblings, 5 replies; 16+ messages in thread
From: Kashyap Chamarthy @ 2018-10-30 12:35 UTC (permalink / raw)
To: qemu-devel; +Cc: eblake, armbru, ehabkost, imammedo, thuth, Kashyap Chamarthy
The first patch deprecates the QMP `cpu-add`, the second its HMP
equivalent, and the third documents vCPU hotplug procedure using QMP
`device_add` et al.
v2: https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03191.html
Kashyap Chamarthy (3):
Deprecate QMP `cpu-add`
Deprecate HMP `cpu-add`
docs: Document vCPU hotplug procedure
docs/cpu-hotplug.rst | 142 +++++++++++++++++++++++++++++++++++++++++++
hmp-commands.hx | 6 +-
hmp.c | 2 +
qapi/misc.json | 8 ++-
qemu-deprecated.texi | 5 ++
5 files changed, 160 insertions(+), 3 deletions(-)
create mode 100644 docs/cpu-hotplug.rst
--
2.17.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add`
2018-10-30 12:35 [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
@ 2018-10-30 12:35 ` Kashyap Chamarthy
2018-11-05 11:11 ` Thomas Huth
2018-12-13 6:38 ` Thomas Huth
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add` Kashyap Chamarthy
` (3 subsequent siblings)
4 siblings, 2 replies; 16+ messages in thread
From: Kashyap Chamarthy @ 2018-10-30 12:35 UTC (permalink / raw)
To: qemu-devel; +Cc: eblake, armbru, ehabkost, imammedo, thuth, Kashyap Chamarthy
The intended functionality of QMP `cpu-add` is replaced with
`device_add` (and `query-hotpluggable-cpus`). So let's deprecate
`cpu-add`.
A complete example of vCPU hotplug with the recommended way (using
`device_add`) is provided as part of a seperate docs patch.
Suggested-by: Eduardo Habkost <ehabkost@redhat.com
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
---
---
qapi/misc.json | 8 +++++++-
qemu-deprecated.texi | 5 +++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/qapi/misc.json b/qapi/misc.json
index d450cfef21..fbee1e6d34 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -1104,7 +1104,7 @@
##
# @cpu-add:
#
-# Adds CPU with specified ID
+# Adds CPU with specified ID.
#
# @id: ID of CPU to be created, valid values [0..max_cpus)
#
@@ -1112,6 +1112,10 @@
#
# Since: 1.5
#
+# Note: This command is deprecated. The `device_add` command should be
+# used instead. See the `query-hotpluggable-cpus` command for
+# details.
+#
# Example:
#
# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
@@ -3213,6 +3217,8 @@
##
# @query-hotpluggable-cpus:
#
+# TODO: Better documentation; currently there is none.
+#
# Returns: a list of HotpluggableCPU objects.
#
# Since: 2.7
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 1b9c007f12..c86924ad9a 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -155,6 +155,11 @@ 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.
+@subsection cpu-add (since 3.1)
+
+Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See
+documentation of ``query-hotpluggable-cpus'' for additional details.
+
@section System emulator devices
@subsection ivshmem (since 2.6.0)
--
2.17.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add`
2018-10-30 12:35 [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add` Kashyap Chamarthy
@ 2018-10-30 12:35 ` Kashyap Chamarthy
2018-10-31 15:14 ` Markus Armbruster
2018-11-05 11:20 ` Thomas Huth
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 3/3] docs: Document vCPU hotplug procedure Kashyap Chamarthy
` (2 subsequent siblings)
4 siblings, 2 replies; 16+ messages in thread
From: Kashyap Chamarthy @ 2018-10-30 12:35 UTC (permalink / raw)
To: qemu-devel; +Cc: eblake, armbru, ehabkost, imammedo, thuth, Kashyap Chamarthy
Since we're deprecating the QMP `cpu-add`, let's deprecate its HMP
equivalent, too.
Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
---
hmp-commands.hx | 6 ++++--
hmp.c | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index db0c681f74..ba71558c25 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1849,14 +1849,16 @@ ETEXI
.name = "cpu-add",
.args_type = "id:i",
.params = "id",
- .help = "add cpu",
+ .help = "add cpu (deprecated, use device_add instead)",
.cmd = hmp_cpu_add,
},
STEXI
@item cpu-add @var{id}
@findex cpu-add
-Add CPU with id @var{id}
+Add CPU with id @var{id}. This command is deprecated, please
++use @code{device_add} instead. For details, refer to
+'docs/cpu-hotplug.rst'.
ETEXI
{
diff --git a/hmp.c b/hmp.c
index 4975fa56b0..c3f3db7795 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2353,6 +2353,8 @@ 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);
--
2.17.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH v3 3/3] docs: Document vCPU hotplug procedure
2018-10-30 12:35 [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add` Kashyap Chamarthy
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add` Kashyap Chamarthy
@ 2018-10-30 12:35 ` Kashyap Chamarthy
2018-10-30 13:00 ` [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
2018-10-31 15:17 ` Markus Armbruster
4 siblings, 0 replies; 16+ messages in thread
From: Kashyap Chamarthy @ 2018-10-30 12:35 UTC (permalink / raw)
To: qemu-devel; +Cc: eblake, armbru, ehabkost, imammedo, thuth, Kashyap Chamarthy
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
---
docs/cpu-hotplug.rst | 142 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 142 insertions(+)
create mode 100644 docs/cpu-hotplug.rst
diff --git a/docs/cpu-hotplug.rst b/docs/cpu-hotplug.rst
new file mode 100644
index 0000000000..1c268e00b4
--- /dev/null
+++ b/docs/cpu-hotplug.rst
@@ -0,0 +1,142 @@
+===================
+Virtual CPU hotplug
+===================
+
+A complete example of vCPU hotplug (and hot-unplug) using QMP
+``device_add`` and ``device_del``.
+
+vCPU hotplug
+------------
+
+(1) Launch QEMU as follows (note that the "maxcpus" is mandatory to
+ allow vCPU hotplug)::
+
+ $ qemu-system-x86_64 -display none -no-user-config -m 2048 \
+ -nodefaults -monitor stdio -machine pc,accel=kvm,usb=off \
+ -smp 1,maxcpus=2 -cpu IvyBridge-IBRS \
+ -qmp unix:/tmp/qmp-sock,server,nowait
+
+(2) Run 'qmp-shell' (located in the source tree, under: "scripts/qmp/)
+ to connect to the just-launched QEMU::
+
+ $> ./qmp-shell -p -v /tmp/qmp-sock
+ [...]
+ (QEMU)
+
+(3) Find out which CPU types could be plugged, and into which sockets::
+
+ (QEMU) query-hotpluggable-cpus
+ {
+ "execute": "query-hotpluggable-cpus",
+ "arguments": {}
+ }
+ {
+ "return": [
+ {
+ "type": "IvyBridge-IBRS-x86_64-cpu",
+ "vcpus-count": 1,
+ "props": {
+ "socket-id": 1,
+ "core-id": 0,
+ "thread-id": 0
+ }
+ },
+ {
+ "qom-path": "/machine/unattached/device[0]",
+ "type": "IvyBridge-IBRS-x86_64-cpu",
+ "vcpus-count": 1,
+ "props": {
+ "socket-id": 0,
+ "core-id": 0,
+ "thread-id": 0
+ }
+ }
+ ]
+ }
+ (QEMU)
+
+(4) The ``query-hotpluggable-cpus`` command returns an object for CPUs
+ that are present (containing a "qom-path" member) or which may be
+ hot-plugged (no "qom-path" member). From its output in step (3), we
+ can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0,
+ while hot-plugging a CPU into socket 1 requires passing the listed
+ properties to QMP ``device_add``:
+
+ (QEMU) device_add id=cpu-2 driver=IvyBridge-IBRS-x86_64-cpu socket-id=1 core-id=0 thread-id=0
+ {
+ "execute": "device_add",
+ "arguments": {
+ "socket-id": 1,
+ "driver": "IvyBridge-IBRS-x86_64-cpu",
+ "id": "cpu-2",
+ "core-id": 0,
+ "thread-id": 0
+ }
+ }
+ {
+ "return": {}
+ }
+ (QEMU)
+
+(5) Optionally, run QMP `query-cpus-fast` for some details about the
+ vCPUs::
+
+ (QEMU) query-cpus-fast
+ {
+ "execute": "query-cpus-fast",
+ "arguments": {}
+ }
+ {
+ "return": [
+ {
+ "qom-path": "/machine/unattached/device[0]",
+ "target": "x86_64",
+ "thread-id": 11534,
+ "cpu-index": 0,
+ "props": {
+ "socket-id": 0,
+ "core-id": 0,
+ "thread-id": 0
+ },
+ "arch": "x86"
+ },
+ {
+ "qom-path": "/machine/peripheral/cpu-2",
+ "target": "x86_64",
+ "thread-id": 12106,
+ "cpu-index": 1,
+ "props": {
+ "socket-id": 1,
+ "core-id": 0,
+ "thread-id": 0
+ },
+ "arch": "x86"
+ }
+ ]
+ }
+ (QEMU)
+
+vCPU hot-unplug
+---------------
+
+From the 'qmp-shell', invoke the QMP ``device_del`` command::
+
+ (QEMU) device_del id=cpu-2
+ {
+ "execute": "device_del",
+ "arguments": {
+ "id": "cpu-2"
+ }
+ }
+ {
+ "return": {}
+ }
+ (QEMU)
+
+.. note::
+ vCPU hot-unplug requires guest cooperation; so the ``device_del``
+ command above does not guarantee vCPU removal -- it's a "request to
+ unplug". At this point, the guest will get a System Control
+ Interupt (SCI) and calls the ACPI handler for the affected vCPU
+ device. Then the guest kernel will bring the vCPU offline and tell
+ QEMU to unplug it.
--
2.17.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug
2018-10-30 12:35 [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
` (2 preceding siblings ...)
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 3/3] docs: Document vCPU hotplug procedure Kashyap Chamarthy
@ 2018-10-30 13:00 ` Kashyap Chamarthy
2018-10-30 15:56 ` Michal Privoznik
2018-10-31 15:17 ` Markus Armbruster
4 siblings, 1 reply; 16+ messages in thread
From: Kashyap Chamarthy @ 2018-10-30 13:00 UTC (permalink / raw)
To: qemu-devel; +Cc: eblake, armbru, ehabkost, imammedo, thuth, libvir-list
[Cc: libvir-list]
On Tue, Oct 30, 2018 at 01:35:23PM +0100, Kashyap Chamarthy wrote:
> The first patch deprecates the QMP `cpu-add`, the second its HMP
> equivalent, and the third documents vCPU hotplug procedure using QMP
> `device_add` et al.
>
> v2: https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03191.html
>
> Kashyap Chamarthy (3):
> Deprecate QMP `cpu-add`
> Deprecate HMP `cpu-add`
> docs: Document vCPU hotplug procedure
>
> docs/cpu-hotplug.rst | 142 +++++++++++++++++++++++++++++++++++++++++++
> hmp-commands.hx | 6 +-
> hmp.c | 2 +
> qapi/misc.json | 8 ++-
> qemu-deprecated.texi | 5 ++
> 5 files changed, 160 insertions(+), 3 deletions(-)
> create mode 100644 docs/cpu-hotplug.rst
>
> --
> 2.17.1
>
--
/kashyap
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug
2018-10-30 13:00 ` [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
@ 2018-10-30 15:56 ` Michal Privoznik
0 siblings, 0 replies; 16+ messages in thread
From: Michal Privoznik @ 2018-10-30 15:56 UTC (permalink / raw)
To: Kashyap Chamarthy, qemu-devel
Cc: thuth, ehabkost, libvir-list, armbru, imammedo
On 10/30/2018 02:00 PM, Kashyap Chamarthy wrote:
> [Cc: libvir-list]
>
> On Tue, Oct 30, 2018 at 01:35:23PM +0100, Kashyap Chamarthy wrote:
>> The first patch deprecates the QMP `cpu-add`, the second its HMP
>> equivalent, and the third documents vCPU hotplug procedure using QMP
>> `device_add` et al.
Thanks for heads up. Libvirt already uses device_add if
'query-hotpluggable-cpus' command is available and 'query-machines'
returns 'hotpluggable-cpus: yes' for given machine type. It only falls
back to cpu-add.
Michal
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add`
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add` Kashyap Chamarthy
@ 2018-10-31 15:14 ` Markus Armbruster
2018-11-05 11:20 ` Thomas Huth
1 sibling, 0 replies; 16+ messages in thread
From: Markus Armbruster @ 2018-10-31 15:14 UTC (permalink / raw)
To: Kashyap Chamarthy; +Cc: qemu-devel, thuth, ehabkost, armbru, imammedo
Kashyap Chamarthy <kchamart@redhat.com> writes:
> Since we're deprecating the QMP `cpu-add`, let's deprecate its HMP
> equivalent, too.
>
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
> ---
> hmp-commands.hx | 6 ++++--
> hmp.c | 2 ++
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index db0c681f74..ba71558c25 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -1849,14 +1849,16 @@ ETEXI
> .name = "cpu-add",
> .args_type = "id:i",
> .params = "id",
> - .help = "add cpu",
> + .help = "add cpu (deprecated, use device_add instead)",
> .cmd = hmp_cpu_add,
> },
>
> STEXI
> @item cpu-add @var{id}
> @findex cpu-add
> -Add CPU with id @var{id}
> +Add CPU with id @var{id}. This command is deprecated, please
> ++use @code{device_add} instead. For details, refer to
> +'docs/cpu-hotplug.rst'.
File gets created only in PATCH 3. Let's apply PATCH 3 before 1 & 2.
Perhaps the maintainer is willing to do that for you, so you don't have
to respin.
> ETEXI
>
> {
> diff --git a/hmp.c b/hmp.c
> index 4975fa56b0..c3f3db7795 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -2353,6 +2353,8 @@ 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);
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug
2018-10-30 12:35 [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
` (3 preceding siblings ...)
2018-10-30 13:00 ` [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
@ 2018-10-31 15:17 ` Markus Armbruster
2018-10-31 18:24 ` Eduardo Habkost
4 siblings, 1 reply; 16+ messages in thread
From: Markus Armbruster @ 2018-10-31 15:17 UTC (permalink / raw)
To: Kashyap Chamarthy; +Cc: qemu-devel, thuth, ehabkost, imammedo
Kashyap Chamarthy <kchamart@redhat.com> writes:
> The first patch deprecates the QMP `cpu-add`, the second its HMP
> equivalent, and the third documents vCPU hotplug procedure using QMP
> `device_add` et al.
>
> v2: https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03191.html
Preferably reordered so that PATCH 3 comes before 1 & 2, series
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug
2018-10-31 15:17 ` Markus Armbruster
@ 2018-10-31 18:24 ` Eduardo Habkost
0 siblings, 0 replies; 16+ messages in thread
From: Eduardo Habkost @ 2018-10-31 18:24 UTC (permalink / raw)
To: Markus Armbruster; +Cc: Kashyap Chamarthy, qemu-devel, thuth, imammedo
On Wed, Oct 31, 2018 at 04:17:26PM +0100, Markus Armbruster wrote:
> Kashyap Chamarthy <kchamart@redhat.com> writes:
>
> > The first patch deprecates the QMP `cpu-add`, the second its HMP
> > equivalent, and the third documents vCPU hotplug procedure using QMP
> > `device_add` et al.
> >
> > v2: https://lists.gnu.org/archive/html/qemu-devel/2018-09/msg03191.html
>
> Preferably reordered so that PATCH 3 comes before 1 & 2, series
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
Thanks, queued on machine-next.
Being only documentation updates, I consider it to be reasonable
to be included after soft freeze.
--
Eduardo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add`
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add` Kashyap Chamarthy
@ 2018-11-05 11:11 ` Thomas Huth
2018-12-13 6:38 ` Thomas Huth
1 sibling, 0 replies; 16+ messages in thread
From: Thomas Huth @ 2018-11-05 11:11 UTC (permalink / raw)
To: Kashyap Chamarthy, qemu-devel; +Cc: eblake, armbru, ehabkost, imammedo
On 2018-10-30 13:35, Kashyap Chamarthy wrote:
> The intended functionality of QMP `cpu-add` is replaced with
> `device_add` (and `query-hotpluggable-cpus`). So let's deprecate
> `cpu-add`.
>
> A complete example of vCPU hotplug with the recommended way (using
> `device_add`) is provided as part of a seperate docs patch.
>
> Suggested-by: Eduardo Habkost <ehabkost@redhat.com
> Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
> ---
> ---
Duplicated "---" line ... but I think this should not be a problem for
the usual tools.
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add`
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add` Kashyap Chamarthy
2018-10-31 15:14 ` Markus Armbruster
@ 2018-11-05 11:20 ` Thomas Huth
2018-11-07 8:49 ` Kashyap Chamarthy
1 sibling, 1 reply; 16+ messages in thread
From: Thomas Huth @ 2018-11-05 11:20 UTC (permalink / raw)
To: Kashyap Chamarthy, qemu-devel; +Cc: eblake, armbru, ehabkost, imammedo
On 2018-10-30 13:35, Kashyap Chamarthy wrote:
> Since we're deprecating the QMP `cpu-add`, let's deprecate its HMP
> equivalent, too.
>
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
> ---
> hmp-commands.hx | 6 ++++--
> hmp.c | 2 ++
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index db0c681f74..ba71558c25 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -1849,14 +1849,16 @@ ETEXI
> .name = "cpu-add",
> .args_type = "id:i",
> .params = "id",
> - .help = "add cpu",
> + .help = "add cpu (deprecated, use device_add instead)",
> .cmd = hmp_cpu_add,
> },
>
> STEXI
> @item cpu-add @var{id}
> @findex cpu-add
> -Add CPU with id @var{id}
> +Add CPU with id @var{id}. This command is deprecated, please
> ++use @code{device_add} instead. For details, refer to
> +'docs/cpu-hotplug.rst'.
> ETEXI
>
> {
> diff --git a/hmp.c b/hmp.c
> index 4975fa56b0..c3f3db7795 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -2353,6 +2353,8 @@ 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);
>
I think you should also mention this explicitly in qemu-deprecated.texi,
too.
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add`
2018-11-05 11:20 ` Thomas Huth
@ 2018-11-07 8:49 ` Kashyap Chamarthy
2018-11-07 9:30 ` Thomas Huth
0 siblings, 1 reply; 16+ messages in thread
From: Kashyap Chamarthy @ 2018-11-07 8:49 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, eblake, armbru, ehabkost, imammedo
On Mon, Nov 05, 2018 at 12:20:05PM +0100, Thomas Huth wrote:
> On 2018-10-30 13:35, Kashyap Chamarthy wrote:
> > Since we're deprecating the QMP `cpu-add`, let's deprecate its HMP
> > equivalent, too.
> >
> > Suggested-by: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
[...]
> > diff --git a/hmp.c b/hmp.c
> > index 4975fa56b0..c3f3db7795 100644
> > --- a/hmp.c
> > +++ b/hmp.c
> > @@ -2353,6 +2353,8 @@ 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);
> >
>
> I think you should also mention this explicitly in qemu-deprecated.texi,
> too.
I think you mean I should explicitly mention that the HMP equivalent is
also deprecated -- currently I only call out the QMP command:
'qemu-deprecated.texi'.
I saw that Eduardo already queued this series; maybe I can add a
follow-up if it can't be tweaked before submitting a pull request.
Thanks for the review!
--
/kashyap
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add`
2018-11-07 8:49 ` Kashyap Chamarthy
@ 2018-11-07 9:30 ` Thomas Huth
0 siblings, 0 replies; 16+ messages in thread
From: Thomas Huth @ 2018-11-07 9:30 UTC (permalink / raw)
To: Kashyap Chamarthy; +Cc: qemu-devel, eblake, armbru, ehabkost, imammedo
On 2018-11-07 09:49, Kashyap Chamarthy wrote:
> On Mon, Nov 05, 2018 at 12:20:05PM +0100, Thomas Huth wrote:
>> On 2018-10-30 13:35, Kashyap Chamarthy wrote:
>>> Since we're deprecating the QMP `cpu-add`, let's deprecate its HMP
>>> equivalent, too.
>>>
>>> Suggested-by: Thomas Huth <thuth@redhat.com>
>>> Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
>
> [...]
>
>>> diff --git a/hmp.c b/hmp.c
>>> index 4975fa56b0..c3f3db7795 100644
>>> --- a/hmp.c
>>> +++ b/hmp.c
>>> @@ -2353,6 +2353,8 @@ 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);
>>>
>>
>> I think you should also mention this explicitly in qemu-deprecated.texi,
>> too.
>
> I think you mean I should explicitly mention that the HMP equivalent is
> also deprecated -- currently I only call out the QMP command:
> 'qemu-deprecated.texi'.
>
> I saw that Eduardo already queued this series; maybe I can add a
> follow-up if it can't be tweaked before submitting a pull request.
Yes, a follow-up patch is perfectly fine for this.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add`
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add` Kashyap Chamarthy
2018-11-05 11:11 ` Thomas Huth
@ 2018-12-13 6:38 ` Thomas Huth
2018-12-13 11:05 ` Kashyap Chamarthy
1 sibling, 1 reply; 16+ messages in thread
From: Thomas Huth @ 2018-12-13 6:38 UTC (permalink / raw)
To: Kashyap Chamarthy, qemu-devel; +Cc: ehabkost, armbru, imammedo
On 2018-10-30 13:35, Kashyap Chamarthy wrote:
> The intended functionality of QMP `cpu-add` is replaced with
> `device_add` (and `query-hotpluggable-cpus`). So let's deprecate
> `cpu-add`.
>
> A complete example of vCPU hotplug with the recommended way (using
> `device_add`) is provided as part of a seperate docs patch.
>
> Suggested-by: Eduardo Habkost <ehabkost@redhat.com
> Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
> ---
[...]
> diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
> index 1b9c007f12..c86924ad9a 100644
> --- a/qemu-deprecated.texi
> +++ b/qemu-deprecated.texi
> @@ -155,6 +155,11 @@ 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.
>
> +@subsection cpu-add (since 3.1)
Hi Kashyap,
could you please send a follow-up patch to change this into 4.0 now?
Please also provide a patch to add the HMP command to
qemu-deprecated.texi, too.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add`
2018-12-13 6:38 ` Thomas Huth
@ 2018-12-13 11:05 ` Kashyap Chamarthy
2018-12-13 12:01 ` Kashyap Chamarthy
0 siblings, 1 reply; 16+ messages in thread
From: Kashyap Chamarthy @ 2018-12-13 11:05 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, ehabkost, armbru, imammedo
On Thu, Dec 13, 2018 at 07:38:03AM +0100, Thomas Huth wrote:
> On 2018-10-30 13:35, Kashyap Chamarthy wrote:
> > The intended functionality of QMP `cpu-add` is replaced with
> > `device_add` (and `query-hotpluggable-cpus`). So let's deprecate
> > `cpu-add`.
> >
> > A complete example of vCPU hotplug with the recommended way (using
> > `device_add`) is provided as part of a seperate docs patch.
> >
> > Suggested-by: Eduardo Habkost <ehabkost@redhat.com
> > Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
> > ---
> [...]
> > diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
> > index 1b9c007f12..c86924ad9a 100644
> > --- a/qemu-deprecated.texi
> > +++ b/qemu-deprecated.texi
> > @@ -155,6 +155,11 @@ 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.
> >
> > +@subsection cpu-add (since 3.1)
>
> Hi Kashyap,
>
> could you please send a follow-up patch to change this into 4.0 now?
Ah, sure.
> Please also provide a patch to add the HMP command to
> qemu-deprecated.texi, too.
Is it okay if both the above are done in the same patch? Since they're
related. Or am I missing a reason to do them separately?
--
/kashyap
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add`
2018-12-13 11:05 ` Kashyap Chamarthy
@ 2018-12-13 12:01 ` Kashyap Chamarthy
0 siblings, 0 replies; 16+ messages in thread
From: Kashyap Chamarthy @ 2018-12-13 12:01 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, ehabkost, armbru, imammedo
On Thu, Dec 13, 2018 at 12:05:05PM +0100, Kashyap Chamarthy wrote:
> On Thu, Dec 13, 2018 at 07:38:03AM +0100, Thomas Huth wrote:
> > On 2018-10-30 13:35, Kashyap Chamarthy wrote:
[...]
> > > index 1b9c007f12..c86924ad9a 100644
> > > --- a/qemu-deprecated.texi
> > > +++ b/qemu-deprecated.texi
> > > @@ -155,6 +155,11 @@ 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.
> > >
> > > +@subsection cpu-add (since 3.1)
> >
> > Hi Kashyap,
> >
> > could you please send a follow-up patch to change this into 4.0 now?
>
> Ah, sure.
>
> > Please also provide a patch to add the HMP command to
> > qemu-deprecated.texi, too.
>
> Is it okay if both the above are done in the same patch? Since they're
> related. Or am I missing a reason to do them separately?
Okay, please disregard the above; Dave Gilbert reminded that it's
preferable that I send two separate patches (part of a "series"), as
they're different things.
--
/kashyap
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2018-12-13 12:02 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 12:35 [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add` Kashyap Chamarthy
2018-11-05 11:11 ` Thomas Huth
2018-12-13 6:38 ` Thomas Huth
2018-12-13 11:05 ` Kashyap Chamarthy
2018-12-13 12:01 ` Kashyap Chamarthy
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 2/3] Deprecate HMP `cpu-add` Kashyap Chamarthy
2018-10-31 15:14 ` Markus Armbruster
2018-11-05 11:20 ` Thomas Huth
2018-11-07 8:49 ` Kashyap Chamarthy
2018-11-07 9:30 ` Thomas Huth
2018-10-30 12:35 ` [Qemu-devel] [PATCH v3 3/3] docs: Document vCPU hotplug procedure Kashyap Chamarthy
2018-10-30 13:00 ` [Qemu-devel] [PATCH v3 0/3] Deprecate QMP & HMP `cpu-add`; document vCPU hotplug Kashyap Chamarthy
2018-10-30 15:56 ` Michal Privoznik
2018-10-31 15:17 ` Markus Armbruster
2018-10-31 18:24 ` Eduardo Habkost
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).