本文整理汇总了Python中pyscsi.pyscsi.scsi_command.SCSICommand类的典型用法代码示例。如果您正苦于以下问题:Python SCSICommand类的具体用法?Python SCSICommand怎么用?Python SCSICommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SCSICommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:rosjat,项目名称:python-scsi,代码行数:31,代码来源:scsi_cdb_exchangemedium.py
示例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()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:7,代码来源:scsi_cdb_writesame16.py
示例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)
开发者ID:Katana-Steel,项目名称:python-scsi,代码行数:33,代码来源:scsi_cdb_readelementstatus.py
示例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), )
开发者ID:rosjat,项目名称:python-scsi,代码行数:25,代码来源:scsi_cdb_modesense10.py
示例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)
开发者ID:Katana-Steel,项目名称:python-scsi,代码行数:28,代码来源:scsi_cdb_write12.py
示例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)
开发者ID:Katana-Steel,项目名称:python-scsi,代码行数:29,代码来源:scsi_cdb_modesense10.py
示例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()
开发者ID:sahlberg,项目名称:python-scsi,代码行数:7,代码来源:scsi_cdb_read10.py
示例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)
开发者ID:Katana-Steel,项目名称:python-scsi,代码行数:25,代码来源:scsi_cdb_initelementstatuswithrange.py
示例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()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:8,代码来源:scsi_cdb_testunitready.py
示例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()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:9,代码来源:scsi_cdb_initelementstatuswithrange.py
示例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()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:10,代码来源:scsi_cdb_preventallow_mediumremoval.py
示例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()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:10,代码来源:scsi_cdb_readcapacity10.py
示例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()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:11,代码来源:scsi_cdb_openclose_exportimport_element.py
示例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()
开发者ID:Katana-Steel,项目名称:python-scsi,代码行数:13,代码来源:scsi_cdb_testunitready.py
示例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()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:13,代码来源:scsi_cdb_inquiry.py
示例16: __init__
def __init__(self, scsi, xfer, dest, invert=0):
"""
initialize a new instance
:param scsi:
:param xfer:
:param source:
:param dest:
:param invert:
"""
SCSICommand.__init__(self, scsi, 0, 0)
self.cdb = self.build_cdb(xfer, dest, invert)
self.execute()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:13,代码来源:scsi_cdb_positiontoelement.py
示例17: __init__
def __init__(self,
opcode,
prevent=0):
"""
initialize a new instance
:param opcode: a OpCode instance
:param prevent: prevent can have a value between 0 and 3
"""
SCSICommand.__init__(self,
opcode,
0,
0)
self.cdb = self.build_cdb(prevent)
开发者ID:Katana-Steel,项目名称:python-scsi,代码行数:15,代码来源:scsi_cdb_preventallow_mediumremoval.py
示例18: __init__
def __init__(self, scsi, data, pf=1, sp=0):
"""
initialize a new instance
:param scsi: a SCSI instance
:param data: a dict holding mode page to set
:param pf:
:param sp:
"""
_d = ModeSense6.marshall_datain(data)
SCSICommand.__init__(self, scsi, len(_d), 0)
self.dataout = _d
self.cdb = self.build_cdb(pf, sp, len(_d))
self.execute()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:15,代码来源:scsi_cdb_modesense6.py
示例19: __init__
def __init__(self, scsi, xfer, source, dest1, dest2, inv1=0, inv2=0):
"""
initialize a new instance
:param scsi:
:param xfer:
:param source:
:param dest1:
:param dest2:
:param inv1:
:param inv1:
"""
SCSICommand.__init__(self, scsi, 0, 0)
self.cdb = self.build_cdb(xfer, source, dest1, dest2, inv1, inv2)
self.execute()
开发者ID:harapr-fds,项目名称:python-scsi,代码行数:15,代码来源:scsi_cdb_exchangemedium.py
示例20: __init__
def __init__(self,
opcode,
alloclen=8):
"""
initialize a new instance
:param opcode: a OpCode instance
:param alloclen: the max number of bytes allocated for the data_in buffer
"""
SCSICommand.__init__(self,
opcode,
0,
alloclen)
self.cdb = self.build_cdb(opcode=self.opcode.value)
开发者ID:rosjat,项目名称:python-scsi,代码行数:15,代码来源:scsi_cdb_readcapacity10.py
注:本文中的pyscsi.pyscsi.scsi_command.SCSICommand类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论