summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2016-07-26 17:18:53 +0200
committerMichael Brown2016-07-26 17:27:12 +0200
commit145aae39987b2736ed829bf5ffccaa09b37605fe (patch)
treef6e05702ca2d83077f22578ee32943cdf3736b58 /src
parent[ipv6] Allow for multiple routers (diff)
downloadipxe-145aae39987b2736ed829bf5ffccaa09b37605fe.tar.gz
ipxe-145aae39987b2736ed829bf5ffccaa09b37605fe.tar.xz
ipxe-145aae39987b2736ed829bf5ffccaa09b37605fe.zip
[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>
Diffstat (limited to 'src')
-rw-r--r--src/include/ipxe/device.h2
-rw-r--r--src/interface/hyperv/vmbus.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/include/ipxe/device.h b/src/include/ipxe/device.h
index d81417e8..d4ba001b 100644
--- a/src/include/ipxe/device.h
+++ b/src/include/ipxe/device.h
@@ -72,7 +72,7 @@ struct device_description {
/** A hardware device */
struct device {
/** Name */
- char name[32];
+ char name[40];
/** Driver name */
const char *driver_name;
/** Device description */
diff --git a/src/interface/hyperv/vmbus.c b/src/interface/hyperv/vmbus.c
index fd809dda..e269aee2 100644
--- a/src/interface/hyperv/vmbus.c
+++ b/src/interface/hyperv/vmbus.c
@@ -1121,6 +1121,7 @@ static int vmbus_probe_channels ( struct hv_hypervisor *hv,
const struct vmbus_message_header *header = &vmbus->message->header;
const struct vmbus_offer_channel *offer = &vmbus->message->offer;
const union uuid *type;
+ union uuid instance;
struct vmbus_driver *driver;
struct vmbus_device *vmdev;
struct vmbus_device *tmp;
@@ -1165,8 +1166,11 @@ static int vmbus_probe_channels ( struct hv_hypervisor *hv,
rc = -ENOMEM;
goto err_alloc_vmdev;
}
+ memcpy ( &instance, &offer->instance,
+ sizeof ( instance ) );
+ uuid_mangle ( &instance );
snprintf ( vmdev->dev.name, sizeof ( vmdev->dev.name ),
- "vmbus:%02x", channel );
+ "{%s}", uuid_ntoa ( &instance ) );
vmdev->dev.desc.bus_type = BUS_TYPE_HV;
INIT_LIST_HEAD ( &vmdev->dev.children );
list_add_tail ( &vmdev->dev.siblings,