From cf36fd87ad788fa54bcfb21a757ede8dccfb310a Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 18 Aug 2021 14:41:18 +1000 Subject: [PATCH] runtime: Fix some leftover go fmt errors A few "go fmt" errors appear to have crept it. Clean them up with "go fmt ./..." in the src/runtime directory. Signed-off-by: David Gibson --- .../virtcontainers/hypervisor_s390x.go | 2 +- src/runtime/virtcontainers/qemu_arm64.go | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/runtime/virtcontainers/hypervisor_s390x.go b/src/runtime/virtcontainers/hypervisor_s390x.go index b80fce7674..a8afca4ad5 100644 --- a/src/runtime/virtcontainers/hypervisor_s390x.go +++ b/src/runtime/virtcontainers/hypervisor_s390x.go @@ -90,7 +90,7 @@ func availableGuestProtection() (guestProtection, error) { return noneProtection, err } if !seCmdlinePresent { - return noneProtection, fmt.Errorf("Protected Virtualization is not enabled on kernel command line! " + + return noneProtection, fmt.Errorf("Protected Virtualization is not enabled on kernel command line! "+ "Need %s=%s (or %s) to enable Secure Execution", seCmdlineParam, seCmdlineValues[0], strings.Join(seCmdlineValues[1:], ", ")) } diff --git a/src/runtime/virtcontainers/qemu_arm64.go b/src/runtime/virtcontainers/qemu_arm64.go index eced3b044d..d14ec4131b 100644 --- a/src/runtime/virtcontainers/qemu_arm64.go +++ b/src/runtime/virtcontainers/qemu_arm64.go @@ -8,8 +8,8 @@ package virtcontainers import ( "context" "fmt" - "time" "os" + "time" govmmQemu "github.com/kata-containers/govmm/qemu" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" @@ -100,29 +100,29 @@ func (q *qemuArm64) appendImage(ctx context.Context, devices []govmmQemu.Device, // so we temporarily add this specific implementation for arm64 here until // the qemu used by arm64 is capable for that feature func (q *qemuArm64) appendNvdimmImage(devices []govmmQemu.Device, path string) ([]govmmQemu.Device, error) { - imageFile, err := os.Open(path) - if err != nil { - return nil, err - } - defer imageFile.Close() + imageFile, err := os.Open(path) + if err != nil { + return nil, err + } + defer imageFile.Close() - imageStat, err := imageFile.Stat() - if err != nil { - return nil, err - } + imageStat, err := imageFile.Stat() + if err != nil { + return nil, err + } object := govmmQemu.Object{ - Driver: govmmQemu.NVDIMM, - Type: govmmQemu.MemoryBackendFile, - DeviceID: "nv0", - ID: "mem0", - MemPath: path, - Size: (uint64)(imageStat.Size()), - } + Driver: govmmQemu.NVDIMM, + Type: govmmQemu.MemoryBackendFile, + DeviceID: "nv0", + ID: "mem0", + MemPath: path, + Size: (uint64)(imageStat.Size()), + } - devices = append(devices, object) + devices = append(devices, object) - return devices, nil + return devices, nil } func (q *qemuArm64) setIgnoreSharedMemoryMigrationCaps(_ context.Context, _ *govmmQemu.QMP) error {