From nobody Sun Apr 28 19:22:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506463537484812.6170331001638; Tue, 26 Sep 2017 15:05:37 -0700 (PDT) Received: from localhost ([::1]:51272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwxyd-00059g-QI for importer@patchew.org; Tue, 26 Sep 2017 18:05:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwxx1-0004Iz-9p for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwxwy-00036J-2J for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34408) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwxwx-000369-SJ for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:31 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC03D85550; Tue, 26 Sep 2017 22:03:30 +0000 (UTC) Received: from localhost (ovpn-116-64.gru2.redhat.com [10.97.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5050A71C4C; Tue, 26 Sep 2017 22:03:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BC03D85550 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Tue, 26 Sep 2017 19:03:23 -0300 Message-Id: <20170926220326.12996-2-ehabkost@redhat.com> In-Reply-To: <20170926220326.12996-1-ehabkost@redhat.com> References: <20170926220326.12996-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 26 Sep 2017 22:03:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] qmp: qom_type_get_info() helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Cornelia Huck , Markus Armbruster , Igor Mammedov , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Extract the code that fills ObjectTypeInfo fields to a qom_type_get_info() helper. It will be reused in other QMP commands. Signed-off-by: Eduardo Habkost --- qmp.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/qmp.c b/qmp.c index e8c303116a..dec4bd843b 100644 --- a/qmp.c +++ b/qmp.c @@ -426,19 +426,25 @@ void qmp_change(const char *device, const char *targe= t, } } =20 -static void qom_list_types_tramp(ObjectClass *klass, void *data) +static void qom_type_get_info(ObjectClass *klass, ObjectTypeInfo *info) { - ObjectTypeInfoList *e, **pret =3D data; - ObjectTypeInfo *info; ObjectClass *parent =3D object_class_get_parent(klass); =20 - info =3D g_malloc0(sizeof(*info)); info->name =3D g_strdup(object_class_get_name(klass)); info->has_abstract =3D info->abstract =3D object_class_is_abstract(kla= ss); if (parent) { info->has_parent =3D true; info->parent =3D g_strdup(object_class_get_name(parent)); } +} + +static void qom_list_types_tramp(ObjectClass *klass, void *data) +{ + ObjectTypeInfoList *e, **pret =3D data; + ObjectTypeInfo *info; + + info =3D g_malloc0(sizeof(*info)); + qom_type_get_info(klass, info); =20 e =3D g_malloc0(sizeof(*e)); e->value =3D info; --=20 2.13.5 From nobody Sun Apr 28 19:22:49 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506463527630689.7158841898994; Tue, 26 Sep 2017 15:05:27 -0700 (PDT) Received: from localhost ([::1]:51273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwxyd-00059q-SV for importer@patchew.org; Tue, 26 Sep 2017 18:05:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwxx1-0004J0-9w for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwxwz-00036v-SB for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52432) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwxwz-00036j-MS for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B629C047B86; Tue, 26 Sep 2017 22:03:32 +0000 (UTC) Received: from localhost (ovpn-116-64.gru2.redhat.com [10.97.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28D0378393; Tue, 26 Sep 2017 22:03:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9B629C047B86 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Tue, 26 Sep 2017 19:03:24 -0300 Message-Id: <20170926220326.12996-3-ehabkost@redhat.com> In-Reply-To: <20170926220326.12996-1-ehabkost@redhat.com> References: <20170926220326.12996-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 26 Sep 2017 22:03:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/4] qmp: get_device_class() helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Cornelia Huck , Markus Armbruster , Igor Mammedov , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Extract device type lookup code from qmp_device_list_properties() to a get_device_class() helper. It will be reused by other QMP commands. Signed-off-by: Eduardo Habkost --- qmp.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/qmp.c b/qmp.c index dec4bd843b..5ec829c09b 100644 --- a/qmp.c +++ b/qmp.c @@ -517,14 +517,9 @@ static DevicePropertyInfo *make_device_property_info(O= bjectClass *klass, return info; } =20 -DevicePropertyInfoList *qmp_device_list_properties(const char *typename, - Error **errp) +static DeviceClass *get_device_class(const char *typename, Error **errp) { ObjectClass *klass; - Object *obj; - ObjectProperty *prop; - ObjectPropertyIterator iter; - DevicePropertyInfoList *prop_list =3D NULL; =20 klass =3D object_class_by_name(typename); if (klass =3D=3D NULL) { @@ -539,6 +534,23 @@ DevicePropertyInfoList *qmp_device_list_properties(con= st char *typename, return NULL; } =20 + return DEVICE_CLASS(klass); +} + +DevicePropertyInfoList *qmp_device_list_properties(const char *typename, + Error **errp) +{ + ObjectClass *klass; + Object *obj; + ObjectProperty *prop; + ObjectPropertyIterator iter; + DevicePropertyInfoList *prop_list =3D NULL; + + klass =3D OBJECT_CLASS(get_device_class(typename, errp)); + if (!klass) { + return NULL; + } + if (object_class_is_abstract(klass)) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", "non-abstract device type"); --=20 2.13.5 From nobody Sun Apr 28 19:22:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506463634066496.1712511525692; Tue, 26 Sep 2017 15:07:14 -0700 (PDT) Received: from localhost ([::1]:51282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwy0U-0006gI-AJ for importer@patchew.org; Tue, 26 Sep 2017 18:07:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwxx2-0004JG-KI for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwxx1-00037f-JT for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42938) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwxx1-00037G-BC for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:35 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60059C057FA6; Tue, 26 Sep 2017 22:03:34 +0000 (UTC) Received: from localhost (ovpn-116-64.gru2.redhat.com [10.97.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id E662E5C6EC; Tue, 26 Sep 2017 22:03:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 60059C057FA6 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Tue, 26 Sep 2017 19:03:25 -0300 Message-Id: <20170926220326.12996-4-ehabkost@redhat.com> In-Reply-To: <20170926220326.12996-1-ehabkost@redhat.com> References: <20170926220326.12996-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 26 Sep 2017 22:03:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] qmp: query-device-type command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Cornelia Huck , Markus Armbruster , Igor Mammedov , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add a command that returns QOM type information that is specific to device types and is not returned by qom-list-types. The returned DeviceTypeInfo struct inherits from ObjectTypeInfo, so fields returned by qom-list-types are also included. Signed-off-by: Eduardo Habkost --- qapi-schema.json | 35 +++++++++++++++++++++++++++++++++++ qmp.c | 25 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index a3ba1c9a1c..0955380a59 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1466,6 +1466,41 @@ 'returns': [ 'DevicePropertyInfo' ] } =20 ## +# @DeviceTypeInfo: +# +# Information about a device type. +# +# @user-creatable: If true, the device can be instantiated using the -devi= ce +# command-line option. +# @hotpluggable: If true, the device can be instantiated using @device_add, +# if the machine supports the device. +# +# @description: Human-readable description of the device type. +# +# Since: 2.11 +## +{ 'struct': 'DeviceTypeInfo', + 'base': 'ObjectTypeInfo', + 'data': { 'hotpluggable': 'bool', + 'user-creatable': 'bool', + '*description': 'str' } } + +## +# @query-device-type: +# +# Query information about a device type. +# +# @typename: the name of the device type +# +# Returns: a DeviceTypeInfo struct +# +# Since: 2.11 +## +{ 'command': 'query-device-type', + 'data': { 'typename': 'str' }, + 'returns': 'DeviceTypeInfo' } + +## # @xen-set-global-dirty-log: # # Enable or disable the global dirty log mode. diff --git a/qmp.c b/qmp.c index 5ec829c09b..761fcf61c7 100644 --- a/qmp.c +++ b/qmp.c @@ -597,6 +597,31 @@ DevicePropertyInfoList *qmp_device_list_properties(con= st char *typename, return prop_list; } =20 +DeviceTypeInfo *qmp_query_device_type(const char *typename, Error **errp) +{ + DeviceTypeInfo *info =3D g_new0(DeviceTypeInfo, 1); + DeviceClass *dc =3D get_device_class(typename, errp); + + if (!dc) { + return NULL; + } + + qom_type_get_info(OBJECT_CLASS(dc), qapi_DeviceTypeInfo_base(info)); + info->user_creatable =3D dc->user_creatable; + /* + * We have non-user-creatable devices with hotpluggable=3Dtrue (becaus= e they + * are instantiated internally by hotpluggable devices), but it doesn'= t make + * sense to tell the user that device_add is supported if the device i= s not + * user-creatable + */ + info->hotpluggable =3D dc->user_creatable && dc->hotpluggable; + if (dc->desc) { + info->has_description =3D true; + info->description =3D g_strdup(dc->desc); + } + return info; +} + CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) { return arch_query_cpu_definitions(errp); --=20 2.13.5 From nobody Sun Apr 28 19:22:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506463633791451.3984323464688; Tue, 26 Sep 2017 15:07:13 -0700 (PDT) Received: from localhost ([::1]:51283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwy0X-0006hR-2D for importer@patchew.org; Tue, 26 Sep 2017 18:07:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwxx4-0004K5-3L for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwxx3-00038f-BB for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43046) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwxx3-00038H-5S for qemu-devel@nongnu.org; Tue, 26 Sep 2017 18:03:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3FDA0C058EA9; Tue, 26 Sep 2017 22:03:36 +0000 (UTC) Received: from localhost (ovpn-116-64.gru2.redhat.com [10.97.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id C26334147; Tue, 26 Sep 2017 22:03:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3FDA0C058EA9 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Tue, 26 Sep 2017 19:03:26 -0300 Message-Id: <20170926220326.12996-5-ehabkost@redhat.com> In-Reply-To: <20170926220326.12996-1-ehabkost@redhat.com> References: <20170926220326.12996-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 26 Sep 2017 22:03:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] device-crash-test: Use query-device-info for user-creatable check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Cornelia Huck , Markus Armbruster , Igor Mammedov , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Now that we have query-device-info, we don't need to parse "info qdm" output to find out if a device is user-creatable. Signed-off-by: Eduardo Habkost --- scripts/device-crash-test | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/scripts/device-crash-test b/scripts/device-crash-test index 043b24a4aa..ddc8f72eca 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -318,19 +318,6 @@ def qomListTypeNames(vm, **kwargs): return [t['name'] for t in types] =20 =20 -def infoQDM(vm): - """Parse 'info qdm' output""" - args =3D {'command-line': 'info qdm'} - devhelp =3D vm.command('human-monitor-command', **args) - for l in devhelp.split('\n'): - l =3D l.strip() - if l =3D=3D '' or l.endswith(':'): - continue - d =3D {'name': re.search(r'name "([^"]+)"', l).group(1), - 'no-user': (re.search(', no-user', l) is not None)} - yield d - - class QemuBinaryInfo(object): def __init__(self, binary, devtype): if devtype is None: @@ -346,11 +333,9 @@ class QemuBinaryInfo(object): vm.launch() try: self.alldevs =3D set(qomListTypeNames(vm, implements=3Ddevtype= , abstract=3DFalse)) - # there's no way to query DeviceClass::user_creatable using QM= P, - # so use 'info qdm': - self.no_user_devs =3D set([d['name'] for d in infoQDM(vm, ) if= d['no-user']]) + self.dev_info =3D dict((t, vm.command('query-device-type', typ= ename=3Dt)) for t in self.alldevs) + self.user_devs =3D set(d for d in self.alldevs if self.dev_inf= o[d]['user-creatable']) self.machines =3D list(m['name'] for m in vm.command('query-ma= chines')) - self.user_devs =3D self.alldevs.difference(self.no_user_devs) self.kvm_available =3D vm.command('query-kvm')['enabled'] finally: vm.shutdown() --=20 2.13.5