@@ -12,6 +12,7 @@ import (
12
12
"github.com/vmware/govmomi/cli"
13
13
"github.com/vmware/govmomi/cli/flags"
14
14
"github.com/vmware/govmomi/object"
15
+ "github.com/vmware/govmomi/vim25/types"
15
16
)
16
17
17
18
type cp struct {
@@ -30,6 +31,7 @@ type target struct {
30
31
31
32
kind bool
32
33
force bool
34
+ spec types.VirtualDiskSpec
33
35
}
34
36
35
37
func (cmd * target ) FileManager () (* object.DatastoreFileManager , error ) {
@@ -71,6 +73,8 @@ func (cmd *target) Register(ctx context.Context, f *flag.FlagSet) {
71
73
72
74
f .BoolVar (& cmd .kind , "t" , true , "Use file type to choose disk or file manager" )
73
75
f .BoolVar (& cmd .force , "f" , false , "If true, overwrite any identically named file at the destination" )
76
+ f .StringVar (& cmd .spec .AdapterType , "a" , string (types .VirtualDiskAdapterTypeLsiLogic ), "Disk adapter" )
77
+ f .StringVar (& cmd .spec .DiskType , "d" , string (types .VirtualDiskTypeThin ), "Disk format" )
74
78
}
75
79
76
80
func (cmd * target ) Process (ctx context.Context ) error {
@@ -130,7 +134,9 @@ func (cmd *cp) Run(ctx context.Context, f *flag.FlagSet) error {
130
134
131
135
cp := m .CopyFile
132
136
if cmd .kind {
133
- cp = m .Copy
137
+ cp = func (ctx context.Context , src string , dst string ) error {
138
+ return m .Copy (ctx , src , dst , & cmd .spec )
139
+ }
134
140
}
135
141
136
142
logger := cmd .ProgressLogger (fmt .Sprintf ("Copying %s to %s..." , src , dst ))
0 commit comments