本文整理汇总了Python中pyscsi.pyscsi.scsi_command.SCSICommand类的典型用法代码示例。如果您正苦于以下问题:Python SCSICommand类的具体用法?Python SCSICommand怎么用?Python SCSICommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SCSICommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,
opcode,
xfer,
source,
dest1,
dest2,
inv1=0,
inv2=0):
"""
initialize a new instance
:param opcode: a OpCode instance
:param xfer: medium transfer address
:param source: source address
:param dest1: first destination address
:param dest2: second destination address
:param inv1: value indicating if first destination should be inverted
:param inv2: value indicating if scond destination should be inverted
"""
SCSICommand.__init__(self,
opcode,
0,
0)
self.cdb = self.build_cdb(opcode=self.opcode.value,
medium_transport_address=xfer,
source_address=source,
first_destination_address=dest1,
second_destination_address=dest2,
inv1=inv1,
inv2=inv2)
示例2: __init__
def __init__(self, scsi, lba, nb, data, wrprotect=0, anchor=False,
unmap=False, ndob=False, group=0):
SCSICommand.__init__(self, scsi, 0 if ndob else scsi.blocksize, 0)
self.dataout = None if ndob else data
self.cdb = self.build_cdb(lba, nb, wrprotect, anchor, unmap,
ndob, group)
self.execute()
示例3: __init__
def __init__(self,
opcode,
start,
num,
element_type=readelementstatus_enums.ELEMENT_TYPE.ALL,
voltag=0,
curdata=1,
dvcid=0,
alloclen=16384):
"""
initialize a new instance
:param opcode: a OpCode instance
:param start: first element to return
:param num: number of elements to return
:param element_type: type of element to return data for
:param voltag: volume tag, can have a value of 0 or 1
:param curdata: current data, can have a value of 0 or 1
:param dvcid: device id, can have a value of 0 or 1
:param alloclen: the max number of bytes allocated for the data_in buffer
"""
SCSICommand.__init__(self,
opcode,
0,
alloclen)
self.cdb = self.build_cdb(start,
num,
element_type,
voltag,
curdata,
dvcid,
alloclen)
示例4: __init__
def __init__(self,
opcode,
data,
pf=1,
sp=0):
"""
initialize a new instance
:param opcode: a OpCode instance
:param data: a dict holding mode page to set
:param pf: page format value can be 0 or 1
:param sp: save pages value can be 0 or 1
"""
_d = ModeSense10.marshall_datain(data)
SCSICommand.__init__(self,
opcode,
len(_d),
0)
self.dataout = _d
self.cdb = self.build_cdb(10,
opcode=self.opcode.value,
pf=pf,
sp=sp,
parameter_list_length=len(_d), )
示例5: __init__
def __init__(self,
opcode,
blocksize,
lba,
tl,
data,
**kwargs):
"""
initialize a new instance
:param opcode: a OpCode instance
:param blocksize: a blocksize
:param lba: Logical Block Address
:param tl: transfer length
:param data: a byte array with data
:param kwargs: a list of keyword args including wrprotect, dpo, fua and group (all needed in the cdb)
"""
if blocksize == 0:
raise SCSICommand.MissingBlocksizeException
SCSICommand.__init__(self,
opcode,
blocksize * tl,
0)
self.dataout = data
self.cdb = self.build_cdb(lba,
tl,
**kwargs)
示例6: __init__
def __init__(self,
opcode,
page_code,
sub_page_code=0,
llbaa=0,
dbd=0,
pc=0,
alloclen=96):
"""
initialize a new instance
:param opcode: a OpCode instance
:param page_code: the page code for the vpd page
:param sub_page_code: a integer representing a sub page code
:param llbaa: long LBA accepted can be 0 or 1
:param dbd: disable block descriptor can be 0 or 1. If set to 1 server shall not return any block descriptor
:param pc: page control field, a value between 0 and 3
:param alloclen: the max number of bytes allocated for the data_in buffer
"""
SCSICommand.__init__(self,
opcode,
0,
alloclen)
self.cdb = self.build_cdb(page_code,
sub_page_code,
llbaa,
dbd,
pc,
alloclen)
示例7: __init__
def __init__(self, scsi, lba, tl, **kwargs):
if scsi.blocksize == 0:
raise SCSICommand.MissingBlocksizeException
SCSICommand.__init__(self, scsi, 0, scsi.blocksize * tl)
self.cdb = self.build_cdb(lba, tl, **kwargs)
self.execute()
示例8: __init__
def __init__(self,
opcode,
xfer,
elements,
rng=0,
fast=0):
"""
initialize a new instance
:param opcode: a OpCode instance
:param xfer: starting element address
:param elements: number of elements
:param rng: range indicates if all elements should be checked, if set to 1 xfer and elements are ignored
:param fast: fast , if set to 1 scan for media presence only. If set to 0 scan elements for all relevant
status.
"""
SCSICommand.__init__(self,
opcode,
0,
0)
self.cdb = self.build_cdb(xfer,
elements,
rng,
fast)
示例9: __init__
def __init__(self, scsi):
"""
initialize a new instance
:param scsi: a SCSI instance
"""
SCSICommand.__init__(self, scsi, 0, 0)
self.cdb = self.build_cdb()
self.execute()
示例10: __init__
def __init__(self, scsi, xfer, elements, rng=0, fast=0):
"""
initialize a new instance
:param scsi:
"""
SCSICommand.__init__(self, scsi, 0, 0)
self.cdb = self.build_cdb(xfer, elements, rng, fast)
self.execute()
示例11: __init__
def __init__(self, scsi, prevent=0):
"""
initialize a new instance
:param scsi:
:param prevent:
"""
SCSICommand.__init__(self, scsi, 0, 0)
self.cdb = self.build_cdb(prevent)
self.execute()
示例12: __init__
def __init__(self, scsi, alloclen=8):
"""
initialize a new instance
:param scsi: a SCSI instance
:param alloclen: the max number of bytes allocated for the data_in buffer
"""
SCSICommand.__init__(self, scsi, 0, alloclen)
self.cdb = self.build_cdb(alloclen)
self.execute()
示例13: __init__
def __init__(self, scsi, xfer, acode):
"""
initialize a new instance
:param scsi:
:param xfer:
:param acode:
"""
SCSICommand.__init__(self, scsi, 0, 0)
self.cdb = self.build_cdb(xfer, acode)
self.execute()
示例14: __init__
def __init__(self,
opcode):
"""
initialize a new instance
:param opcode: a OpCode instance
"""
SCSICommand.__init__(self,
opcode,
0,
0)
self.cdb = self.build_cdb()
示例15: __init__
def __init__(self, scsi, evpd=0, page_code=0, alloclen=96):
"""
initialize a new instance
:param scsi: a SCSI instance
:param evpd: the byte to enable or disable vital product data
:param page_code: the page code for the vpd page
:param alloclen: the max number of bytes allocated for the data_in buffer
"""
SCSICommand.__init__(self, scsi, 0, alloclen)
self._evpd = evpd
self.cdb = self.build_cdb(evpd, page_code, alloclen)
self.execute()