[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/11] qapi: Create DEFINE_PROP_OFF_AUTO_PCIBAR
From: |
Alex Williamson |
Subject: |
[Qemu-devel] [PULL 07/11] qapi: Create DEFINE_PROP_OFF_AUTO_PCIBAR |
Date: |
Mon, 05 Feb 2018 11:57:47 -0700 |
User-agent: |
StGit/0.18-101-g8fa6 |
Add an option which allows the user to specify a PCI BAR number,
including an 'off' and 'auto' selection.
Cc: Markus Armbruster <address@hidden>
Cc: Eric Blake <address@hidden>
Tested-by: Alexey Kardashevskiy <address@hidden>
Reviewed-by: Eric Auger <address@hidden>
Tested-by: Eric Auger <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>
---
hw/core/qdev-properties.c | 11 +++++++++++
include/hw/qdev-properties.h | 4 ++++
qapi/common.json | 26 ++++++++++++++++++++++++++
3 files changed, 41 insertions(+)
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 24c17800e3f1..5bbc2d98b5a8 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1317,3 +1317,14 @@ const PropertyInfo qdev_prop_link = {
.name = "link",
.create = create_link_property,
};
+
+/* --- OffAutoPCIBAR off/auto/bar0/bar1/bar2/bar3/bar4/bar5 --- */
+
+const PropertyInfo qdev_prop_off_auto_pcibar = {
+ .name = "OffAutoPCIBAR",
+ .description = "off/auto/bar0/bar1/bar2/bar3/bar4/bar5",
+ .enum_table = &OffAutoPCIBAR_lookup,
+ .get = get_enum,
+ .set = set_enum,
+ .set_default_value = set_default_value_enum,
+};
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 5bbfec634b29..1d61a351086d 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -34,6 +34,7 @@ extern const PropertyInfo qdev_prop_pci_host_devaddr;
extern const PropertyInfo qdev_prop_uuid;
extern const PropertyInfo qdev_prop_arraylen;
extern const PropertyInfo qdev_prop_link;
+extern const PropertyInfo qdev_prop_off_auto_pcibar;
#define DEFINE_PROP(_name, _state, _field, _prop, _type) { \
.name = (_name), \
@@ -214,6 +215,9 @@ extern const PropertyInfo qdev_prop_link;
DEFINE_PROP(_n, _s, _f, qdev_prop_pci_host_devaddr, PCIHostDeviceAddress)
#define DEFINE_PROP_MEMORY_REGION(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_ptr, MemoryRegion *)
+#define DEFINE_PROP_OFF_AUTO_PCIBAR(_n, _s, _f, _d) \
+ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_off_auto_pcibar, \
+ OffAutoPCIBAR)
#define DEFINE_PROP_UUID(_name, _state, _field) { \
.name = (_name), \
diff --git a/qapi/common.json b/qapi/common.json
index 6eb01821ef59..d9b14dd429f3 100644
--- a/qapi/common.json
+++ b/qapi/common.json
@@ -100,3 +100,29 @@
{ 'alternate': 'StrOrNull',
'data': { 's': 'str',
'n': 'null' } }
+
+##
+# @OffAutoPCIBAR:
+#
+# An enumeration of options for specifying a PCI BAR
+#
+# @off: The specified feature is disabled
+#
+# @auto: The PCI BAR for the feature is automatically selected
+#
+# @bar0: PCI BAR0 is used for the feature
+#
+# @bar1: PCI BAR1 is used for the feature
+#
+# @bar2: PCI BAR2 is used for the feature
+#
+# @bar3: PCI BAR3 is used for the feature
+#
+# @bar4: PCI BAR4 is used for the feature
+#
+# @bar5: PCI BAR5 is used for the feature
+#
+# Since: 2.12
+##
+{ 'enum': 'OffAutoPCIBAR',
+ 'data': [ 'off', 'auto', 'bar0', 'bar1', 'bar2', 'bar3', 'bar4', 'bar5' ] }
- [Qemu-devel] [PULL 00/11] VFIO updates 2018-02-05, Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 01/11] memory/iommu: Add get_attr(), Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 02/11] vfio/spapr: Use iommu memory region's get_attr(), Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 03/11] spapr/iommu: Enable in-kernel TCE acceleration via VFIO KVM device, Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 04/11] vfio/pci: Fixup VFIOMSIXInfo comment, Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 05/11] vfio/pci: Add base BAR MemoryRegion, Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 06/11] vfio/pci: Emulate BARs, Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 07/11] qapi: Create DEFINE_PROP_OFF_AUTO_PCIBAR,
Alex Williamson <=
- [Qemu-devel] [PULL 08/11] vfio/pci: Allow relocating MSI-X MMIO, Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 09/11] hw/vfio/platform: Init the interrupt mutex, Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 10/11] vfio/common: Remove redundant copy of local variable, Alex Williamson, 2018/02/05
- [Qemu-devel] [PULL 11/11] vfio/pci: Add option to disable GeForce quirks, Alex Williamson, 2018/02/05
- Re: [Qemu-devel] [PULL 00/11] VFIO updates 2018-02-05, Peter Maydell, 2018/02/06