optimize the perf and support more features
This commit is contained in:
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -23,8 +23,8 @@ import (
|
||||
)
|
||||
|
||||
// TargetCreate creates a target in the SCSI Target.
|
||||
func (cli *Client) TargetCreate(ctx context.Context, options api.TargetCreateRequest) (api.SCSITarget, error) {
|
||||
var target api.SCSITarget
|
||||
func (cli *Client) TargetCreate(ctx context.Context, options api.TargetCreateRequest) (*api.SCSITarget, error) {
|
||||
var target *api.SCSITarget
|
||||
resp, err := cli.post(ctx, "/target/create", nil, options, nil)
|
||||
if err != nil {
|
||||
return target, err
|
||||
|
||||
@@ -23,9 +23,9 @@ import (
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// TargetCreate creates a target in the SCSI Target.
|
||||
func (cli *Client) TargetList(ctx context.Context, options api.TargetListOptions) ([]api.SCSITarget, error) {
|
||||
var targets []api.SCSITarget
|
||||
// TargetList lists targets in the SCSI Target.
|
||||
func (cli *Client) TargetList(ctx context.Context, options api.TargetListOptions) ([]*api.SCSITarget, error) {
|
||||
var targets []*api.SCSITarget
|
||||
var query = url.Values{}
|
||||
if options.Name != "" {
|
||||
query.Set("name", options.Name)
|
||||
|
||||
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type SCSICommandType byte
|
||||
@@ -370,7 +370,7 @@ type ModePage struct {
|
||||
PageCode uint8
|
||||
// Sub page code
|
||||
SubPageCode uint8
|
||||
Size uint8
|
||||
Size uint16 // Use uint16 to support pages larger than 255 bytes
|
||||
// Rest of mode page info
|
||||
Data []byte
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user