From nobody Wed May 14 20:00:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520608088888919.7139985248604; Fri, 9 Mar 2018 07:08:08 -0800 (PST) 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 8A60367EA8; Fri, 9 Mar 2018 15:08:07 +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 5B268620B1; Fri, 9 Mar 2018 15:08:07 +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 1DFFD181BA02; Fri, 9 Mar 2018 15:08:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w29F85M5023755 for ; Fri, 9 Mar 2018 10:08:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id BBA3E215CDAE; Fri, 9 Mar 2018 15:08:05 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62B2B215CDAA for ; Fri, 9 Mar 2018 15:08:05 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 9 Mar 2018 16:07:50 +0100 Message-Id: <20180309150754.11341-5-abologna@redhat.com> In-Reply-To: <20180309150754.11341-1-abologna@redhat.com> References: <20180309150754.11341-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/8] qemu: Rename virQEMUCapsObjectProps* -> virQEMUCapsDeviceProps* 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@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.38]); Fri, 09 Mar 2018 15:08:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In QOM, all devices are objects, which makes the existing names technically correct; however, not all objects are devices, and soon we're going to start looking for object properties in addition to device properties: the former need to go through a different code path, so we need to be able to tell them apart. Using more precise names is a good way to achieve that. While renaming, hunks are also being moved around a bit: the new grouping, too, will make things nicer once we start adding support for object properties. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/qemu/qemu_capabilities.c | 239 ++++++++++++++++++++++-----------------= ---- src/qemu/qemu_monitor.c | 4 +- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 2 +- src/qemu/qemu_monitor_json.h | 2 +- 5 files changed, 128 insertions(+), 121 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c70bd27f18..83ec8a67d5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1559,6 +1559,13 @@ struct virQEMUCapsStringFlags { int flag; }; =20 +struct virQEMUCapsObjectTypeProps { + const char *type; + struct virQEMUCapsStringFlags *props; + size_t nprops; + int capsCondition; +}; + =20 struct virQEMUCapsStringFlags virQEMUCapsCommands[] =3D { { "system_wakeup", QEMU_CAPS_WAKEUP }, @@ -1698,14 +1705,21 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectType= s[] =3D { { "pl011", QEMU_CAPS_DEVICE_PL011 }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[]= =3D { +/* Device properties. + * + * The following can be probed either using the device-list-properties + * QMP command or, for older QEMU versions, from the help text obtained + * through the '-device xxx,?' command line option + */ + +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[]= =3D { { "deflate-on-oom", QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, { "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM }, { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] =3D= { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBlk[] =3D= { { "multifunction", QEMU_CAPS_PCI_MULTIFUNCTION }, { "bootindex", QEMU_CAPS_BOOTINDEX }, { "ioeventfd", QEMU_CAPS_VIRTIO_IOEVENTFD }, @@ -1719,7 +1733,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjec= tPropsVirtioBlk[] =3D { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] =3D= { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioNet[] =3D= { { "tx", QEMU_CAPS_VIRTIO_TX_ALG }, { "event_idx", QEMU_CAPS_VIRTIO_NET_EVENT_IDX }, { "rx_queue_size", QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE }, @@ -1730,87 +1744,87 @@ static struct virQEMUCapsStringFlags virQEMUCapsObj= ectPropsVirtioNet[] =3D { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSpaprPCIHostBri= dge[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSpaprPCIHostBri= dge[] =3D { { "numa_node", QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioSCSI[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioSCSI[] = =3D { { "iothread", QEMU_CAPS_VIRTIO_SCSI_IOTHREAD }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, { "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM }, { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPCIAssign[] =3D= { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsPCIAssign[] =3D= { { "configfd", QEMU_CAPS_PCI_CONFIGFD }, { "bootindex", QEMU_CAPS_PCI_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVfioPCI[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVfioPCI[] =3D { { "bootindex", QEMU_CAPS_VFIO_PCI_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIDisk[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSCSIDisk[] =3D { { "channel", QEMU_CAPS_SCSI_DISK_CHANNEL }, { "wwn", QEMU_CAPS_SCSI_DISK_WWN }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIDEDrive[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIDEDrive[] =3D { { "wwn", QEMU_CAPS_IDE_DRIVE_WWN }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPiix4PM[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsPiix4PM[] =3D { { "disable_s3", QEMU_CAPS_PIIX_DISABLE_S3 }, { "disable_s4", QEMU_CAPS_PIIX_DISABLE_S4 }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBRedir[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBRedir[] =3D { { "filter", QEMU_CAPS_USB_REDIR_FILTER }, { "bootindex", QEMU_CAPS_USB_REDIR_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBHost[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBHost[] =3D { { "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIGeneric[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSCSIGeneric[] = =3D { { "bootindex", QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsI440FXPCIHost[]= =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsI440FXPCIHost[]= =3D { { "pci-hole64-size", QEMU_CAPS_I440FX_PCI_HOLE64_SIZE }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PCIHost[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsQ35PCIHost[] = =3D { { "pci-hole64-size", QEMU_CAPS_Q35_PCI_HOLE64_SIZE }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBStorage[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBStorage[] = =3D { { "removable", QEMU_CAPS_USB_STORAGE_REMOVABLE }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsKVMPit[] =3D { { "lost_tick_policy", QEMU_CAPS_KVM_PIT_TICK_POLICY }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVGA[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVGA[] =3D { { "vgamem_mb", QEMU_CAPS_VGA_VGAMEM }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVmwareSvga[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVmwareSvga[] = =3D { { "vgamem_mb", QEMU_CAPS_VMWARE_SVGA_VGAMEM }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsQxl[] =3D { { "vgamem_mb", QEMU_CAPS_QXL_VGAMEM }, { "vram64_size_mb", QEMU_CAPS_QXL_VRAM64 }, { "max_outputs", QEMU_CAPS_QXL_MAX_OUTPUTS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] =3D= { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioGpu[] =3D= { { "virgl", QEMU_CAPS_VIRTIO_GPU_VIRGL }, { "max_outputs", QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, @@ -1818,139 +1832,132 @@ static struct virQEMUCapsStringFlags virQEMUCapsO= bjectPropsVirtioGpu[] =3D { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsICH9[] =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsICH9[] =3D { { "disable_s3", QEMU_CAPS_ICH9_DISABLE_S3 }, { "disable_s4", QEMU_CAPS_ICH9_DISABLE_S4 }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBNECXHCI[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBNECXHCI[] = =3D { { "p3", QEMU_CAPS_NEC_USB_XHCI_PORTS }, }; =20 -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = =3D { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIntelIOMMU[] = =3D { { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, { "caching-mode", QEMU_CAPS_INTEL_IOMMU_CACHING_MODE }, { "eim", QEMU_CAPS_INTEL_IOMMU_EIM }, { "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB }, }; =20 -/* see documentation for virQEMUCapsQMPSchemaGetByPath for the query forma= t */ -static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] =3D { - { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUS= TER_DEBUG_LEVEL}, - { "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVE= L}, - { "blockdev-add/arg-type/+vxhs", QEMU_CAPS_VXHS}, - { "blockdev-add/arg-type/+iscsi/password-secret", QEMU_CAPS_ISCSI_PASS= WORD_SECRET }, -}; - -struct virQEMUCapsObjectTypeProps { - const char *type; - struct virQEMUCapsStringFlags *props; - size_t nprops; - int capsCondition; -}; - -static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] =3D { - { "virtio-blk-pci", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), +static struct virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] =3D { + { "virtio-blk-pci", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), -1 }, - { "virtio-net-pci", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-pci", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "virtio-scsi-pci", virQEMUCapsObjectPropsVirtioSCSI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI), + { "virtio-scsi-pci", virQEMUCapsDevicePropsVirtioSCSI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioSCSI), QEMU_CAPS_VIRTIO_SCSI }, - { "virtio-blk-ccw", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), + { "virtio-blk-ccw", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), QEMU_CAPS_VIRTIO_CCW }, - { "virtio-net-ccw", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-ccw", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "virtio-scsi-ccw", virQEMUCapsObjectPropsVirtioSCSI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI), + { "virtio-scsi-ccw", virQEMUCapsDevicePropsVirtioSCSI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioSCSI), QEMU_CAPS_VIRTIO_SCSI }, - { "virtio-blk-s390", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), + { "virtio-blk-s390", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), QEMU_CAPS_VIRTIO_S390 }, - { "virtio-net-s390", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-s390", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "pci-assign", virQEMUCapsObjectPropsPCIAssign, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign), + { "pci-assign", virQEMUCapsDevicePropsPCIAssign, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPCIAssign), -1 }, - { "kvm-pci-assign", virQEMUCapsObjectPropsPCIAssign, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign), + { "kvm-pci-assign", virQEMUCapsDevicePropsPCIAssign, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPCIAssign), -1 }, - { "vfio-pci", virQEMUCapsObjectPropsVfioPCI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVfioPCI), + { "vfio-pci", virQEMUCapsDevicePropsVfioPCI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVfioPCI), QEMU_CAPS_DEVICE_VFIO_PCI }, - { "scsi-disk", virQEMUCapsObjectPropsSCSIDisk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIDisk), + { "scsi-disk", virQEMUCapsDevicePropsSCSIDisk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSCSIDisk), -1 }, - { "ide-drive", virQEMUCapsObjectPropsIDEDrive, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsIDEDrive), + { "ide-drive", virQEMUCapsDevicePropsIDEDrive, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsIDEDrive), -1 }, - { "PIIX4_PM", virQEMUCapsObjectPropsPiix4PM, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPiix4PM), + { "PIIX4_PM", virQEMUCapsDevicePropsPiix4PM, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPiix4PM), -1 }, - { "usb-redir", virQEMUCapsObjectPropsUSBRedir, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBRedir), + { "usb-redir", virQEMUCapsDevicePropsUSBRedir, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBRedir), QEMU_CAPS_USB_REDIR }, - { "usb-host", virQEMUCapsObjectPropsUSBHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBHost), + { "usb-host", virQEMUCapsDevicePropsUSBHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBHost), -1 }, - { "scsi-generic", virQEMUCapsObjectPropsSCSIGeneric, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIGeneric), + { "scsi-generic", virQEMUCapsDevicePropsSCSIGeneric, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSCSIGeneric), QEMU_CAPS_DEVICE_SCSI_GENERIC }, - { "i440FX-pcihost", virQEMUCapsObjectPropsI440FXPCIHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsI440FXPCIHost), + { "i440FX-pcihost", virQEMUCapsDevicePropsI440FXPCIHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsI440FXPCIHost), -1 }, - { "q35-pcihost", virQEMUCapsObjectPropsQ35PCIHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PCIHost), + { "q35-pcihost", virQEMUCapsDevicePropsQ35PCIHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsQ35PCIHost), -1 }, - { "usb-storage", virQEMUCapsObjectPropsUSBStorage, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage), + { "usb-storage", virQEMUCapsDevicePropsUSBStorage, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBStorage), QEMU_CAPS_DEVICE_USB_STORAGE }, - { "kvm-pit", virQEMUCapsObjectPropsKVMPit, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit), + { "kvm-pit", virQEMUCapsDevicePropsKVMPit, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsKVMPit), -1 }, - { "VGA", virQEMUCapsObjectPropsVGA, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVGA), + { "VGA", virQEMUCapsDevicePropsVGA, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVGA), QEMU_CAPS_DEVICE_VGA }, - { "vmware-svga", virQEMUCapsObjectPropsVmwareSvga, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga), + { "vmware-svga", virQEMUCapsDevicePropsVmwareSvga, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVmwareSvga), QEMU_CAPS_DEVICE_VMWARE_SVGA }, - { "qxl", virQEMUCapsObjectPropsQxl, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl), + { "qxl", virQEMUCapsDevicePropsQxl, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsQxl), QEMU_CAPS_DEVICE_QXL }, - { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), + { "virtio-gpu-pci", virQEMUCapsDevicePropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioGpu), QEMU_CAPS_DEVICE_VIRTIO_GPU }, - { "virtio-gpu-device", virQEMUCapsObjectPropsVirtioGpu, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), + { "virtio-gpu-device", virQEMUCapsDevicePropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioGpu), QEMU_CAPS_DEVICE_VIRTIO_GPU }, - { "ICH9-LPC", virQEMUCapsObjectPropsICH9, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsICH9), + { "ICH9-LPC", virQEMUCapsDevicePropsICH9, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsICH9), -1 }, - { "virtio-balloon-pci", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-pci", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "virtio-balloon-ccw", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-ccw", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "virtio-balloon-device", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-device", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "nec-usb-xhci", virQEMUCapsObjectPropsUSBNECXHCI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBNECXHCI), + { "nec-usb-xhci", virQEMUCapsDevicePropsUSBNECXHCI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBNECXHCI), QEMU_CAPS_NEC_USB_XHCI }, - { "intel-iommu", virQEMUCapsObjectPropsIntelIOMMU, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsIntelIOMMU), + { "intel-iommu", virQEMUCapsDevicePropsIntelIOMMU, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsIntelIOMMU), QEMU_CAPS_DEVICE_INTEL_IOMMU }, - { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge), + { "spapr-pci-host-bridge", virQEMUCapsDevicePropsSpaprPCIHostBridge, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSpaprPCIHostBridge), QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, }; =20 +/* see documentation for virQEMUCapsQMPSchemaGetByPath for the query forma= t */ +static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] =3D { + { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUS= TER_DEBUG_LEVEL}, + { "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVE= L}, + { "blockdev-add/arg-type/+vxhs", QEMU_CAPS_VXHS}, + { "blockdev-add/arg-type/+iscsi/password-secret", QEMU_CAPS_ISCSI_PASS= WORD_SECRET }, +}; + =20 static void virQEMUCapsProcessStringFlags(virQEMUCapsPtr qemuCaps, @@ -2081,15 +2088,15 @@ virQEMUCapsParseDeviceStr(virQEMUCapsPtr qemuCaps, = const char *str) nvalues, values); virStringListFreeCount(values, nvalues); =20 - for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { - const char *type =3D virQEMUCapsObjectProps[i].type; + for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsDeviceProps); i++) { + const char *type =3D virQEMUCapsDeviceProps[i].type; if ((nvalues =3D virQEMUCapsParseDeviceStrObjectProps(str, type, &values)) < 0) return -1; virQEMUCapsProcessStringFlags(qemuCaps, - virQEMUCapsObjectProps[i].nprops, - virQEMUCapsObjectProps[i].props, + virQEMUCapsDeviceProps[i].nprops, + virQEMUCapsDeviceProps[i].props, nvalues, values); virStringListFreeCount(values, nvalues); } @@ -2851,20 +2858,20 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, nvalues, values); virStringListFreeCount(values, nvalues); =20 - for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { - const char *type =3D virQEMUCapsObjectProps[i].type; - int cap =3D virQEMUCapsObjectProps[i].capsCondition; + for (i =3D 0; i < ARRAY_CARDINALITY(virQEMUCapsDeviceProps); i++) { + const char *type =3D virQEMUCapsDeviceProps[i].type; + int cap =3D virQEMUCapsDeviceProps[i].capsCondition; =20 if (cap >=3D 0 && !virQEMUCapsGet(qemuCaps, cap)) continue; =20 - if ((nvalues =3D qemuMonitorGetObjectProps(mon, + if ((nvalues =3D qemuMonitorGetDeviceProps(mon, type, &values)) < 0) return -1; virQEMUCapsProcessStringFlags(qemuCaps, - virQEMUCapsObjectProps[i].nprops, - virQEMUCapsObjectProps[i].props, + virQEMUCapsDeviceProps[i].nprops, + virQEMUCapsDeviceProps[i].props, nvalues, values); virStringListFreeCount(values, nvalues); } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 1d67a97789..8ec759fe3f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3942,7 +3942,7 @@ qemuMonitorGetObjectTypes(qemuMonitorPtr mon, =20 =20 int -qemuMonitorGetObjectProps(qemuMonitorPtr mon, +qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) { @@ -3950,7 +3950,7 @@ qemuMonitorGetObjectProps(qemuMonitorPtr mon, =20 QEMU_CHECK_MONITOR_JSON(mon); =20 - return qemuMonitorJSONGetObjectProps(mon, type, props); + return qemuMonitorJSONGetDeviceProps(mon, type, props); } =20 =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index adfa87aba9..26074ef7dd 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1094,7 +1094,7 @@ int qemuMonitorGetKVMState(qemuMonitorPtr mon, =20 int qemuMonitorGetObjectTypes(qemuMonitorPtr mon, char ***types); -int qemuMonitorGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props); char *qemuMonitorGetTargetArch(qemuMonitorPtr mon); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 08dfffdf64..eb32811cd1 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6058,7 +6058,7 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr m= on, #undef MAKE_SET_CMD =20 =20 -int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index ec243becc4..4a1da725d1 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -441,7 +441,7 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, qemuMonitorJSONObjectPropertyPtr prop) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); =20 -int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list