Feature #12685
closedddi_create_minor_node() should take const char * values
100%
Description
The implementation of ddi_create_minor_node(9F) duplicates the node name that is passed to it and generally references the constant string for the node type, without ever changing it. We should change the DDI to take const char * vlaues for this, given the age, it was probably from a time before using const was prevalent. One nice thing is that anything that was passing a char *
can always pass it as a const char *
without any issues.
Updated by Robert Mustacchi almost 2 years ago
To test this I plugged in a usb keyboard and usb mouse and attached a bunch of virtual IP-KVM services to a system (though I was unable to actually test them end-to-end) and verified that the streams modules were pushed according to mdb that I expected based on basic /etc/dacf configuration. I also compared the contents of /devices via a simple find /devices
before and after on the corresponding bits and things were the same.
Here's the ::stream output:
+-----------------------+-----------------------+ | 0xfffffe2d77844b98 | 0xfffffe2d77844aa0 | | conskbd | conskbd | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x0020c022 | flg = 0x0024c032 | +-----------------------+-----------------------+ | ^ v | +-----------------------+-----------------------+ | 0xfffffe2d406ae108 | 0xfffffe2d406ae010 | | usbkbm | usbkbm | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00002022 | flg = 0x00002032 | +-----------------------+-----------------------+ | ^ v | +-----------------------+-----------------------+ | 0xfffffe2d778448f0 | 0xfffffe2d778447f8 | | hid | hid | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00241022 | flg = 0x00201032 | +-----------------------+-----------------------+ +-----------------------+-----------------------+ | 0xfffffe2d3b4778f8 | 0xfffffe2d3b477800 | | consms | consms | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00202022 | flg = 0x00242032 | +-----------------------+-----------------------+ | ^ v | +-----------------------+-----------------------+ | 0xfffffe2d7e6f4ba8 | 0xfffffe2d7e6f4ab0 | | usbms | usbms | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00002022 | flg = 0x00002032 | +-----------------------+-----------------------+ | ^ v | +-----------------------+-----------------------+ | 0xfffffe2d4a964e40 | 0xfffffe2d4a964d48 | | hid | hid | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00241022 | flg = 0x00201032 | +-----------------------+-----------------------+ +-----------------------+-----------------------+ | 0xfffffe2d4ad9d900 | 0xfffffe2d4ad9d808 | | consms | consms | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00202022 | flg = 0x00242032 | +-----------------------+-----------------------+ | ^ v | +-----------------------+-----------------------+ | 0xfffffe2d7e6f4e50 | 0xfffffe2d7e6f4d58 | | usbms | usbms | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00002022 | flg = 0x00002032 | +-----------------------+-----------------------+ | ^ v | +-----------------------+-----------------------+ | 0xfffffe2d4ad9d658 | 0xfffffe2d4ad9d560 | | hid | hid | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00241022 | flg = 0x00201032 | +-----------------------+-----------------------+ +-----------------------+-----------------------+ | 0xfffffe2d42082ba0 | 0xfffffe2d42082aa8 | | conskbd | conskbd | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x0020c022 | flg = 0x0024c032 | +-----------------------+-----------------------+ | ^ v | +-----------------------+-----------------------+ | 0xfffffe2d46e07108 | 0xfffffe2d46e07010 | | usbkbm | usbkbm | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00002022 | flg = 0x00002032 | +-----------------------+-----------------------+ | ^ v | +-----------------------+-----------------------+ | 0xfffffe2d7cbd2ba0 | 0xfffffe2d7cbd2aa8 | | hid | hid | | | | | cnt = 0t0 | cnt = 0t0 | | flg = 0x00241022 | flg = 0x00201032 | +-----------------------+-----------------------+
Updated by Robert Mustacchi almost 2 years ago
Josh also tested this for me by going through and booting up a system with a USB keyboard on the wscons and successfully logged in there, also showing that the necessary streams modules were pushed.
Updated by Robert Mustacchi almost 2 years ago
Review was at https://code.illumos.org/c/illumos-gate/+/638.
Updated by Electric Monk almost 2 years ago
- Status changed from New to Closed
- % Done changed from 80 to 100
git commit 7bcaeddb7bbb778bc9a9c0e0c78b6bb8a3ea0540
commit 7bcaeddb7bbb778bc9a9c0e0c78b6bb8a3ea0540 Author: Robert Mustacchi <rm@fingolfin.org> Date: 2020-05-26T16:29:37.000Z 12685 ddi_create_minor_node() should take const char * values Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Reviewed by: Paul Winder <paul@winders.demon.co.uk> Approved by: Dan McDonald <danmcd@joyent.com>