Daniel P. Berrangé <[email protected]> writes:
> Use the new preferred low level option for configuring the
> QMP service in libqtest and the python Machine class used
> by tests. This will avoid triggering deprecation warnings
> after the subsequent commit.
>
> Reviewed-by: Marc-André Lureau <[email protected]>
> Tested-by: Peter Krempa <[email protected]>
> Signed-off-by: Daniel P. Berrangé <[email protected]>
> ---
> python/qemu/machine/machine.py | 4 ++--
> tests/qtest/libqtest.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
> index ebb58d5b68..5f4845f5fb 100644
> --- a/python/qemu/machine/machine.py
> +++ b/python/qemu/machine/machine.py
> @@ -304,8 +304,8 @@ def _base_args(self) -> List[str]:
> )
> else:
> moncdev = f"socket,id=mon,path={self._monitor_address}"
> - args.extend(['-chardev', moncdev, '-mon',
> - 'chardev=mon,mode=control'])
> + args.extend(['-chardev', moncdev, '-object',
> + 'monitor-qmp,id=qmp,chardev=mon'])
>
> if self._machine is not None:
> args.extend(['-machine', self._machine])
> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
> index 4e22c66b75..c33c799c92 100644
> --- a/tests/qtest/libqtest.c
> +++ b/tests/qtest/libqtest.c
> @@ -460,7 +460,7 @@ gchar *qtest_qemu_args(const char *extra_args)
> "-qtest unix:%s "
> "-qtest-log %s "
> "-chardev socket,path=%s,id=char0 "
> - "-mon chardev=char0,mode=control "
> + "-object monitor-qmp,id=qmp0,chardev=char0 "
> "-display none "
> "-audio none "
> "%s "
Have you considered tests/functional/qemu_test/testcase.py
if sockpath is not None:
vm.add_args("-chardev",
f"socket,id=backdoor,path={sockpath},server=on,wait=off",
"-mon", "chardev=backdoor,mode=control")
and tests/tcg/{aarch64,arm}/Makefile.softmmu-target
QEMU_SEMIHOST=-serial none -chardev stdio,mux=on,id=stdio0
-semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline
?