diff --git a/client/backend.go b/client/backend.go index 6ab06165..c94d896f 100644 --- a/client/backend.go +++ b/client/backend.go @@ -18,7 +18,7 @@ func doBackend(ctx context.Context, conn grpc.ClientConnInterface) { if err != nil { log.Fatalf("could not find SPDK IP address") } - rr0, err := c4.NVMfRemoteControllerConnect(ctx, &pb.NVMfRemoteControllerConnectRequest{Ctrl: &pb.NVMfRemoteController{Id: 8, Traddr: addr[0].String(), Trsvcid: 4444, Subnqn: "nqn.2016-06.io.spdk:cnode1"}}) + rr0, err := c4.NVMfRemoteControllerConnect(ctx, &pb.NVMfRemoteControllerConnectRequest{Ctrl: &pb.NVMfRemoteController{Id: 8, Traddr: addr[0].String(), Trsvcid: 4444, Subnqn: "nqn.2016-06.io.spdk:cnode1", Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c"}}) if err != nil { log.Fatalf("could not connect to Remote NVMf controller: %v", err) } diff --git a/client/go.mod b/client/go.mod index 8a2db49d..beb56b89 100644 --- a/client/go.mod +++ b/client/go.mod @@ -3,7 +3,7 @@ module opi.storage.v1 go 1.19 require ( - github.com/opiproject/opi-api v0.0.0-20221121200811-5d2289de810a + github.com/opiproject/opi-api v0.0.0-20221129180238-b10361a9c119 google.golang.org/grpc v1.51.0 ) diff --git a/client/go.sum b/client/go.sum index 330c3c9b..2a864b62 100644 --- a/client/go.sum +++ b/client/go.sum @@ -5,6 +5,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/opiproject/opi-api v0.0.0-20221121200811-5d2289de810a h1:dFFDDQez4aCsKEkvEnQ+yFnMu5/yZ/VWBxbIRmAvgd4= github.com/opiproject/opi-api v0.0.0-20221121200811-5d2289de810a/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= +github.com/opiproject/opi-api v0.0.0-20221129180238-b10361a9c119 h1:exwxNwGuwQtA9IRs2I/Eh22IWeeReAf3uzExgblLytY= +github.com/opiproject/opi-api v0.0.0-20221129180238-b10361a9c119/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= diff --git a/server/backend.go b/server/backend.go index a0da134c..d357476b 100644 --- a/server/backend.go +++ b/server/backend.go @@ -22,12 +22,13 @@ import ( func (s *server) NVMfRemoteControllerConnect(ctx context.Context, in *pb.NVMfRemoteControllerConnectRequest) (*pb.NVMfRemoteControllerConnectResponse, error) { log.Printf("NVMfRemoteControllerConnect: Received from client: %v", in) params := BdevNvmeAttachControllerParams{ - Name: fmt.Sprint("OpiNvme", in.GetCtrl().GetId()), - Type: "TCP", - Address: in.GetCtrl().GetTraddr(), - Family: "ipv4", - Port: fmt.Sprint(in.GetCtrl().GetTrsvcid()), - Subsystem: in.GetCtrl().GetSubnqn(), + Name: fmt.Sprint("OpiNvme", in.Ctrl.Id), + Trtype: "TCP", + Traddr: in.Ctrl.Traddr, + Adrfam: "ipv4", + Trsvcid: fmt.Sprint(in.Ctrl.Trsvcid), + Subnqn: in.Ctrl.Subnqn, + Hostnqn: in.Ctrl.Hostnqn, } var result []BdevNvmeAttachControllerResult err := call("bdev_nvme_attach_controller", ¶ms, &result) diff --git a/server/go.mod b/server/go.mod index 3e3d9b33..cc5c8d16 100644 --- a/server/go.mod +++ b/server/go.mod @@ -3,7 +3,7 @@ module opi.storage.v1 go 1.19 require ( - github.com/opiproject/opi-api v0.0.0-20221121200811-5d2289de810a + github.com/opiproject/opi-api v0.0.0-20221129180238-b10361a9c119 github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 google.golang.org/grpc v1.51.0 google.golang.org/protobuf v1.28.1 diff --git a/server/go.sum b/server/go.sum index 9428e1d3..91b23c89 100644 --- a/server/go.sum +++ b/server/go.sum @@ -5,6 +5,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/opiproject/opi-api v0.0.0-20221121200811-5d2289de810a h1:dFFDDQez4aCsKEkvEnQ+yFnMu5/yZ/VWBxbIRmAvgd4= github.com/opiproject/opi-api v0.0.0-20221121200811-5d2289de810a/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= +github.com/opiproject/opi-api v0.0.0-20221129180238-b10361a9c119 h1:exwxNwGuwQtA9IRs2I/Eh22IWeeReAf3uzExgblLytY= +github.com/opiproject/opi-api v0.0.0-20221129180238-b10361a9c119/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 h1:TtyC78WMafNW8QFfv3TeP3yWNDG+uxNkk9vOrnDu6JA= github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6/go.mod h1:h8272+G2omSmi30fBXiZDMkmHuOgonplfKIKjQWzlfs= golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= diff --git a/server/spdk.go b/server/spdk.go index 122e5d97..20b94089 100644 --- a/server/spdk.go +++ b/server/spdk.go @@ -104,12 +104,13 @@ type BdevCryptoDeleteResult bool // BdevNvmeAttachControllerParams is the parameters required to create a block device based on an NVMe device type BdevNvmeAttachControllerParams struct { - Name string `json:"name"` - Type string `json:"trtype"` - Address string `json:"traddr"` - Family string `json:"adrfam"` - Port string `json:"trsvcid"` - Subsystem string `json:"subnqn"` + Name string `json:"name"` + Trtype string `json:"trtype"` + Traddr string `json:"traddr"` + Hostnqn string `json:"hostnqn"` + Adrfam string `json:"adrfam"` + Trsvcid string `json:"trsvcid"` + Subnqn string `json:"subnqn"` } // BdevNvmeAttachControllerResult is the result of creating a block device based on an NVMe device