]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[hyperv] Use instance UUID in device name
authorMichael Brown <mcb30@ipxe.org>
Tue, 26 Jul 2016 15:18:53 +0000 (16:18 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 26 Jul 2016 15:27:12 +0000 (16:27 +0100)
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>
src/include/ipxe/device.h
src/interface/hyperv/vmbus.c

index d81417e8eabcb12143139feacc919f497fcb95c7..d4ba001b0160895481586d37efb4baffeffbf685 100644 (file)
@@ -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 */
index fd809dda47777ed7efdad1f1b6a10cb08c473b49..e269aee29d46a1f29aa7fddcc9581604fa785d23 100644 (file)
@@ -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,