Skip to content

Commit

Permalink
Add Hostnqn to backend
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Nov 29, 2022
1 parent 1ff1c0d commit c39969e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion client/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
13 changes: 7 additions & 6 deletions server/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Subsystem: in.Ctrl.Subnqn,
Hostnqn: in.Ctrl.Hostnqn,
}
var result []BdevNvmeAttachControllerResult
err := call("bdev_nvme_attach_controller", &params, &result)
Expand Down
13 changes: 7 additions & 6 deletions server/spdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c39969e

Please sign in to comment.