All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: -device T,help crashes
Date: Tue, 17 Mar 2026 08:35:06 +0100	[thread overview]
Message-ID: <87y0jqlxhx.fsf@pond.sub.org> (raw)
In-Reply-To: <bd616907-9265-4ca2-83d3-d157d717c916@redhat.com> (Thomas Huth's message of "Tue, 17 Mar 2026 07:24:40 +0100")

Thomas Huth <thuth@redhat.com> writes:

> On 12/03/2026 09.15, Markus Armbruster wrote:
>> Markus Armbruster <armbru@redhat.com> writes:
> ...
>>> These crashes escape tests/qtest/device-introspect-test, because it
>>> covers only HMP "device_add T,help", not CLI "-device T,help".
>>
>> Anyone wants to cook up a patch to cover -device?
>
> Quick'n'dirty patch:
>
> diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c
> --- a/tests/qtest/device-introspect-test.c
> +++ b/tests/qtest/device-introspect-test.c
> @@ -105,6 +105,7 @@ static void test_one_device(QTestState *qts, const char *type)
>      QDict *resp;
>      char *help, *escaped;
>      GRegex *comma;
> +    int ret;
>
>      g_test_message("Testing device '%s'", type);
>
> @@ -119,6 +120,17 @@ static void test_one_device(QTestState *qts, const char *type)
>
>      help = qtest_hmp(qts, "device_add \"%s,help\"", escaped);
>      g_free(help);
> +
> +    if (!g_str_equal(type, "nonexistent") && !g_str_equal(type, "device")) {
> +        help = g_strdup_printf("%s -device \"%s,help\" > /dev/null", qtest_qemu_binary(NULL), escaped);
> +        ret = system(help);

Not using qtest_init() or similar.  Hmm.

> +        g_free(help);
> +        if (ret) {
> +            fprintf(stderr, "Running qemu with -device %s,help failed!\n", escaped);
> +            abort();
> +        }
> +    }
> +
>      g_free(escaped);
>  }
>
> But I think it needs some more work - we likely don't want to run this for each test run since it slows down the test quite a bit. And the g_test_quick() switch is already used for something else here.

It's used to test with every machine type, not just with "none".

I think we could also use it to additionally test -device just with
"none".  Testing it with every machine type would be even slower, and I
doubt it's worthwhile.

Another idea to conserve cycles: use a unit test instead.

> Anyway, found these additional issues so far:
>
>  ./qemu-system-ppc -device raven-pcihost,help
>  Segmentation fault (core dumped)
>  ./qemu-system-sparc -device cgthree,help
>  Segmentation fault (core dumped)

One more: sparc sun-tcx



  reply	other threads:[~2026-03-17  7:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 14:09 -device T,help crashes Markus Armbruster
2026-03-11 14:55 ` Peter Maydell
2026-03-11 15:14   ` Thomas Huth
2026-03-12  8:05     ` Markus Armbruster
2026-03-11 15:16 ` BALATON Zoltan
2026-03-12  8:15 ` Markus Armbruster
2026-03-17  6:24   ` Thomas Huth
2026-03-17  7:35     ` Markus Armbruster [this message]
2026-03-17  8:12       ` Thomas Huth
2026-03-17  9:27         ` Markus Armbruster
2026-03-17  9:37           ` Thomas Huth
2026-03-17 10:30             ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y0jqlxhx.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.