mirror of https://gitee.com/openkylin/libvirt.git
node_device: mdev matrix support
Allow mdev devices to be created on the matrix device. Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
09364608b4
commit
a0ab006d5a
|
@ -662,6 +662,10 @@ nodeDeviceFindAddressByName(const char *name)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case VIR_NODE_DEV_CAP_AP_MATRIX:
|
||||||
|
addr = g_strdup(caps->data.ap_matrix.addr);
|
||||||
|
break;
|
||||||
|
|
||||||
case VIR_NODE_DEV_CAP_SYSTEM:
|
case VIR_NODE_DEV_CAP_SYSTEM:
|
||||||
case VIR_NODE_DEV_CAP_USB_DEV:
|
case VIR_NODE_DEV_CAP_USB_DEV:
|
||||||
case VIR_NODE_DEV_CAP_USB_INTERFACE:
|
case VIR_NODE_DEV_CAP_USB_INTERFACE:
|
||||||
|
@ -680,7 +684,6 @@ nodeDeviceFindAddressByName(const char *name)
|
||||||
case VIR_NODE_DEV_CAP_VDPA:
|
case VIR_NODE_DEV_CAP_VDPA:
|
||||||
case VIR_NODE_DEV_CAP_AP_CARD:
|
case VIR_NODE_DEV_CAP_AP_CARD:
|
||||||
case VIR_NODE_DEV_CAP_AP_QUEUE:
|
case VIR_NODE_DEV_CAP_AP_QUEUE:
|
||||||
case VIR_NODE_DEV_CAP_AP_MATRIX:
|
|
||||||
case VIR_NODE_DEV_CAP_LAST:
|
case VIR_NODE_DEV_CAP_LAST:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1235,12 +1235,16 @@ udevProcessAPQueue(struct udev_device *device,
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
udevProcessAPMatrix(virNodeDeviceDefPtr def)
|
udevProcessAPMatrix(struct udev_device *device,
|
||||||
|
virNodeDeviceDefPtr def)
|
||||||
{
|
{
|
||||||
/* Both udev_device_get_sysname and udev_device_get_subsystem return
|
/* Both udev_device_get_sysname and udev_device_get_subsystem return
|
||||||
* "matrix" for an AP matrix device, so in order to prevent confusion in
|
* "matrix" for an AP matrix device, so in order to prevent confusion in
|
||||||
* naming, let's fallback to hardcoding the name.
|
* naming, let's fallback to hardcoding the name.
|
||||||
*/
|
*/
|
||||||
|
virNodeDevCapDataPtr data = &def->caps->data;
|
||||||
|
|
||||||
|
data->ap_matrix.addr = g_strdup(udev_device_get_sysname(device));
|
||||||
def->name = g_strdup("ap_matrix");
|
def->name = g_strdup("ap_matrix");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1387,7 +1391,7 @@ udevGetDeviceDetails(struct udev_device *device,
|
||||||
case VIR_NODE_DEV_CAP_AP_QUEUE:
|
case VIR_NODE_DEV_CAP_AP_QUEUE:
|
||||||
return udevProcessAPQueue(device, def);
|
return udevProcessAPQueue(device, def);
|
||||||
case VIR_NODE_DEV_CAP_AP_MATRIX:
|
case VIR_NODE_DEV_CAP_AP_MATRIX:
|
||||||
return udevProcessAPMatrix(def);
|
return udevProcessAPMatrix(device, def);
|
||||||
case VIR_NODE_DEV_CAP_MDEV_TYPES:
|
case VIR_NODE_DEV_CAP_MDEV_TYPES:
|
||||||
case VIR_NODE_DEV_CAP_SYSTEM:
|
case VIR_NODE_DEV_CAP_SYSTEM:
|
||||||
case VIR_NODE_DEV_CAP_FC_HOST:
|
case VIR_NODE_DEV_CAP_FC_HOST:
|
||||||
|
|
Loading…
Reference in New Issue