-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathvmdk_executor.go
More file actions
67 lines (50 loc) · 1.36 KB
/
vmdk_executor.go
File metadata and controls
67 lines (50 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// +build linux darwin
// +build !libstorage_storage_executor libstorage_storage_executor_vmdk
package executor
import (
gofig "github.com/akutz/gofig/types"
"github.com/codedellemc/libstorage/api/registry"
"github.com/codedellemc/libstorage/api/types"
"github.com/codedellemc/libstorage/drivers/storage/vmdk"
)
type driver struct {
config gofig.Config
}
func init() {
registry.RegisterStorageExecutor(vmdk.Name, newDriver)
}
func newDriver() types.StorageExecutor {
return &driver{}
}
func (d *driver) Name() string {
return vmdk.Name
}
func (d *driver) Supported(
ctx types.Context,
opts types.Store) (bool, error) {
return true, nil
}
func (d *driver) Init(ctx types.Context, config gofig.Config) error {
d.config = config
return nil
}
// InstanceID returns the local system's InstanceID.
func (d *driver) InstanceID(
ctx types.Context,
opts types.Store) (*types.InstanceID, error) {
iid := &types.InstanceID{Driver: vmdk.Name}
iid.ID = vmdk.Name
return iid, nil
}
// NextDevice returns the next available device.
func (d *driver) NextDevice(
ctx types.Context,
opts types.Store) (string, error) {
return "", nil
}
// LocalDevices returns a map of the system's local devices.
func (d *driver) LocalDevices(
ctx types.Context,
opts *types.LocalDevicesOpts) (*types.LocalDevices, error) {
return &types.LocalDevices{DeviceMap: map[string]string{}}, nil
}