On Wed, Oct 07, 2026 at 06:46:12PM +0000, Pierrick Bouvier wrote:
> From: Yonggang Luo <[email protected]>
> 
> Check that query-target reports the target identity selected by the qtest
> binary, including softmmu variants.
> 
> Reviewed-by: Pierrick Bouvier <[email protected]>
> Signed-off-by: Yonggang Luo <[email protected]>
> Signed-off-by: Pierrick Bouvier <[email protected]>
> ---
>  tests/qtest/qmp-test.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)

Reviewed-by: Daniel P. Berrangé <[email protected]>

> 
> diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c
> index 927ab053f8a..c70f6a681c1 100644
> --- a/tests/qtest/qmp-test.c
> +++ b/tests/qtest/qmp-test.c
> @@ -164,6 +164,18 @@ static void test_qmp_protocol(void)
>      qtest_quit(qts);
>  }
>  
> +static void test_query_target(void)
> +{
> +    QTestState *qts = qtest_init(common_args);
> +    QDict *target;
> +
> +    target = qtest_qmp_assert_success_ref(qts,
> +                                          "{ 'execute': 'query-target' }");
> +    g_assert_cmpstr(qdict_get_try_str(target, "arch"), ==, qtest_get_arch());
> +    qobject_unref(target);
> +    qtest_quit(qts);
> +}
> +
>  #ifndef _WIN32
>  
>  /* Out-of-band tests */
> @@ -517,6 +529,7 @@ int main(int argc, char *argv[])
>      g_test_init(&argc, &argv, NULL);
>  
>      qtest_add_func("qmp/protocol", test_qmp_protocol);
> +    qtest_add_func("qmp/query-target", test_query_target);
>  #ifndef _WIN32
>      /* This case calls mkfifo() which does not exist on win32 */
>      qtest_add_func("qmp/oob", test_qmp_oob);
> -- 
> 2.43.0
> 

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|


Reply via email to