From 6e6a5171244f667ce7a57852e07f95ebd16c00d8 Mon Sep 17 00:00:00 2001 From: Kevin Cui Date: Thu, 25 Jan 2024 09:53:45 +0800 Subject: [PATCH] refactor: improve function comments See: https://tip.golang.org/doc/comment#cmd Signed-off-by: Kevin Cui --- pkg/config/virtio.go | 6 +++--- pkg/rest/vf/vm_config.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/config/virtio.go b/pkg/config/virtio.go index f3b81168..c8631e84 100644 --- a/pkg/config/virtio.go +++ b/pkg/config/virtio.go @@ -82,7 +82,7 @@ type NVMExpressController struct { StorageConfig } -// virtioRng configures a random number generator (RNG) device. +// VirtioRng configures a random number generator (RNG) device. type VirtioRng struct { } @@ -356,7 +356,7 @@ func VirtioNetNew(macAddress string) (*VirtioNet, error) { }, nil } -// Set the socket to use for the network communication +// SetSocket Set the socket to use for the network communication // // This maps the virtual machine network interface to a connected datagram // socket. This means all network traffic on this interface will go through @@ -613,7 +613,7 @@ func (dev *VirtioFs) FromOptions(options []option) error { return nil } -// RosettaShare creates a new rosetta share for running x86_64 binaries on M1 machines. +// RosettaShareNew RosettaShare creates a new rosetta share for running x86_64 binaries on M1 machines. // It will share a directory containing the linux rosetta binaries with the // virtual machine. This directory can be mounted in the VM using `mount -t // virtiofs mountTag /some/dir` diff --git a/pkg/rest/vf/vm_config.go b/pkg/rest/vf/vm_config.go index 82fc7a33..5f5cbbd5 100644 --- a/pkg/rest/vf/vm_config.go +++ b/pkg/rest/vf/vm_config.go @@ -18,7 +18,7 @@ func NewVzVirtualMachine(vm *vz.VirtualMachine, config *vz.VirtualMachineConfigu return &VzVirtualMachine{config: config, VzVM: vm} } -// inspect returns information about the virtual machine like hw resources +// Inspect returns information about the virtual machine like hw resources // and devices func (vm *VzVirtualMachine) Inspect(c *gin.Context) { ii := define.InspectResponse{ @@ -30,7 +30,7 @@ func (vm *VzVirtualMachine) Inspect(c *gin.Context) { c.JSON(http.StatusOK, ii) } -// getVMState retrieves the current vm state +// GetVMState retrieves the current vm state func (vm *VzVirtualMachine) GetVMState(c *gin.Context) { current := vm.GetState() c.JSON(http.StatusOK, gin.H{ @@ -43,7 +43,7 @@ func (vm *VzVirtualMachine) GetVMState(c *gin.Context) { }) } -// setVMState requests a state change on a virtual machine. At this time only +// SetVMState requests a state change on a virtual machine. At this time only // the following states are valid: // Pause - pause a running machine // Resume - resume a paused machine