Skip to content

Commit e4f4aed

Browse files
committed
Merge remote-tracking branch 'origin/pr/1'
2 parents f453f1f + 1ba5c44 commit e4f4aed

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

cmd/firectl/main.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"strconv"
2222
"strings"
2323

24-
"github.com/awslabs/go-firecracker"
24+
firecracker "github.com/awslabs/go-firecracker"
2525
flags "github.com/jessevdk/go-flags"
2626
log "github.com/sirupsen/logrus"
2727
)
@@ -31,7 +31,7 @@ func validateDriveEntry(entry string) error {
3131
return nil
3232
}
3333

34-
func checkConfig(cfg machine.Config) error {
34+
func checkConfig(cfg firecracker.Config) error {
3535
var err error
3636

3737
// Check for the existence of some required files:
@@ -57,8 +57,8 @@ func checkConfig(cfg machine.Config) error {
5757
return nil
5858
}
5959

60-
func parseBlockDevices(entries []string) ([]machine.BlockDevice, error) {
61-
var devices []machine.BlockDevice
60+
func parseBlockDevices(entries []string) ([]firecracker.BlockDevice, error) {
61+
var devices []firecracker.BlockDevice
6262
for _, entry := range entries {
6363
var path string
6464
if strings.HasSuffix(entry, ":rw") {
@@ -67,7 +67,7 @@ func parseBlockDevices(entries []string) ([]machine.BlockDevice, error) {
6767
path = strings.TrimSuffix(entry, ":ro")
6868
} else {
6969
msg := fmt.Sprintf("Invalid drive specification. Must have :rw or :ro suffix")
70-
return []machine.BlockDevice{}, errors.New(msg)
70+
return []firecracker.BlockDevice{}, errors.New(msg)
7171
}
7272
if path == "" {
7373
return nil, errors.New("Invalid drive specification")
@@ -76,7 +76,7 @@ func parseBlockDevices(entries []string) ([]machine.BlockDevice, error) {
7676
if err != nil {
7777
return nil, err
7878
}
79-
e := machine.BlockDevice{
79+
e := firecracker.BlockDevice{
8080
HostPath: path,
8181
Mode: "rw",
8282
}
@@ -99,18 +99,18 @@ func parseNicConfig(cfg string) (string, string, error) {
9999

100100
// Given a list of string representations of vsock devices,
101101
// return a corresponding slice of machine.VsockDevice objects
102-
func parseVsocks(devices []string) ([]machine.VsockDevice, error) {
103-
var result []machine.VsockDevice
102+
func parseVsocks(devices []string) ([]firecracker.VsockDevice, error) {
103+
var result []firecracker.VsockDevice
104104
for _, entry := range devices {
105105
fields := strings.Split(entry, ":")
106106
if len(fields) != 2 {
107-
return []machine.VsockDevice{}, errors.New("Could not parse")
107+
return []firecracker.VsockDevice{}, errors.New("Could not parse")
108108
}
109109
CID, err := strconv.ParseUint(fields[1], 10, 32)
110110
if err != nil {
111-
return []machine.VsockDevice{}, errors.New("Vsock CID could not be parsed as a number")
111+
return []firecracker.VsockDevice{}, errors.New("Vsock CID could not be parsed as a number")
112112
}
113-
dev := machine.VsockDevice{
113+
dev := firecracker.VsockDevice{
114114
Path: fields[0],
115115
CID: uint32(CID),
116116
}
@@ -162,24 +162,24 @@ func main() {
162162
logger.SetLevel(log.DebugLevel)
163163
}
164164

165-
var NICs []machine.NetworkInterface
165+
var NICs []firecracker.NetworkInterface
166166

167167
if len(opts.FcNicConfig) > 0 {
168168
tapDev, tapMacAddr, err := parseNicConfig(opts.FcNicConfig)
169169
if err != nil {
170170
log.Fatalf("Unable to parse NIC config: %s", err)
171171
} else {
172172
log.Printf("Adding tap device %s", tapDev)
173-
NICs = []machine.NetworkInterface{
174-
machine.NetworkInterface{
173+
NICs = []firecracker.NetworkInterface{
174+
firecracker.NetworkInterface{
175175
MacAddress: tapMacAddr,
176176
HostDevName: tapDev,
177177
},
178178
}
179179
}
180180
}
181181

182-
rootDrive := machine.BlockDevice{HostPath: opts.FcRootDrivePath, Mode: "rw"}
182+
rootDrive := firecracker.BlockDevice{HostPath: opts.FcRootDrivePath, Mode: "rw"}
183183

184184
blockDevices, err := parseBlockDevices(opts.FcAdditionalDrives)
185185
if err != nil {
@@ -191,7 +191,7 @@ func main() {
191191
log.Fatalf("Invalid vsock specification: %s", err)
192192
}
193193

194-
fcCfg := machine.Config{
194+
fcCfg := firecracker.Config{
195195
BinPath: opts.FcBinary,
196196
SocketPath: "./firecracker.sock",
197197
LogFifo: opts.FcLogFifo,
@@ -206,7 +206,7 @@ func main() {
206206
VsockDevices: vsocks,
207207
Console: opts.FcConsole,
208208
CPUCount: opts.FcCPUCount,
209-
CPUTemplate: machine.CPUTemplate(opts.FcCPUTemplate),
209+
CPUTemplate: firecracker.CPUTemplate(opts.FcCPUTemplate),
210210
HtEnabled: !opts.FcDisableHt,
211211
MemInMiB: opts.FcMemSz,
212212
}
@@ -216,8 +216,8 @@ func main() {
216216
log.Fatalf("Configuration error: %s", err)
217217
}
218218

219-
fireracker := machine.NewFirecrackerClient(fcCfg.SocketPath)
220-
m := machine.NewMachine(fcCfg, fireracker, logger)
219+
fireracker := firecracker.NewFirecrackerClient(fcCfg.SocketPath)
220+
m := firecracker.NewMachine(fcCfg, fireracker, logger)
221221

222222
ctx := context.Background()
223223
vmmCtx, vmmCancel := context.WithCancel(ctx)

firecracker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// express or implied. See the License for the specific language governing
1212
// permissions and limitations under the License.
1313

14-
package machine
14+
package firecracker
1515

1616
import (
1717
"context"

machine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// express or implied. See the License for the specific language governing
1212
// permissions and limitations under the License.
1313

14-
package machine
14+
package firecracker
1515

1616
import (
1717
"context"

machine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// express or implied. See the License for the specific language governing
1212
// permissions and limitations under the License.
1313

14-
package machine
14+
package firecracker
1515

1616
import (
1717
"context"

swagger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
//go:generate docker run --rm -v $PWD:/work -w /work quay.io/goswagger/swagger generate model -f ./client/swagger.yaml --model-package=client/models --client-package=client --copyright-file=COPYRIGHT_HEADER
1616
//go:generate docker run --rm -v $PWD:/work -w /work quay.io/goswagger/swagger generate client -f ./client/swagger.yaml --model-package=client/models --client-package=client --copyright-file=COPYRIGHT_HEADER
1717

18-
package machine
18+
package firecracker

0 commit comments

Comments
 (0)