summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/utilities/hv_shutdown.c
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-10-14 08:45:53 +0000
committersephe <sephe@FreeBSD.org>2016-10-14 08:45:53 +0000
commit009dae63903789c8d06c154dd9f4e8064d7b924a (patch)
treef0441769d2ab13020c40decfde79faebe9a5fa65 /sys/dev/hyperv/utilities/hv_shutdown.c
parente466e54bdea901149a3ad044a7a3d0761f733766 (diff)
downloadFreeBSD-src-009dae63903789c8d06c154dd9f4e8064d7b924a.zip
FreeBSD-src-009dae63903789c8d06c154dd9f4e8064d7b924a.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.c10
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 2e9bec0..81cd7e0 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;
}
OpenPOWER on IntegriCloud