L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Block_device::Device_mgr< DEV, FACTORY, SCHEDULER > Class Template Reference

Basic class that scans devices and handles client connections. More...

#include <block_device_mgr.h>

+ Collaboration diagram for Block_device::Device_mgr< DEV, FACTORY, SCHEDULER >:

Public Member Functions

void check_clients ()
 Remove clients where the client IPC gate is no longer valid.
 
void shutdown_event (Shutdown_type type)
 Process a shutdown event on all connections.
 

Static Public Member Functions

static int parse_device_name (std::string const &param, std::string &device)
 Parse and verify a device string parameter.
 

Detailed Description

template<typename DEV, typename FACTORY = Simple_factory<DEV>, typename SCHEDULER = Rr_scheduler<typename FACTORY::Device_type>>
class Block_device::Device_mgr< DEV, FACTORY, SCHEDULER >

Basic class that scans devices and handles client connections.

Template Parameters
DEVBase class for all devices.
FACTORYClass that creates clients and partitions. See Simple_factory for an example of the required interface.
SCHEDULERClass that schedules VIRTIO block requests from all clients.

Definition at line 79 of file block_device_mgr.h.

Member Function Documentation

◆ parse_device_name()

template<typename DEV , typename FACTORY = Simple_factory<DEV>, typename SCHEDULER = Rr_scheduler<typename FACTORY::Device_type>>
static int Block_device::Device_mgr< DEV, FACTORY, SCHEDULER >::parse_device_name ( std::string const &  param,
std::string &  device 
)
inlinestatic

Parse and verify a device string parameter.

Parameters
[in]paramDevice string name parameter.
[out]deviceDevice name extracted from parameter.
Returns
L4 error code.

This function tests if 'param' contains one of the following variants of a device name and extracts it into 'device':

  • "partlabel:<label>": 'device' contains "<label>" without conversion.
  • "partuuid:<uuid>": Check if "<uuid>" is a valid UUID and return with error if not. In case of success, 'device' contains "<uuid>" with all characters converted to upper case.
  • "<string>": Check if "<string>" is a valid UUID. If so, 'device' contains "<string>" with all characters converted to upper case. Otherwise, 'device' contains the unmodified "<string>".

Definition at line 383 of file block_device_mgr.h.

References L4_EINVAL, and L4_EOK.


The documentation for this class was generated from the following file: