Ticket #5 (closed enhancement: fixed)
Persistent drive addresses and a method to leave all drives but one untouched
| Reported by: | scdbackup@… | Owned by: | pygi |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | libburn | Version: | TRUNK |
| Keywords: | Cc: |
Description
Problem:
The official method to address a drive with libburn is to call burn_drive_scan() with the consequence that function open() is applied to any device file that could lead to a burner. open() stalls with devices which are ill or busy even if they are no burners or not intended for use with libburn.
This mandatory systemwide bus scan with any use of libburn makes its usability clearly inferior to the one of cdrecord.
The need for the bus scan is builtin to the current concept of libburn because it does not provide means to depict a drive by a persistent address string. A simple change of device file access permissions is enough to change the burn_drive_scan() result numbering.
Possible solution:
- Define persistent address strings for drives which are only
supposed to change when the sysadmin knowingly manipulates the mapping of device addresses to physical devices.
- Provide API means to address a single drive without the risk
to open any other device file.
Proposal:
For the purpose of cdrskin i implemented a whitelist which has a very small footprint within existing libburn code:
- Persistent address is the device file address as found in
struct burn_drive_info.location .
- The desired drive address is put into a whitelist.
The (currently two) drive enumeration functions of libburn query the whitelist before applying open() to a device. If the whitelist is not empty and if the candidate device is not listed, then open() is skipped and the device gets handled as if it did not offer read-permission. If the whitelist is empty, then all enumerated drives get opened. Thus traditional operation of libburn is not affected as long as the whitelist API functions are not used by the application.
Sorry for the bad readability.
This is because the ticket software does properly respect neither newlines nor blanks nor tabs. (Shiny surface, though)
I wanted to attach the patch. But although it is readable in the edit window the Description Preview is quite misformatted. Where and how do i submit a patch generated by diff -puN ?
How to make plain text formatting show up in the Preview as it was typed into the editor window ?
