We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
IOCTL_DO_IT
1 parent fd4d4b1 commit 9e0e39dCopy full SHA for 9e0e39d
pkg/client/nbd.go
@@ -23,8 +23,9 @@ var (
23
)
24
25
type Options struct {
26
- ExportName string
27
- BlockSize uint32
+ ExportName string
+ BlockSize uint32
28
+ OnConnected func()
29
}
30
31
func negotiateNewstyle(conn net.Conn) error {
@@ -51,8 +52,9 @@ func negotiateNewstyle(conn net.Conn) error {
51
52
func Connect(conn net.Conn, device *os.File, options *Options) error {
53
if options == nil {
54
options = &Options{
- ExportName: "default",
55
- BlockSize: 0,
+ ExportName: "default",
56
+ BlockSize: 0,
57
+ OnConnected: func() {},
58
59
60
@@ -196,6 +198,10 @@ n:
196
198
return err
197
199
200
201
+ if options.OnConnected != nil {
202
+ options.OnConnected()
203
+ }
204
+
205
if _, _, err := syscall.Syscall(
206
syscall.SYS_IOCTL,
207
device.Fd(),
0 commit comments