Skip to content

Commit

Permalink
feat(backingimage): support v2 backing image
Browse files Browse the repository at this point in the history
ref: longhorn/longhorn 6341

Signed-off-by: Jack Lin <[email protected]>
  • Loading branch information
ChanYiLin authored and derekbit committed Dec 9, 2024
1 parent 079275c commit e5a448a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions app/cmd/basic/bdev_lvol.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ func BdevLvolResizeCmd() cli.Command {
Usage: "Specify this or alias",
},
cli.Uint64Flag{
Name: "size",
Name: "size-in-mib",
Required: true,
},
},
Usage: "resize a lvol to a new size: \"resize --alias <LVSTORE NAME>/<LVOL NAME> --size <SIZE>\", or \"resize --uuid <LVOL UUID> --size <SIZE>\"",
Usage: "resize a lvol to a new size: \"resize --alias <LVSTORE NAME>/<LVOL NAME> --size-in-mib <SIZE>\", or \"resize --uuid <LVOL UUID> --size-in-mib <SIZE>\"",
Action: func(c *cli.Context) {
if err := bdevLvolResize(c); err != nil {
logrus.WithError(err).Fatalf("Failed to run resize bdev lvol command")
Expand All @@ -420,7 +420,7 @@ func bdevLvolResize(c *cli.Context) error {
name = c.String("uuid")
}

resized, err := spdkCli.BdevLvolResize(name, c.Uint64("size"))
resized, err := spdkCli.BdevLvolResize(name, c.Uint64("size-in-mib"))
if err != nil {
return err
}
Expand Down
12 changes: 6 additions & 6 deletions app/cmd/nvmecli/nvmecli.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func ConnectCmd() cli.Command {
}

func connect(c *cli.Context) error {
executor, err := util.NewExecutor(c.String("host-proc"))
executor, err := util.NewExecutor(c.GlobalString("host-proc"))
if err != nil {
return err
}
Expand All @@ -131,7 +131,7 @@ func DisconnectCmd() cli.Command {
}

func disconnect(c *cli.Context) error {
executor, err := util.NewExecutor(c.String("host-proc"))
executor, err := util.NewExecutor(c.GlobalString("host-proc"))
if err != nil {
return err
}
Expand Down Expand Up @@ -167,7 +167,7 @@ func GetCmd() cli.Command {
}

func get(c *cli.Context) error {
executor, err := util.NewExecutor(c.String("host-proc"))
executor, err := util.NewExecutor(c.GlobalString("host-proc"))
if err != nil {
return err
}
Expand Down Expand Up @@ -216,7 +216,7 @@ func StartCmd() cli.Command {
}

func start(c *cli.Context) error {
initiator, err := nvme.NewInitiator(c.String("name"), c.String("nqn"), c.String("host-proc"))
initiator, err := nvme.NewInitiator(c.String("name"), c.String("nqn"), c.GlobalString("host-proc"))
if err != nil {
return err
}
Expand Down Expand Up @@ -257,7 +257,7 @@ func StopCmd() cli.Command {
}

func stop(c *cli.Context) error {
initiator, err := nvme.NewInitiator(c.String("name"), c.String("nqn"), c.String("host-proc"))
initiator, err := nvme.NewInitiator(c.String("name"), c.String("nqn"), c.GlobalString("host-proc"))
if err != nil {
return err
}
Expand Down Expand Up @@ -289,7 +289,7 @@ func FlushCmd() cli.Command {
}

func flush(c *cli.Context) error {
executor, err := util.NewExecutor(c.String("host-proc"))
executor, err := util.NewExecutor(c.GlobalString("host-proc"))
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/spdk/client/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ func (c *Client) BdevLvolSetParent(lvol, parent string) (set bool, err error) {
//
// "name": Required. UUID or alias of the logical volume to resize.
//
// "size": Required. Desired size of the logical volume in bytes.
func (c *Client) BdevLvolResize(name string, size uint64) (resized bool, err error) {
// "sizeInMib": Required. Desired size of the logical volume in bytes.
func (c *Client) BdevLvolResize(name string, sizeInMib uint64) (resized bool, err error) {
req := spdktypes.BdevLvolResizeRequest{
Name: name,
Size: size,
Name: name,
SizeInMib: sizeInMib,
}

cmdOutput, err := c.jsonCli.SendCommand("bdev_lvol_resize", req)
Expand Down
4 changes: 2 additions & 2 deletions pkg/spdk/types/lvol.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ type BdevLvolSetParentRequest struct {
}

type BdevLvolResizeRequest struct {
Name string `json:"name"`
Size uint64 `json:"size"`
Name string `json:"name"`
SizeInMib uint64 `json:"size_in_mib"`
}

type BdevLvolShallowCopyRequest struct {
Expand Down

0 comments on commit e5a448a

Please sign in to comment.