[block] Add basic multipath support
Add basic support for multipath block devices. The "sanboot" and "sanhook" commands now accept a list of SAN URIs. We open all URIs concurrently. The first connection to become available for issuing block device commands is marked as the active path and used for all subsequent commands; all other connections are then closed. Whenever the active path fails, we reopen all URIs and repeat the process. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -35,16 +35,18 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
/**
|
||||
* Hook dummy SAN device
|
||||
*
|
||||
* @v uri URI
|
||||
* @v drive Drive number
|
||||
* @v uris List of URIs
|
||||
* @v count Number of URIs
|
||||
* @ret drive Drive number, or negative error
|
||||
*/
|
||||
static int dummy_san_hook ( struct uri *uri, unsigned int drive ) {
|
||||
static int dummy_san_hook ( unsigned int drive, struct uri **uris,
|
||||
unsigned int count ) {
|
||||
struct san_device *sandev;
|
||||
int rc;
|
||||
|
||||
/* Allocate SAN device */
|
||||
sandev = alloc_sandev ( uri, 0 );
|
||||
sandev = alloc_sandev ( uris, count, 0 );
|
||||
if ( ! sandev ) {
|
||||
rc = -ENOMEM;
|
||||
goto err_alloc;
|
||||
|
||||
Reference in New Issue
Block a user