Merge "db: querry to retrieve all pci device by parent address"

This commit is contained in:
Jenkins 2016-01-05 08:17:12 +00:00 committed by Gerrit Code Review
commit 3dc2055611
2 changed files with 13 additions and 0 deletions

View File

@ -1545,6 +1545,12 @@ def pci_device_get_all_by_instance_uuid(context, instance_uuid):
return IMPL.pci_device_get_all_by_instance_uuid(context, instance_uuid)
def pci_device_get_all_by_parent_addr(context, node_id, parent_addr):
"""Get all PCI devices by parent address."""
return IMPL.pci_device_get_all_by_parent_addr(context, node_id,
parent_addr)
def pci_device_destroy(context, node_id, address):
"""Delete a PCI device record."""
return IMPL.pci_device_destroy(context, node_id, address)

View File

@ -6439,6 +6439,13 @@ def pci_device_get_all_by_node(context, node_id):
all()
def pci_device_get_all_by_parent_addr(context, node_id, parent_addr):
return model_query(context, models.PciDevice).\
filter_by(compute_node_id=node_id).\
filter_by(parent_addr=parent_addr).\
all()
@require_context
@main_context_manager.reader
def pci_device_get_all_by_instance_uuid(context, instance_uuid):