diff mbox series

[v3,2/3] Deprecate HMP `cpu-add`

Message ID 20181030123526.26415-3-kchamart@redhat.com
State New
Headers show
Series Deprecate QMP & HMP `cpu-add`; document vCPU hotplug | expand

Commit Message

Kashyap Chamarthy Oct. 30, 2018, 12:35 p.m. UTC
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(-)

Comments

Markus Armbruster Oct. 31, 2018, 3:14 p.m. UTC | #1
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);
Thomas Huth Nov. 5, 2018, 11:20 a.m. UTC | #2
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
Kashyap Chamarthy Nov. 7, 2018, 8:49 a.m. UTC | #3
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!
Thomas Huth Nov. 7, 2018, 9:30 a.m. UTC | #4
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
diff mbox series

Patch

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);