A device can now be identified by a protocol and a name. This allows to have multiple types of devices providing the same protocol. The selection of which device manager to use for specific protocol will be added in following patches. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: Ib4a6c323ba6a2a5d36ff958ddc40631fd9329cb1 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11683 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
33 lines
728 B
Python
33 lines
728 B
Python
from ..proto import sma_pb2
|
|
|
|
|
|
class DeviceException(Exception):
|
|
def __init__(self, code, message):
|
|
self.code = code
|
|
self.message = message
|
|
|
|
|
|
class DeviceManager:
|
|
def __init__(self, name, protocol, client):
|
|
self._client = client
|
|
self.protocol = protocol
|
|
self.name = name
|
|
|
|
def init(self, config):
|
|
pass
|
|
|
|
def create_device(self, request):
|
|
raise NotImplementedError()
|
|
|
|
def delete_device(self, request):
|
|
raise NotImplementedError()
|
|
|
|
def attach_volume(self, request):
|
|
raise NotImplementedError()
|
|
|
|
def detach_volume(self, request):
|
|
raise NotImplementedError()
|
|
|
|
def owns_device(self, id):
|
|
raise NotImplementedError()
|