Merge "config options: Centralise PCI options"
This commit is contained in:
commit
1ae9221b0a
|
@ -57,6 +57,7 @@ from nova.conf import ironic
|
|||
# from nova.conf import neutron
|
||||
# from nova.conf import notification
|
||||
# from nova.conf import osapi_v21
|
||||
from nova.conf import pci
|
||||
# from nova.conf import rdp
|
||||
from nova.conf import scheduler
|
||||
# from nova.conf import security
|
||||
|
@ -115,6 +116,7 @@ ironic.register_opts(CONF)
|
|||
# neutron.register_opts(CONF)
|
||||
# notification.register_opts(CONF)
|
||||
# osapi_v21.register_opts(CONF)
|
||||
pci.register_opts(CONF)
|
||||
# rdp.register_opts(CONF)
|
||||
scheduler.register_opts(CONF)
|
||||
# security.register_opts(CONF)
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
# Copyright (c) 2013 Intel, Inc.
|
||||
# Copyright (c) 2013 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
pci_alias_opt = cfg.MultiStrOpt(
|
||||
'pci_alias',
|
||||
default=[],
|
||||
help='An alias for a PCI passthrough device requirement. This allows '
|
||||
'users to specify the alias in the extra_spec for a flavor, '
|
||||
'without needing to repeat all the PCI property requirements. For '
|
||||
'example: pci_alias = { '
|
||||
'"name": "QuickAssist", '
|
||||
'"product_id": "0443", '
|
||||
'"vendor_id": "8086", '
|
||||
'"device_type": "type-PCI" '
|
||||
'} defines an alias for the Intel QuickAssist card. (multi '
|
||||
'valued).')
|
||||
|
||||
pci_passthrough_whitelist_opt = cfg.MultiStrOpt(
|
||||
'pci_passthrough_whitelist',
|
||||
default=[],
|
||||
help='White list of PCI devices available to VMs. For example: '
|
||||
'pci_passthrough_whitelist = '
|
||||
'[{"vendor_id": "8086", "product_id": "0443"}]')
|
||||
|
||||
ALL_OPTS = [pci_alias_opt,
|
||||
pci_passthrough_whitelist_opt]
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_opts(ALL_OPTS)
|
||||
|
||||
|
||||
def list_opts():
|
||||
# TODO(sfinucan): This should be moved into the PCI group and
|
||||
# oslo_config.cfg.OptGroup used
|
||||
return {'DEFAULT': ALL_OPTS}
|
|
@ -46,8 +46,6 @@ import nova.netconf
|
|||
import nova.notifications
|
||||
import nova.objects.network
|
||||
import nova.paths
|
||||
import nova.pci.request
|
||||
import nova.pci.whitelist
|
||||
import nova.quota
|
||||
import nova.rdp
|
||||
import nova.service
|
||||
|
@ -89,8 +87,6 @@ def list_opts():
|
|||
nova.notifications.notify_opts,
|
||||
nova.objects.network.network_opts,
|
||||
nova.paths.path_opts,
|
||||
nova.pci.request.pci_alias_opts,
|
||||
nova.pci.whitelist.pci_opts,
|
||||
nova.quota.quota_opts,
|
||||
nova.service.service_opts,
|
||||
nova.utils.monkey_patch_opts,
|
||||
|
|
|
@ -39,37 +39,18 @@
|
|||
import copy
|
||||
|
||||
import jsonschema
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
|
||||
import nova.conf
|
||||
from nova import exception
|
||||
from nova import objects
|
||||
from nova.objects import fields as obj_fields
|
||||
from nova.pci import utils
|
||||
|
||||
pci_alias_opts = [
|
||||
cfg.MultiStrOpt('pci_alias',
|
||||
default=[],
|
||||
help='An alias for a PCI passthrough device requirement. '
|
||||
'This allows users to specify the alias in the '
|
||||
'extra_spec for a flavor, without needing to repeat '
|
||||
'all the PCI property requirements. For example: '
|
||||
'pci_alias = '
|
||||
'{ "name": "QuickAssist", '
|
||||
' "product_id": "0443", '
|
||||
' "vendor_id": "8086", '
|
||||
' "device_type": "type-PCI" '
|
||||
'} '
|
||||
'defines an alias for the Intel QuickAssist card. '
|
||||
'(multi valued)'
|
||||
)
|
||||
]
|
||||
|
||||
PCI_NET_TAG = 'physical_network'
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(pci_alias_opts)
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
_ALIAS_DEV_TYPE = [obj_fields.PciDeviceType.STANDARD,
|
||||
|
|
|
@ -14,22 +14,14 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
import nova.conf
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.pci import devspec
|
||||
|
||||
pci_opts = [cfg.MultiStrOpt('pci_passthrough_whitelist',
|
||||
default=[],
|
||||
help='White list of PCI devices available to VMs. '
|
||||
'For example: pci_passthrough_whitelist = '
|
||||
'[{"vendor_id": "8086", "product_id": "0443"}]'
|
||||
)
|
||||
]
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(pci_opts)
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
|
||||
class Whitelist(object):
|
||||
|
|
Loading…
Reference in New Issue