Skip to content

Commit 71a1fd1

Browse files
committed
feat: implement ublk frontend for v2 data engine - part 2
Implement control plane part longhorn-9456 Signed-off-by: Phan Le <phan.le@suse.com>
1 parent 183d030 commit 71a1fd1

13 files changed

Lines changed: 1126 additions & 1095 deletions

File tree

go.mod

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ go 1.23.0
44

55
toolchain go1.24.2
66

7+
replace (
8+
github.com/longhorn/go-spdk-helper => ../go-spdk-helper
9+
github.com/longhorn/longhorn-spdk-engine => ../longhorn-spdk-engine
10+
github.com/longhorn/types => ../types
11+
)
12+
713
require (
814
github.com/google/uuid v1.6.0
915
github.com/longhorn/backupstore v0.0.0-20250413092739-f882c9e5606b

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,10 @@ github.com/longhorn/go-common-libs v0.0.0-20250412054242-0dd2ad39fd02 h1:WMiKgxZ
114114
github.com/longhorn/go-common-libs v0.0.0-20250412054242-0dd2ad39fd02/go.mod h1:zUt3YlXyj5wI5SC/jI0ayT42NYlVUXJd2is9Azo0DTw=
115115
github.com/longhorn/go-iscsi-helper v0.0.0-20250111093313-7e1930499625 h1:d39A3041RyFve26tIuKUuzrh2CkBY970xlGIXgMA998=
116116
github.com/longhorn/go-iscsi-helper v0.0.0-20250111093313-7e1930499625/go.mod h1:yIm3sGRuYOw/Y3XzRhG5+3FlZBOfrU5EZOavzwL2jVs=
117-
github.com/longhorn/go-spdk-helper v0.0.2-0.20250415000716-f22355d4e0fa h1:Toubcr6ADUkjIANoupTcv7ILpxcVE2u5dHPpoSeXix4=
118-
github.com/longhorn/go-spdk-helper v0.0.2-0.20250415000716-f22355d4e0fa/go.mod h1:k1MUTmyAIXuabuyviT3shOnN618449WqmamtCJlsh4c=
119117
github.com/longhorn/longhorn-engine v1.9.0-dev-20250223.0.20250225091521-921f63f3a87d h1:JdkTIIaKT0uUU80Ncl26JeAqT727PgPJMaqjf0OUfAE=
120118
github.com/longhorn/longhorn-engine v1.9.0-dev-20250223.0.20250225091521-921f63f3a87d/go.mod h1:qTsHK0nU6Myh4XGnuqfsPG4FpeLh7Vki2hLl/1P0iuc=
121-
github.com/longhorn/longhorn-spdk-engine v0.0.0-20250415073054-e79c3d827109 h1:7wbPxxTbds3n8bh0qcBNFQV70vsPY1VEeDJevV476Eo=
122-
github.com/longhorn/longhorn-spdk-engine v0.0.0-20250415073054-e79c3d827109/go.mod h1:LbnlHPNow1B79MLzY7GJVGv6mdsmNMC8uP2ow5Sm56s=
123119
github.com/longhorn/sparse-tools v0.0.0-20241216160947-2b328f0fa59c h1:OFz3haCSPdgiiJvXLBeId/4dPu0dxIEqkQkfNMufLwc=
124120
github.com/longhorn/sparse-tools v0.0.0-20241216160947-2b328f0fa59c/go.mod h1:dfbJqfI8+T9ZCp5zhTYcBi/64hPBNt5/vFF3gTlfMmc=
125-
github.com/longhorn/types v0.0.0-20250410134731-b46ad9302858 h1:1Qe0hwY5i5NMipBg91O2ON4lp3OLO0V1AW7ynQdBtjY=
126-
github.com/longhorn/types v0.0.0-20250410134731-b46ad9302858/go.mod h1:3jHuVDtpkXQzpnp4prguDBskVRric2kmF8aSPkRJ4jw=
127121
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
128122
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
129123
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=

pkg/api/instance.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ type InstanceStatus struct {
7373
TargetPortEnd int32 `json:"targetPortEnd"`
7474
StandbyTargetPortStart int32 `json:"standbyTargetPortStart"`
7575
StandbyTargetPortEnd int32 `json:"standbyTargetPortEnd"`
76+
UblkID int32 `json:"ublk_id"`
7677
}
7778

7879
func RPCToInstanceStatus(obj *rpc.InstanceStatus) InstanceStatus {
@@ -86,6 +87,7 @@ func RPCToInstanceStatus(obj *rpc.InstanceStatus) InstanceStatus {
8687
TargetPortEnd: obj.TargetPortEnd,
8788
StandbyTargetPortStart: obj.StandbyTargetPortStart,
8889
StandbyTargetPortEnd: obj.StandbyTargetPortEnd,
90+
UblkID: obj.UblkId,
8991
}
9092
}
9193

pkg/instance/instance.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ func engineResponseToInstanceResponse(e *spdkapi.Engine) *rpc.InstanceResponse {
812812
StandbyTargetPortStart: e.StandbyTargetPort,
813813
StandbyTargetPortEnd: e.StandbyTargetPort,
814814
Conditions: make(map[string]bool),
815+
UblkId: e.UblkID,
815816
},
816817
}
817818
}

vendor/github.com/longhorn/go-spdk-helper/pkg/initiator/initiator.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/longhorn/go-spdk-helper/pkg/initiator/ublk_id_generator.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/client/ublk.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/ublk.go

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/longhorn/longhorn-spdk-engine/pkg/api/types.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/engine.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)