freebsd-dev/usr.sbin/ctld
Marcelo Araujo 8951f05525 Rework CTL frontend & backend options to use nv(3), allow creating multiple
ioctl frontend ports.

This revision introduces two changes to CTL:
- Changes the way options are passed to CTL_LUN_REQ and CTL_PORT_REQ ioctls.
  Removes ctl_be_arg structure and associated logic and replaces it with
  nv(3)-based logic for passing in and out arguments.
- Allows creating multiple ioctl frontend ports using either ctladm(8) or
  ctld(8).
  New frontend ports are represented by /dev/cam/ctl<pp>.<vp> nodes, eg /dev/cam/ctl5.3.
  Those device nodes respond only to CTL_IO ioctl.

New command-line options for ctladm:
# creates new ioctl frontend port with using free pp and vp=0
ctladm port -c
# creates new ioctl frontend port with pp=10 and vp=0
ctladm port -c -O pp=10
# creates new ioctl frontend port with pp=11 and vp=12
ctladm port -c -O pp=11 -O vp=12
# removes port with number 4 (it's a "targ_port" number, not pp number)
ctladm port -r -p 4

New syntax for ctl.conf:
target ... {
    port ioctl/<pp>
    ...
}

target ... {
    port ioctl/<pp>/<vp>
    ...

Note: Most of this work was made by jceel@, thank you.

Submitted by:	jceel
Reworked by:	myself
Reviewed by:	mav (earlier versions and recently during the rework)
Obtained from:  FreeNAS and TrueOS
Relnotes:	Yes
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D9299
2018-05-10 03:50:20 +00:00
..
chap.c Add missing SPDX tags for ctld(8). 2018-01-24 16:37:29 +00:00
ctl.conf.5 Strip trailing whitespace. 2018-04-10 08:14:31 +00:00
ctld.8 minor work smithing... 2018-03-24 04:21:22 +00:00
ctld.c Rework CTL frontend & backend options to use nv(3), allow creating multiple 2018-05-10 03:50:20 +00:00
ctld.h Rework CTL frontend & backend options to use nv(3), allow creating multiple 2018-05-10 03:50:20 +00:00
discovery.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
isns.c Add missing SPDX tags for ctld(8). 2018-01-24 16:37:29 +00:00
isns.h
kernel.c Rework CTL frontend & backend options to use nv(3), allow creating multiple 2018-05-10 03:50:20 +00:00
keys.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
log.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
login.c userland: Fix several typos and minor errors 2017-12-27 03:23:01 +00:00
Makefile Rework CTL frontend & backend options to use nv(3), allow creating multiple 2018-05-10 03:50:20 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
parse.y Rework CTL frontend & backend options to use nv(3), allow creating multiple 2018-05-10 03:50:20 +00:00
pdu.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
token.l various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
uclparse.c Rework CTL frontend & backend options to use nv(3), allow creating multiple 2018-05-10 03:50:20 +00:00