blob: 5fa6aa50d1f160b5322931ca8386a373515cce4b (
plain)
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
|
package machine
import "fmt"
type CreateOptions struct {
CPUS uint64
Memory uint64
KernelPath string
Devices []VMDevices
}
type VMDevices struct {
Path string
ReadOnly bool
}
type VM interface {
Create(name string, opts CreateOptions) error
Start(name string) error
Stop(name string) error
}
type TestVM struct {
}
func (vm *TestVM) Create(name string, opts CreateOptions) error {
fmt.Printf("Created: %s\n", name)
return nil
}
func (vm *TestVM) Start(name string) error {
fmt.Printf("Started: %s\n", name)
return nil
}
func (vm *TestVM) Stop(name string) error {
fmt.Printf("Stopped: %s\n", name)
return nil
}
|