Peter Maydell <[email protected]> writes:

> On Tue, 7 Jul 2026 at 12:06, Markus Armbruster <[email protected]> wrote:
>>
>> From: Daniel P. BerrangĂ© <[email protected]>
>>
>> The high level `-qmp` and `-monitor` options can remain as convenience
>> wrappers, but the low level `-mon` is completed obsoleted by the new
>> `-object` support with 'monitor-qmp' and 'monitor-hmp' types.
>>
>
>> @@ -3239,6 +3239,8 @@ void qemu_init(int argc, char **argv)
>>                  default_monitor = 0;
>>                  break;
>>              case QEMU_OPTION_mon:
>> +                warn_report_once("'-mon' is deprecated, use '-object' with "
>> +                                 "'monitor-hmp' or 'monitor-qmp' types 
>> instead");
>
> Can we be more precise in deprecation messages of this kind, please?
> This warning is not enough for the user to be able to figure out how
> to change their existing command line.
>
> I had to look into deprecated.rst, check the git history to see which
> commit added the deprecation, then find out how this commit was adjusting
> the examples in the tree.
>
> Notably, "-object monitor-hmp" appears to require an "id=" despite
> nothing actually caring what that ID is,

Yes, -object requires @id regardless of object type.  It calls
object_new_with_props_from_qdict() via user_creatable_add_qapi().
Together, they create the object at /objects/ID.

>                                          and the warning message
> doesn't say how to determine whether your existing -mon option
> should be changed to monitor-hmp or monitor-qmp. The deprecated.rst
> docs do say that part, but don't mention the ID bit.

Fair points.

Is this just "do better in the future", or are you also asking for a
patch to improve this warning?


Reply via email to