History log of /freebsd-current/lib/libdevctl/Makefile
Revision Date Author Comments
# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 4c1a82ce 05-Sep-2019 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Create a FreeBSD-utilities package and make it the default one

The default package use to be FreeBSD-runtime but it should only contain
binaries and libs enough to boot to single user and repair the system, it
is also very handy to have a package that can be tranform to a small mfsroot.
So create a new package named FreeBSD-utilities and make it the default one.
Also move a few binaries and lib into this package when it make sense.
Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21506


# a70cba95 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

First pass through library packaging.

Sponsored by: The FreeBSD Foundation


# 64de8019 06-Feb-2015 John Baldwin <jhb@FreeBSD.org>

Add a new device control utility for new-bus devices called devctl. This
allows the user to request administrative changes to individual devices
such as attach or detaching drivers or disabling and re-enabling devices.
- Add a new /dev/devctl2 character device which uses ioctls for device
requests. The ioctls use a common 'struct devreq' which is somewhat
similar to 'struct ifreq'.
- The ioctls identify the device to operate on via a string. This
string can either by the device's name, or it can be a bus-specific
address. (For unattached devices, a bus address is the only way to
locate a device.) Bus drivers register an eventhandler to claim
unrecognized device names that the driver recognizes as a valid address.
Two buses currently support addresses: ACPI recognizes any device
in the ACPI namespace via its full path starting with "\" and
the PCI bus driver recognizes an address specification of
'pci[<domain>:]<bus>:<slot>:<func>' (identical to the PCI selector
strings supported by pciconf).
- To make it easier to cut and paste, change the PnP location string
in the PCI bus driver to output a full PCI selector string rather
than 'slot=<slot> function=<func>'.
- Add a devctl(3) interface in libdevctl which provides a wrapper around
the ioctls and is the preferred interface for other userland code.
- Add a devctl(8) program which is a simple wrapper around the requests
supported by devctl(3).
- Add a device_is_suspended() function to check DF_SUSPENDED.
- Add a resource_unset_value() function that can be used to remove a
hint from the kernel environment. This is used to clear a
hint.<driver>.<unit>.disabled hint when re-enabling a boot-time
disabled device.

Reviewed by: imp (parts)
Requested by: imp (changing PCI location string)
Relnotes: yes


# 6c96553e 23-May-2014 Alan Somers <asomers@FreeBSD.org>

MFP4 zfsd-related changes

Convert libdevctl to use devd's new SEQPACKET socket.
lib/libdevctl/consumer.cc
lib/libdevctl/event_buffer.cc
lib/libdevctl/event_buffer.h
lib/libdevctl/reader.cc
lib/libdevctl/reader.h
Read from the new /var/run/devd.seqpacket.pipe instead of
/var/run/devd.pipe. Since it preserves record boundaries,
we can eliminate all the repacketization code in
EventBuffer::ExtractEvent as well as much supporting code
from the Reader class.

lib/libdevctl/consumer.cc
Make the pipe nonblocking. Previously, we avoided blocking
by using the FIONREAD ioctl, but this is simpler.

cddl/sbin/zfsd/case_file.cc
cddl/sbin/zfsd/tests/zfsd_unittest.cc
cddl/sbin/zfsd/vdev.cc
cddl/sbin/zfsd/zfsd.cc
cddl/sbin/zfsd/zfsd.h
cddl/sbin/zfsd/zfsd_event.cc
Update zfsd according to the libdevctl changes. The only
nontrivial change is to CaseFile::DeSerialize, which
elimintes the use of IStreamReader.

cddl/sbin/zfsd/case_file.cc
For an unknown reason, sometimes the std::ios::failbit
will get set on caseStream. Instead of checking for
!eof(), check for good(). That method checks the
eofbit, errorbit, and failbit.

livdevctl cleanup (from gibbs)
lib/libdevctl/event.cc:
lib/libdevctl/event.h:
Remove the event class's name from its Builder method. It's
perfectly clear that DevfsEvent::Builder() is the DevfsEvent
class's Builder function.

cddl/sbin/zfsd/zfsd.cc:
cddl/sbin/zfsd/zfsd_event.cc:
cddl/sbin/zfsd/zfsd_event.h:
Conform to new libdevct Builder naming convention.

Fix autoreplace by physical path when a hotspare is present
cddl/sbin/zfsd/case_file.cc
Fix logic error in CaseFile::Replace regarding whether the
replacement device is a spare or not.

