qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Markus Armbruster <armbru@redhat.com>
Cc: ehabkost@redhat.com, Thomas Huth <thuth@redhat.com>,
	qemu-devel@nongnu.org, stefanha@redhat.com,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 5/7] qmp: Fix device-list-properties not to crash for abstract device
Date: Tue, 29 Sep 2015 18:07:52 +0200	[thread overview]
Message-ID: <560AB758.7040905@suse.de> (raw)
In-Reply-To: <560A349A.5090506@redhat.com>

Am 29.09.2015 um 08:50 schrieb Thomas Huth:
> On 28/09/15 22:08, Markus Armbruster wrote:
>> Broken in commit f4eb32b "qmp: show QOM properties in
>> device-list-properties", v2.1.
>>
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> ---
>>  qmp.c                          |  6 ++++++
>>  tests/device-introspect-test.c | 15 ++++-----------
>>  2 files changed, 10 insertions(+), 11 deletions(-)
>>
>> diff --git a/qmp.c b/qmp.c
>> index 057a7cb..1413de4 100644
>> --- a/qmp.c
>> +++ b/qmp.c
>> @@ -515,6 +515,12 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
>>          return NULL;
>>      }
>>  
>> +    if (object_class_is_abstract(klass)) {
>> +        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "name",
>> +                   "non-abstract device type");
>> +        return NULL;
>> +    }
>> +
>>      obj = object_new(typename);
>>  
>>      QTAILQ_FOREACH(prop, &obj->properties, node) {
>> diff --git a/tests/device-introspect-test.c b/tests/device-introspect-test.c
>> index 832b60a..a8950a1 100644
>> --- a/tests/device-introspect-test.c
>> +++ b/tests/device-introspect-test.c
>> @@ -45,17 +45,10 @@ static void test_one_device(const char *type)
>>      QDict *resp;
>>      char *help, *qom_tree;
>>  
>> -    /*
>> -     * Skip this part for the abstract device test case, because
>> -     * device-list-properties crashes for such devices.
>> -     * FIXME fix it not to crash
>> -     */
>> -    if (strcmp(type, "device")) {
>> -        resp = qmp("{'execute': 'device-list-properties',"
>> -                   " 'arguments': {'typename': %s}}",
>> -                   type);
>> -        QDECREF(resp);
>> -    }
>> +    resp = qmp("{'execute': 'device-list-properties',"
>> +               " 'arguments': {'typename': %s}}",
>> +               type);
>> +    QDECREF(resp);
>>  
>>      help = hmp("device_add \"%s,help\"", type);
>>      g_free(help);
>>
> 
> Why don't you fix this before patch 4/7, then you don't have to add the
> temporary work-around in device-introspect-test.c ?

+1, but anyway:

Reviewed-by: Andreas Färber <afaerber@suse.de>

Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)

  parent reply	other threads:[~2015-09-29 16:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 20:08 [Qemu-devel] [PATCH v4 0/7] Fix device introspection regressions Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 1/7] tests: Fix how qom-test is run Markus Armbruster
2015-09-29 16:06   ` Andreas Färber
2015-10-01  5:41     ` Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 2/7] libqtest: Clean up unused QTestState member sigact_old Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 3/7] libqtest: New hmp() & friends Markus Armbruster
2015-09-29  6:38   ` Thomas Huth
2015-09-29 12:41     ` Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 4/7] device-introspect-test: New, covering device introspection Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 5/7] qmp: Fix device-list-properties not to crash for abstract device Markus Armbruster
2015-09-29  6:50   ` Thomas Huth
2015-09-29 12:44     ` Markus Armbruster
2015-09-29 16:07     ` Andreas Färber [this message]
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 6/7] qdev: Protect device-list-properties against broken devices Markus Armbruster
2015-09-28 20:15   ` Eduardo Habkost
2015-09-29  7:01   ` Thomas Huth
2015-09-29 16:22   ` Andreas Färber
2015-10-01  5:45     ` Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 7/7] Revert "qdev: Use qdev_get_device_class() for -device <type>, help" Markus Armbruster
2015-09-29 15:33 ` [Qemu-devel] [PATCH v4 0/7] Fix device introspection regressions Markus Armbruster
2015-10-01 13:42   ` Stefan Hajnoczi

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=560AB758.7040905@suse.de \
    --to=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).