예제 #1
0
파일: utils.py 프로젝트: dpaterson/cyborg
def _generate_controlpath_id(gpu):
    driver_cpid = driver_controlpath_id.DriverControlPathID()
    # NOTE: GPUs (either pGPU or vGPU), they all report "PCI" as
    # their cpid_type, while attach_handle_type of them are different.
    driver_cpid.cpid_type = "PCI"
    driver_cpid.cpid_info = utils.pci_str_to_json(gpu["devices"])
    return driver_cpid
예제 #2
0
def get_fake_driver_controlpath_objs():
    controlpath_list = get_fake_driver_controlpath_as_dict()
    obj_controlpaths = []
    for controlpath in controlpath_list:
        obj_driver_controlpath = driver_controlpath_id.DriverControlPathID()
        for field in controlpath.keys():
            obj_driver_controlpath[field] = controlpath[field]
        obj_controlpaths.append(obj_driver_controlpath)
    return obj_controlpaths
예제 #3
0
파일: ascend.py 프로젝트: openstack/cyborg
 def _generate_controlpath_id(self, pci):
     driver_cpid = driver_controlpath_id.DriverControlPathID()
     driver_cpid.cpid_type = "PCI"
     driver_cpid.cpid_info = pci["slot_json"]
     return driver_cpid
예제 #4
0
def _generate_controlpath_id(nic):
    driver_cpid = driver_controlpath_id.DriverControlPathID()
    driver_cpid.cpid_type = "PCI"
    driver_cpid.cpid_info = utils.pci_str_to_json(nic["device"])
    return driver_cpid
예제 #5
0
def _generate_controlpath_id(fpga):
    driver_cpid = driver_controlpath_id.DriverControlPathID()
    driver_cpid.cpid_type = "pci"
    driver_cpid.cpid_info = fpga["devices"]
    return driver_cpid
예제 #6
0
def _generate_controlpath_id(gpu):
    driver_cpid = driver_controlpath_id.DriverControlPathID()
    driver_cpid.cpid_type = "PCI"
    driver_cpid.cpid_info = gpu["devices"]
    return driver_cpid