run the basic process with iscsi driver

This commit is contained in:
Lei Xue
2016-05-02 22:11:33 +08:00
parent d770eb33ac
commit c5d68b38b2
17 changed files with 948 additions and 633 deletions
+8 -44
View File
@@ -16,58 +16,22 @@ limitations under the License.
package scsi
type SCSILuPhyAttribute struct {
SCSIID string
SCSISN string
NumID uint64
VendorID string
ProductID string
ProductRev string
VersionDesction []uint16
// Peripheral device type
DeviceType uint
// Peripheral Qualifier
Qualifier bool
// Removable media
Removable bool
// Read Only media
Readonly bool
// Software Write Protect
SWP bool
// Use thin-provisioning for this LUN
Thinprovisioning bool
// Logical Unit online
Online bool
// Descrptor format sense data supported
SenseFormat bool
// Logical blocks per physical block exponent
Lbppbe int
// Do not update it automatically when the backing file changes
NoLbppbe int
// Lowest aligned LBA
LowestAlignedLBA int
}
import "github.com/gostor/gotgt/pkg/api"
type SCSILuOps struct {
*api.SCSILu
type SCSILu struct {
FD int
Address uint64
Size uint64
Lun uint64
Path string
BsoFlags int
BlockShift uint
ReserveID uint64
DeviceProtocol SCSIDeviceProtocol
Storage *BackingStore
Target *SCSITarget
Attrs SCSILuPhyAttribute
Target *api.SCSITarget
Attrs api.SCSILuPhyAttribute
// function handler for command performing and finishing
PerformCommand CommandFunc
FinishCommand func(*SCSITarget, *SCSICommand)
FinishCommand func(*api.SCSITarget, *api.SCSICommand)
}
func luPreventRemoval(lu *SCSILu) bool {
func luPreventRemoval(lu *api.SCSILu) bool {
// TODO
return false
}