Reviewed by: gibbs
Sponsored by: Spectra Logic


# 31b1be9c 14-Oct-2013 Alan Somers <asomers@FreeBSD.org>

Extract devctl event processing support out of zfsd and into a new library:
libdevctl.

etc/mtree/BSD.include.dist:
Add the /usr/include/devctl directory to the base system.

lib/Makefile:
lib/libdevctl/Makefile:
Build support for the new library.

lib/libdevctl/consumer.cc:
lib/libdevctl/consumer.h:
cddl/sbin/zfsd/zfsd.cc:
cddl/sbin/zfsd/zfsd.h:
New class, DevCtl::Consumer, from functionality extracted
from ZfsDaemon, which can connect to devd, parse an event
stream, and invoke event handlers.

lib/libdevctl/event.cc:
lib/libdevctl/event.h:
cddl/sbin/zfsd/dev_ctl_event.cc:
cddl/sbin/zfsd/dev_ctl_event.h:
Strip Zfsd specific event handling from Zfsd's event classes
to create DevCtl::Event, DevCtl::DevfsEvent, and
DevCtl::ZfsEvent.

lib/libdevctl/event_buffer.cc:
lib/libdevctl/event_buffer.h:
cddl/sbin/zfsd/zfsd.cc:
cddl/sbin/zfsd/zfsd.h:
DevCtl::EventBuffer: buffer for incoming devctl stream used
to parse/extract individual event strings.

lib/libdevctl/event_factory.cc:
lib/libdevctl/event_factory.h:
cddl/sbin/zfsd/zfsd.cc:
cddl/sbin/zfsd/zfsd.h:
DevCtl::EventFactory: Method map for converting event
strings to Devctl::Event objects.

lib/libdevctl/exception.cc:
lib/libdevctl/exception.h:
cddl/sbin/zfsd/zfsd_exception.cc:
cddl/sbin/zfsd/zfsd_exception.h:
DevCtl::Exception and DevCtl::ParseException, the exceptions
which are thrown by this library.

lib/libdevctl/guid.cc:
lib/libdevctl/guid.h:
cddl/sbin/zfsd/guid.cc:
cddl/sbin/zfsd/guid.h:
DevCtl::Guid: Helper routines for dealing with 64bit GUIDs
such as found in Zfs pools and vdevs.

lib/libdevctl/reader.cc:
lib/libdevctl/reader.h:
cddl/sbin/zfsd/zfsd.cc:
cddl/sbin/zfsd/zfsd.h:
DevCtl::Reader class hierarchy. Used to direct a Consumer
to an event stream (e.g. from devd or a local/saved file).

cddl/sbin/zfsd/zfsd_event.cc:
cddl/sbin/zfsd/zfsd_event.h:
Zfsd specialization of DevCtl::Event types.

cddl/sbin/zfsd/zfsd_exception.cc:
cddl/sbin/zfsd/zfsd_exception.h:
Zfsd specific exception types, now derived from
DevCtl::Excpetion.

cddl/sbin/zfsd/Makefile:
cddl/sbin/zfsd/callout.cc:
cddl/sbin/zfsd/callout.h:
cddl/sbin/zfsd/case_file.cc:
cddl/sbin/zfsd/case_file.h:
cddl/sbin/zfsd/vdev.cc:
cddl/sbin/zfsd/vdev.h:
cddl/sbin/zfsd/vdev_iterator.cc:
cddl/sbin/zfsd/vdev_iterator.h:
cddl/sbin/zfsd/zfsd.cc:
cddl/sbin/zfsd/zfsd.h:
cddl/sbin/zfsd/zfsd_event.cc:
cddl/sbin/zfsd/zfsd_event.h:
cddl/sbin/zfsd/zfsd_exception.cc:
cddl/sbin/zfsd/zfsd_exception.h:
cddl/sbin/zfsd/zfsd_main.cc:
cddl/sbin/zfsd/zpool_list.cc:
cddl/sbin/zfsd/zpool_list.h:
Miscelaneuous refactoring to support using libdevctl instead
of local implementation.

cddl/sbin/zfsd/Makefile:
cddl/sbin/zfsd/Makefile.common:
tools/regression/zfsd/Makefile:
Export common build information for zfsd and its unit tests
to a "Makefile.common".

Submitted by: gibbs
Approved by: ken (mentor)
Sponsored by: Spectra Logic Corporation