add target port as command flag

This commit is contained in:
Lei Xue
2022-12-13 09:49:34 +08:00
parent cec0938186
commit d94641a8d7
4 changed files with 15 additions and 11 deletions

View File

@@ -192,8 +192,8 @@ func (s *ISCSITargetDriver) HasPortal(tgtName string, tpgt uint16, portal string
}
}
func (s *ISCSITargetDriver) Run() error {
l, err := net.Listen("tcp", ":3260")
func (s *ISCSITargetDriver) Run(port int) error {
l, err := net.Listen("tcp", ":"+strconv.Itoa(port))
if err != nil {
log.Error(err)
os.Exit(1)

View File

@@ -24,7 +24,7 @@ import (
)
type SCSITargetDriver interface {
Run() error
Run(port int) error
NewTarget(string, *config.Config) error
RereadTargetLUNMap()
Close() error