1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

nodedev: add qeth layer2 and layer3 device types

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Boris Fiuczynski 2025-02-04 18:11:43 +01:00 committed by Michal Privoznik
parent 55e921d5cb
commit 78f72efddc
4 changed files with 20 additions and 2 deletions

View File

@ -78,6 +78,8 @@ VIR_ENUM_IMPL(virNodeDevCap,
VIR_ENUM_IMPL(virNodeDevCCWGroupCap,
VIR_NODE_DEV_CAP_CCWGROUP_LAST,
"qeth_generic",
"qeth_layer2",
"qeth_layer3",
);
VIR_ENUM_IMPL(virNodeDevNetCap,
@ -732,6 +734,8 @@ virNodeDeviceCapCCWGroupDefFormat(virBuffer *buf,
virBufferAdjustIndent(buf, 2);
switch (ccwgroup_dev.type) {
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_GENERIC:
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER2:
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER3:
virNodeDeviceCapCCWGroupQethFormat(buf, &ccwgroup_dev.qeth);
break;
case VIR_NODE_DEV_CAP_CCWGROUP_LAST:
@ -1510,6 +1514,8 @@ virNodeDevCapCCWGroupParseXML(xmlXPathContextPtr ctxt,
switch (ccwgroup_dev->type) {
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_GENERIC:
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER2:
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER3:
if (virNodeDevCapCCWGroupQethParseXML(ctxt, cap_node, &ccwgroup_dev->qeth) < 0)
return -1;
break;
@ -2866,6 +2872,8 @@ virNodeDevCapsDefFree(virNodeDevCapsDef *caps)
g_free(data->ccwgroup_dev.members);
switch (data->ccwgroup_dev.type) {
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_GENERIC:
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER2:
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER3:
virCCWGroupTypeQethFree(&data->ccwgroup_dev.qeth);
break;
case VIR_NODE_DEV_CAP_CCWGROUP_LAST:

View File

@ -80,6 +80,8 @@ typedef enum {
typedef enum {
/* Keep in sync with VIR_ENUM_IMPL in node_device_conf.c */
VIR_NODE_DEV_CAP_CCWGROUP_QETH_GENERIC, /* s390 CCWGROUP QETH generic device */
VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER2, /* s390 CCWGROUP QETH layer 2 device */
VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER3, /* s390 CCWGROUP QETH layer 3 device */
VIR_NODE_DEV_CAP_CCWGROUP_LAST
} virNodeDevCCWGroupCapType;

View File

@ -672,7 +672,11 @@
<define name="capccwgrouptypeqeth">
<attribute name="type">
<value>qeth_generic</value>
<choice>
<value>qeth_generic</value>
<value>qeth_layer2</value>
<value>qeth_layer3</value>
</choice>
</attribute>
<interleave>
<element name="card_type"><text/></element>

View File

@ -1410,6 +1410,8 @@ udevProcessCCWGroup(struct udev_device *device,
switch (data->ccwgroup_dev.type) {
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_GENERIC:
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER2:
case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER3:
{
virCCWGroupTypeQeth *qeth = &data->ccwgroup_dev.qeth;
/* process qeth device information */
@ -1487,7 +1489,9 @@ udevGetDeviceType(struct udev_device *device,
*type = VIR_NODE_DEV_CAP_AP_CARD;
else if (STREQ(devtype, "ap_queue"))
*type = VIR_NODE_DEV_CAP_AP_QUEUE;
else if (STREQ(devtype, "qeth_generic"))
else if (STREQ(devtype, "qeth_generic") ||
STREQ(devtype, "qeth_layer2") ||
STREQ(devtype, "qeth_layer3"))
*type = VIR_NODE_DEV_CAP_CCWGROUP_DEV;
} else {
/* PCI devices don't set the DEVTYPE property. */