Переглянути джерело

[hyperv] Use instance UUID in device name

The Windows drivers for VMBus devices are enumerated using the
instance UUID rather than the channel number.  Include the instance
UUID within the iPXE device name to allow an iPXE network device to be
more easily associated with the corresponding Windows network device
when debugging.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 роки тому
джерело
коміт
145aae3998
2 змінених файлів з 6 додано та 2 видалено
  1. 1
    1
      src/include/ipxe/device.h
  2. 5
    1
      src/interface/hyperv/vmbus.c

+ 1
- 1
src/include/ipxe/device.h Переглянути файл

72
 /** A hardware device */
72
 /** A hardware device */
73
 struct device {
73
 struct device {
74
 	/** Name */
74
 	/** Name */
75
-	char name[32];
75
+	char name[40];
76
 	/** Driver name */
76
 	/** Driver name */
77
 	const char *driver_name;
77
 	const char *driver_name;
78
 	/** Device description */
78
 	/** Device description */

+ 5
- 1
src/interface/hyperv/vmbus.c Переглянути файл

1121
 	const struct vmbus_message_header *header = &vmbus->message->header;
1121
 	const struct vmbus_message_header *header = &vmbus->message->header;
1122
 	const struct vmbus_offer_channel *offer = &vmbus->message->offer;
1122
 	const struct vmbus_offer_channel *offer = &vmbus->message->offer;
1123
 	const union uuid *type;
1123
 	const union uuid *type;
1124
+	union uuid instance;
1124
 	struct vmbus_driver *driver;
1125
 	struct vmbus_driver *driver;
1125
 	struct vmbus_device *vmdev;
1126
 	struct vmbus_device *vmdev;
1126
 	struct vmbus_device *tmp;
1127
 	struct vmbus_device *tmp;
1165
 				rc = -ENOMEM;
1166
 				rc = -ENOMEM;
1166
 				goto err_alloc_vmdev;
1167
 				goto err_alloc_vmdev;
1167
 			}
1168
 			}
1169
+			memcpy ( &instance, &offer->instance,
1170
+				 sizeof ( instance ) );
1171
+			uuid_mangle ( &instance );
1168
 			snprintf ( vmdev->dev.name, sizeof ( vmdev->dev.name ),
1172
 			snprintf ( vmdev->dev.name, sizeof ( vmdev->dev.name ),
1169
-				   "vmbus:%02x", channel );
1173
+				   "{%s}", uuid_ntoa ( &instance ) );
1170
 			vmdev->dev.desc.bus_type = BUS_TYPE_HV;
1174
 			vmdev->dev.desc.bus_type = BUS_TYPE_HV;
1171
 			INIT_LIST_HEAD ( &vmdev->dev.children );
1175
 			INIT_LIST_HEAD ( &vmdev->dev.children );
1172
 			list_add_tail ( &vmdev->dev.siblings,
1176
 			list_add_tail ( &vmdev->dev.siblings,

Завантаження…
Відмінити
Зберегти