Opened 15 years ago

Closed 5 months ago

#217 closed enhancement (invalid)

Need a way to detach devices

Reported by: Jakub Jermář Owned by:
Priority: major Milestone:
Component: helenos/srv/locsrv Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also: #215, #449

Description

Commands like:

  • ata_bd
  • mbr_part
  • file_bd

create new dev_handles and also nodes under /dev.

There is currently no graceful way to release these resources so the associated dev_handles and nodes will exist in the system until reboot or until the respective server dies.

When implementing support for device detaching, care must be taken not to detach a device which is being currently used. This can be achieved by adding a reference when it is being used (e.g. on mount).

It would also be useful to be able to list what devices belong to what services, e.g.:

# devadm list
dev_handle driver   node
========== =======  =============================
1          rd       bd/initrd
3          -        null0
4          ata_bd   bd/disk0
5          mbr_part bd/disk0p0
6          mbr_part bd/disk0p1
7          mbr_part bd/disk0p2
8          mbr_part bd/disk0p3
9          file_bd  bd/fbdev0

# devadm list mbr_part
dev_handle driver   node
========== =======  =============================
5          mbr_part bd/disk0p0
6          mbr_part bd/disk0p1
7          mbr_part bd/disk0p2
8          mbr_part bd/disk0p3

# devadm detach bd/disk0p0
bd/disk0p0 cannot be detached because it is being used.
# devadm detach bd/disk0p1

# devadm list mbr_part
dev_handle driver   node
========== =======  =============================
5          mbr_part bd/disk0p0
7          mbr_part bd/disk0p2
8          mbr_part bd/disk0p3

Change History (8)

comment:1 by Jakub Jermář, 15 years ago

Component: unspecifiedsrv/devmap
Type: defectenhancement

comment:2 by Jakub Jermář, 14 years ago

Milestone: 0.5.00.5.1

comment:3 by Jiri Svoboda, 14 years ago

This ticket has issues

  • It describes two separate enhancements, not one. Second,
  • The proposition for ability to detach a specified devmap device is incorrect. Devmap devices should be removed when the corresponding driver decides to do so or when it is terminated.

comment:4 by Jiri Svoboda, 13 years ago

As of mainline,1207 DDF supports both anticipated and surprise device removal (but supports needs to be added to USB stack). devctl can be used to administratively detach driver from a device.

You talk here about devmap - now loc. Translating that to current status, it would be nice for locinfo to be able to list services along with responsible servers. Also it would be nice to be able to ask an arbitrary server to terminate. I think the reasonable way to do that is to devise some method to tell any task to terminate gracefully, i.e. something similar to ticket #215.

comment:5 by Jakub Jermář, 13 years ago

Milestone: 0.5.00.5.1

comment:6 by Jiri Svoboda, 13 years ago

See also: #215, #449

comment:7 by Jiri Svoboda, 10 years ago

Milestone: 0.6.0

comment:8 by Jiri Svoboda, 5 months ago

Resolution: invalid
Status: newclosed

I think this ticket is terribly out of date. While we still might want to pursue graceful task termination (#215) and some form of general service management, I think this ticked was not well defined from the start and at this point I don't think it makes any sense anymore.

Note: See TracTickets for help on using tickets.