提交 dd451f3a 编写于 作者: O Osier Yang

nodedev_hal: Enumerate scsi generic device

The xml outputed by HAL backend for scsi generic device:

<device>
  <name>pci_8086_2922_scsi_host_scsi_device_lun0_scsi_generic</name>
  <path>/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/scsi_generic/sg0</path>
  <parent>pci_8086_2922_scsi_host_scsi_device_lun0</parent>
  <capability type='scsi_generic'>
    <char>/dev/sg0</char>
  </capability>
</device>
上级 92fd4c09
...@@ -303,6 +303,14 @@ gather_storage_cap(LibHalContext *ctx, const char *udi, ...@@ -303,6 +303,14 @@ gather_storage_cap(LibHalContext *ctx, const char *udi,
return 0; return 0;
} }
static int
gather_scsi_generic_cap(LibHalContext *ctx, const char *udi,
union _virNodeDevCapData *d)
{
(void)get_str_prop(ctx, udi, "scsi_generic.device", &d->sg.path);
return 0;
}
static int static int
gather_system_cap(LibHalContext *ctx, const char *udi, gather_system_cap(LibHalContext *ctx, const char *udi,
...@@ -350,6 +358,7 @@ static caps_tbl_entry caps_tbl[] = { ...@@ -350,6 +358,7 @@ static caps_tbl_entry caps_tbl[] = {
{ "scsi_host", VIR_NODE_DEV_CAP_SCSI_HOST, gather_scsi_host_cap }, { "scsi_host", VIR_NODE_DEV_CAP_SCSI_HOST, gather_scsi_host_cap },
{ "scsi", VIR_NODE_DEV_CAP_SCSI, gather_scsi_cap }, { "scsi", VIR_NODE_DEV_CAP_SCSI, gather_scsi_cap },
{ "storage", VIR_NODE_DEV_CAP_STORAGE, gather_storage_cap }, { "storage", VIR_NODE_DEV_CAP_STORAGE, gather_storage_cap },
{ "scsi_generic", VIR_NODE_DEV_CAP_SCSI_GENERIC, gather_scsi_generic_cap },
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册