I'm sponsoring this fasttrack for myself. Minor release binding is requested. The timer is set for 02/06/2009.
-Artem Template Version: @(#)sac_nextcase %I% %G% SMI This information is Copyright 2009 Sun Microsystems 1. Introduction 1.1. Project/Component Working Name: physical eject button 1.2. Name of Document Author/Supplier: Author: Artem Kachitchkine 1.3 Date of This Document: 29 January, 2009 4. Technical Description 4.1. Summary For years, operating systems have allowed users to unmount and eject removable media by pressing the physical eject button located on the drive's front panel. In fact, to a certain class of users, that's the only way they know. We propose to add this feature to Solaris such that pressing the button is functionally equivalent to using eject(1) or mouse-clicking on the corresponding GUI primitive. 4.2. Details device | | GET EVENT STATUS NOTIFICATION v scsi watch | | callback v sd driver | | sysevent v HAL (hald-addon-storage) | | DBus signal / \ / \ GNOME rmvolmgr 4.2.1. Kernel We propose to use the MMC-3 command GET EVENT STATUS NOTIFICATION that reports, among other information: media presence, tray status, and eject requests from the eject button. The same command is used for media polling in Linux, FreeBSD and Windows (we verified versions 98 and XP). So for target devices, Solaris host will look very similar to the other hosts, which should minimize the chances of incompatibilities due to undertested firmware, etc. This command will be added to the kernel scsi watch facility, used by sd(7D) driver to monitor media presence and implement dkio(7I) DKIOCSTATE ioctl. Scsi watch periodically (every 3 seconds) sends either a TEST UNIT READY or a zero-length WRITE to the device, and based on returned status, sd determines if media is present. We propose that scsi watch use GET EVENT STATUS NOTIFICATION on target driver's request. Sd will prefer this command when: controller type is CDROM, and device is MMC compliant, and positively responds to GET EVENT STATUS NOTIFICATION command attempted during driver attach. Otherwise sd will use the current mechanism. We will provide a new SCSA function, scsi_mmc_watch_request_submit(), similar to the existing scsi_watch_request_submit(). By using GET EVENT STATUS NOTIFICATION, sd can provide the very same DKIOCSTATE functionality transparently to applications. In addition, it can detect physical eject button presses and notify applications. We propose that sd emit a sysevent when it detects an eject request: Class: EC_dev_status - existing, introduced in PSARC/2006/373 Subclass: ESC_dev_eject_request - new, part of this case Attribute: phys_path - device path Even with careful implementation and testing, a small chance remains of some MMC devices misbehaving when switched to the new polling command. To facilitate diagnostics in the field, we propose a new sd.conf boolean property 'mmc-gesn-polling': when set to false, sd would use the old polling method for MMC devices. 4.2.2. Userland The sysevent will be consumed by the hal(5) daemon, specifically its storage add-on, responsible for monitoring media state and informing applications via DBus. The HAL API already defines the "EjectPressed" device condition, and GNOME volume manager/GVFS layer already support it by initiating Eject() method in response to the condition. This proposal requires no changes to the GNOME code. Solaris also provides rmvolmgr(1M), the "console volume manager", responsible for automounting in absence of the local desktop session. We propose that rmvolmgr support the new feature, but it be disabled by default, i.e. ignore the "EjectPressed" condition. Our reasoning is to reduce the element of surprise in cases involving headless machines, like accidentally pressing eject on a rack-mounted server, and generally Solaris admins are used to the locked CDROM door with media present. We will provide a boolean SMF property 'eject_button' for svc:/system/filesystem/rmvolmgr:default: when set to true, rmvolmgr will respond to the "EjectPressed" condition. 4.3. Interfaces Exported: --------------------------------+---------------+----------------------- scsi_mmc_watch_request_submit | Cons. Private | scsi watch function ESC_dev_eject_request | Committed | sysevent subclass eject_button | Uncommitted | SMF property mmc-gesn-polling | Uncommitted | sd.conf property --------------------------------+---------------+----------------------- Imported: --------------------------------+---------------+----------------------- EC_dev_status | Committed | sysevent class EjectPressed | Volatile | HAL device condition svc:/system/filesystem/rmvolmgr | Uncommitted | SMF service --------------------------------+---------------+----------------------- 4.4. References PSARC/2005/399 Tamarack: Removable Media Enhancements in Solaris PSARC/2006/373 Dynamic LUN Expansion SCSI Multimedia Commands - 3 (MMC-3) http://www.microsoft.com/whdc/device/storage/GESN_Imp.mspx 6. Resources and Schedule 6.4. Steering Committee requested information 6.4.1. Consolidation C-team Name: ON 6.5. ARC review type: FastTrack 6.6. ARC Exposure: open