From nobody Sun Feb 8 13:33:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588831118; cv=none; d=zohomail.com; s=zohoarc; b=R3poGkX8baY6tp8MaqaJjAJ3KA2qPe3mviCSEUNJY/0502m56Y61o9V/sMYsVSWQJc7Qxo0vveHJ5AXZFHFGGSkY2o+9hxklqno5TSsFcV5oOrNfsRf889MqzRQroZNAQrNS+ccE8lm/iDslu+u5ZvWO1/EcmoNemwr88G8rcv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588831118; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=osZWYGL3PI/rgcLR2rT8GmaHpLTm1ZZ7+JGdiyyzI1E=; b=mtz1Vj7FRTRFIaY9ggzoDTZvEFWAFnEaXyAparkAqqzobSLTyJG/YHfZsMEpr7UCX17hzn9WiG3kH43VvkedlhM6qQtjV4CUJACd4MchmCebzjwkJ3f2uO1I3A5h4kcSgPrpyYMvaWPmDljLCvdg8KtuusCrDEe5bzQ3FTY+QEw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1588831118125705.6514389977804; Wed, 6 May 2020 22:58:38 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-418-DqAIbcvxMYSi4Y3_AJs4Zg-1; Thu, 07 May 2020 01:58:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F89B835B44; Thu, 7 May 2020 05:58:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 693AB5D9DC; Thu, 7 May 2020 05:58:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 291A11809540; Thu, 7 May 2020 05:58:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0475wAp5015379 for ; Thu, 7 May 2020 01:58:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 17A925D9DA; Thu, 7 May 2020 05:58:10 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 883065D9C5 for ; Thu, 7 May 2020 05:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588831116; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=osZWYGL3PI/rgcLR2rT8GmaHpLTm1ZZ7+JGdiyyzI1E=; b=feLO5n6lXnoY1tnWIwwjNFSaCEOdiys7IM8B5YCNZfHEkIP47y22Z2O3Q64OJIT+F6ylUM eJARxCGKFa794meAESyoYNzujp+eVzlkSRXY8wnR66dtC7zemF/xeBZuJF0UnrMPm4YL5y JA5kF607aRiJ2CyQsW9o3MmTetJkyV8= X-MC-Unique: DqAIbcvxMYSi4Y3_AJs4Zg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/8] virQEMUCapsProbeQMPDeviceProperties: Switch to local implementation Date: Thu, 7 May 2020 07:57:57 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Reimplement device property detection directly rather than using virQEMUCapsProbeQMPGenericProps in preparation for changes to the detection code. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index dadbef32a2..5e72dead45 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2610,11 +2610,27 @@ static int virQEMUCapsProbeQMPDeviceProperties(virQEMUCapsPtr qemuCaps, qemuMonitorPtr mon) { - return virQEMUCapsProbeQMPGenericProps(qemuCaps, - mon, - virQEMUCapsDeviceProps, - G_N_ELEMENTS(virQEMUCapsDeviceP= rops), - qemuMonitorGetDeviceProps); + size_t i; + + for (i =3D 0; i < G_N_ELEMENTS(virQEMUCapsDeviceProps); i++) { + virQEMUCapsObjectTypeProps *device =3D virQEMUCapsDeviceProps + i; + VIR_AUTOSTRINGLIST values =3D NULL; + int nvalues; + + if (device->capsCondition >=3D 0 && + !virQEMUCapsGet(qemuCaps, device->capsCondition)) + continue; + + if ((nvalues =3D qemuMonitorGetDeviceProps(mon, device->type, &val= ues)) < 0) + return -1; + + virQEMUCapsProcessStringFlags(qemuCaps, + device->nprops, + device->props, + nvalues, values); + } + + return 0; } --=20 2.26.2