提交 c3bbbdbf 编写于 作者: A Alex Williamson

qapi: Create DEFINE_PROP_OFF_AUTO_PCIBAR

Add an option which allows the user to specify a PCI BAR number,
including an 'off' and 'auto' selection.

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Tested-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: NEric Auger <eric.auger@redhat.com>
Tested-by: NEric Auger <eric.auger@redhat.com>
Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
上级 04f336b0
...@@ -1317,3 +1317,14 @@ const PropertyInfo qdev_prop_link = { ...@@ -1317,3 +1317,14 @@ const PropertyInfo qdev_prop_link = {
.name = "link", .name = "link",
.create = create_link_property, .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,
};
...@@ -34,6 +34,7 @@ extern const PropertyInfo qdev_prop_pci_host_devaddr; ...@@ -34,6 +34,7 @@ extern const PropertyInfo qdev_prop_pci_host_devaddr;
extern const PropertyInfo qdev_prop_uuid; extern const PropertyInfo qdev_prop_uuid;
extern const PropertyInfo qdev_prop_arraylen; extern const PropertyInfo qdev_prop_arraylen;
extern const PropertyInfo qdev_prop_link; extern const PropertyInfo qdev_prop_link;
extern const PropertyInfo qdev_prop_off_auto_pcibar;
#define DEFINE_PROP(_name, _state, _field, _prop, _type) { \ #define DEFINE_PROP(_name, _state, _field, _prop, _type) { \
.name = (_name), \ .name = (_name), \
...@@ -214,6 +215,9 @@ extern const PropertyInfo qdev_prop_link; ...@@ -214,6 +215,9 @@ extern const PropertyInfo qdev_prop_link;
DEFINE_PROP(_n, _s, _f, qdev_prop_pci_host_devaddr, PCIHostDeviceAddress) DEFINE_PROP(_n, _s, _f, qdev_prop_pci_host_devaddr, PCIHostDeviceAddress)
#define DEFINE_PROP_MEMORY_REGION(_n, _s, _f) \ #define DEFINE_PROP_MEMORY_REGION(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_ptr, MemoryRegion *) 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) { \ #define DEFINE_PROP_UUID(_name, _state, _field) { \
.name = (_name), \ .name = (_name), \
......
...@@ -100,3 +100,29 @@ ...@@ -100,3 +100,29 @@
{ 'alternate': 'StrOrNull', { 'alternate': 'StrOrNull',
'data': { 's': 'str', 'data': { 's': 'str',
'n': 'null' } } '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' ] }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册