From 5fa29797910346fc0c54829bd979856e83b9b7ea Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 23 Aug 2018 05:05:47 +0000 Subject: Create devctl freeze/thaw. This adds it to devctl, libdevctl, defines the two IOCTLs and implements the kernel bits. causes any new drivers that are added via kldload to be deferred until a 'thaw' comes in. These do not stack: it is an error to freeze while frozen, or thaw while thawed. Differential Revision: https://reviews.freebsd.org/D16735 --- lib/libdevctl/devctl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/libdevctl/devctl.c') diff --git a/lib/libdevctl/devctl.c b/lib/libdevctl/devctl.c index 5013fb0b9d57..9c9ab7805672 100644 --- a/lib/libdevctl/devctl.c +++ b/lib/libdevctl/devctl.c @@ -145,3 +145,17 @@ devctl_delete(const char *device, bool force) return (devctl_simple_request(DEV_DELETE, device, force ? DEVF_FORCE_DELETE : 0)); } + +int +devctl_freeze(void) +{ + + return (devctl_simple_request(DEV_FREEZE, "", 0)); +} + +int +devctl_thaw(void) +{ + + return (devctl_simple_request(DEV_THAW, "", 0)); +} -- cgit v1.3