From nobody Tue Feb 10 20:28:52 2026 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