Procházet zdrojové kódy

[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 před 8 roky
rodič
revize
145aae3998
2 změnil soubory, kde provedl 6 přidání a 2 odebrání
  1. 1
    1
      src/include/ipxe/device.h
  2. 5
    1
      src/interface/hyperv/vmbus.c

+ 1
- 1
src/include/ipxe/device.h Zobrazit soubor

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

+ 5
- 1
src/interface/hyperv/vmbus.c Zobrazit soubor

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

Načítá se…
Zrušit
Uložit