Skip to content

Commit

Permalink
gofmt: apply gofmt changes
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Harper <[email protected]>
  • Loading branch information
raharper committed Sep 6, 2023
1 parent a101fc7 commit e8cb140
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
5 changes: 2 additions & 3 deletions cmd/machine/cmd/init.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
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,
Expand Down Expand Up @@ -86,7 +85,7 @@ var machineTypes = map[string]string{

func getMachineTypes() []string {
var mTypes []string
for key, _ := range machineTypes {
for key := range machineTypes {
mTypes = append(mTypes, key)
}
sort.Strings(mTypes)
Expand Down
29 changes: 15 additions & 14 deletions pkg/api/qconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package api

import (
"fmt"
"github.com/project-machine/qcli"
"os"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"

"github.com/project-machine/qcli"

log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -66,7 +67,7 @@ func NewDefaultX86Config(name string, numCpus, numMemMB uint32, sockDir string)
SMP: smp,
Memory: mem,
RngDevices: []qcli.RngDevice{
qcli.RngDevice{
{
Driver: qcli.VirtioRng,
ID: "rng0",
Bus: "pcie.0",
Expand All @@ -75,39 +76,39 @@ func NewDefaultX86Config(name string, numCpus, numMemMB uint32, sockDir string)
},
},
CharDevices: []qcli.CharDevice{
qcli.CharDevice{
{
Driver: qcli.LegacySerial,
Backend: qcli.Socket,
ID: "serial0",
Path: filepath.Join(sockDir, "console.sock"),
},
qcli.CharDevice{
{
Driver: qcli.LegacySerial,
Backend: qcli.Socket,
ID: "monitor0",
Path: filepath.Join(sockDir, "monitor.sock"),
},
},
LegacySerialDevices: []qcli.LegacySerialDevice{
qcli.LegacySerialDevice{
{
ChardevID: "serial0",
},
},
MonitorDevices: []qcli.MonitorDevice{
qcli.MonitorDevice{
{
ChardevID: "monitor0",
},
},
QMPSockets: []qcli.QMPSocket{
qcli.QMPSocket{
{
Type: "unix",
Server: true,
NoWait: true,
Name: filepath.Join(sockDir, "qmp.sock"),
},
},
PCIeRootPortDevices: []qcli.PCIeRootPortDevice{
qcli.PCIeRootPortDevice{
{
ID: "root-port.0x4.0",
Bus: "pcie.0",
Chassis: "0x0",
Expand All @@ -116,7 +117,7 @@ func NewDefaultX86Config(name string, numCpus, numMemMB uint32, sockDir string)
Addr: "0x5",
Multifunction: true,
},
qcli.PCIeRootPortDevice{
{
ID: "root-port.0x4.1",
Bus: "pcie.0",
Chassis: "0x1",
Expand Down Expand Up @@ -171,34 +172,34 @@ func NewDefaultAarch64Config(name string, numCpus uint32, numMemMB uint32, sockD
CPUModel: "host",
Memory: mem,
CharDevices: []qcli.CharDevice{
qcli.CharDevice{
{
Driver: qcli.PCISerialDevice,
Backend: qcli.Socket,
ID: "serial0",
Path: "/tmp/console.sock",
},
qcli.CharDevice{
{
Driver: qcli.LegacySerial,
Backend: qcli.Socket,
ID: "monitor0",
Path: filepath.Join(sockDir, "monitor.sock"),
},
},
SerialDevices: []qcli.SerialDevice{
qcli.SerialDevice{
{
Driver: qcli.PCISerialDevice,
ID: "pciser0",
ChardevIDs: []string{"serial0"},
MaxPorts: 1,
},
},
MonitorDevices: []qcli.MonitorDevice{
qcli.MonitorDevice{
{
ChardevID: "monitor0",
},
},
QMPSockets: []qcli.QMPSocket{
qcli.QMPSocket{
{
Type: "unix",
Server: true,
NoWait: true,
Expand Down
4 changes: 1 addition & 3 deletions pkg/api/vm.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/*
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,
Expand Down

0 comments on commit e8cb140

Please sign in to comment.