diff options
author | sephe <sephe@FreeBSD.org> | 2016-10-11 07:30:59 +0000 |
---|---|---|
committer | sephe <sephe@FreeBSD.org> | 2016-10-11 07:30:59 +0000 |
commit | e454e6f1254efd4b2d767a04a4e076f85863c58c (patch) | |
tree | 7062d628c193dc4f758f1b55865b14a9e36a53b0 /sys/dev/hyperv/utilities/hv_shutdown.c | |
parent | 5aca196a1235050ca5edda3bcef3ce631a06097b (diff) | |
download | FreeBSD-src-e454e6f1254efd4b2d767a04a4e076f85863c58c.zip FreeBSD-src-e454e6f1254efd4b2d767a04a4e076f85863c58c.tar.gz |
MFC 302698-302704,302706
302698
hyperv/vmbus: Add vmbus method for GUID base device probing.
Reduce the exposure of hv_device.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7024
302699
hyperv/vmbus: All ivars are read-only; nuke unnecessary write_ivar
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7025
302700
hyperv/vmbus: Add channel ivar accessor.
This makes life easier during the transition period to nuke the hv_device.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7026
302701
hyperv/stor: Avoid the hv_device and nuke the broken get_stor_device
This paves way to nuke the hv_device, which is actually an unncessary
indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7027
302702
hyperv/util: Avoid the hv_device
This paves way to nuke the hv_device, which is actually an unncessary
indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7028
302703
hyperv/vmbus: Deprecate the usage of hv_device.
This paves way to nuke the hv_device, which is actually an unncessary
indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7032
302704
hyperv/hn: Avoid the hv_device
This paves way to nuke the hv_device, which is actually an unncessary
indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7033
302706
hyperv: Get rid of hv_device, which is unnecessary indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7034
Diffstat (limited to 'sys/dev/hyperv/utilities/hv_shutdown.c')
-rw-r--r-- | sys/dev/hyperv/utilities/hv_shutdown.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/hyperv/utilities/hv_shutdown.c b/sys/dev/hyperv/utilities/hv_shutdown.c index 3dfbf13..336e911 100644 --- a/sys/dev/hyperv/utilities/hv_shutdown.c +++ b/sys/dev/hyperv/utilities/hv_shutdown.c @@ -41,8 +41,9 @@ #include <dev/hyperv/include/hyperv.h> #include "hv_util.h" +#include "vmbus_if.h" -static hv_guid service_guid = { .data = +static const hv_guid service_guid = { .data = {0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49, 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB} }; @@ -64,7 +65,7 @@ hv_shutdown_cb(void *context) softc = (hv_util_sc*)context; buf = softc->receive_buffer;; - channel = softc->hv_dev->channel; + channel = softc->channel; ret = hv_vmbus_channel_recv_packet(channel, buf, PAGE_SIZE, &recv_len, &request_id); @@ -115,16 +116,13 @@ hv_shutdown_cb(void *context) static int hv_shutdown_probe(device_t dev) { - const char *p = vmbus_get_type(dev); - if (resource_disabled("hvshutdown", 0)) return ENXIO; - if (!memcmp(p, &service_guid, sizeof(hv_guid))) { + if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { device_set_desc(dev, "Hyper-V Shutdown Service"); return BUS_PROBE_DEFAULT; } - return ENXIO; } |