mirror of
https://github.com/lxc/go-lxc.git
synced 2026-02-05 06:46:38 +01:00
Add missing comments for exported functions
This commit is contained in:
@@ -452,6 +452,7 @@ func (c *Container) Start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// StartWithArgs starts the container using given arguments.
|
||||
func (c *Container) StartWithArgs(args []string) error {
|
||||
if err := c.makeSure(isNotRunning); err != nil {
|
||||
return err
|
||||
@@ -1178,6 +1179,7 @@ func (c *Container) RunCommandStatus(args []string, options AttachOptions) (int,
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
// RunCommandNoWait runs the given command and returns without waiting it to finish.
|
||||
func (c *Container) RunCommandNoWait(args []string, options AttachOptions) (int, error) {
|
||||
if len(args) == 0 {
|
||||
return -1, ErrInsufficientNumberOfArguments
|
||||
@@ -1591,6 +1593,7 @@ func (c *Container) Restore(opts RestoreOptions) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Migrate migrates the container.
|
||||
func (c *Container) Migrate(cmd uint, opts MigrateOptions) error {
|
||||
if err := c.makeSure(isNotDefined | isGreaterEqualThanLXC20); err != nil {
|
||||
return err
|
||||
@@ -1636,7 +1639,7 @@ func (c *Container) Migrate(cmd uint, opts MigrateOptions) error {
|
||||
|
||||
ret := C.int(C.go_lxc_migrate(c.container, C.uint(cmd), &copts, &extras))
|
||||
if ret != 0 {
|
||||
return fmt.Errorf("migration failed %d\n", ret)
|
||||
return fmt.Errorf("migration failed %d", ret)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -198,6 +198,7 @@ func ActiveContainers(lxcpath ...string) []Container {
|
||||
return containers
|
||||
}
|
||||
|
||||
// VersionNumber returns the LXC version.
|
||||
func VersionNumber() (major int, minor int) {
|
||||
major = C.LXC_VERSION_MAJOR
|
||||
minor = C.LXC_VERSION_MINOR
|
||||
@@ -205,6 +206,7 @@ func VersionNumber() (major int, minor int) {
|
||||
return
|
||||
}
|
||||
|
||||
// VersionAtLeast returns true when the tested version >= current version.
|
||||
func VersionAtLeast(major int, minor int, micro int) bool {
|
||||
if C.LXC_DEVEL == 1 {
|
||||
return true
|
||||
@@ -228,6 +230,7 @@ func VersionAtLeast(major int, minor int, micro int) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsSupportedConfigItem returns true if the key belongs to a supported config item.
|
||||
func IsSupportedConfigItem(key string) bool {
|
||||
configItem := C.CString(key)
|
||||
defer C.free(unsafe.Pointer(configItem))
|
||||
|
||||
11
options.go
11
options.go
@@ -142,7 +142,7 @@ type ConsoleOptions struct {
|
||||
EscapeCharacter rune
|
||||
}
|
||||
|
||||
// DefailtConsoleOptions is a convenient set of options to be used.
|
||||
// DefaultConsoleOptions is a convenient set of options to be used.
|
||||
var DefaultConsoleOptions = ConsoleOptions{
|
||||
Tty: -1,
|
||||
StdinFd: os.Stdin.Fd(),
|
||||
@@ -175,25 +175,26 @@ var DefaultCloneOptions = CloneOptions{
|
||||
Backend: Directory,
|
||||
}
|
||||
|
||||
// CheckpointOptions type is used for defining checkpoint options for CRIU
|
||||
// CheckpointOptions type is used for defining checkpoint options for CRIU.
|
||||
type CheckpointOptions struct {
|
||||
Directory string
|
||||
Stop bool
|
||||
Verbose bool
|
||||
}
|
||||
|
||||
// RestoreOptions type is used for defining restore options for CRIU
|
||||
// RestoreOptions type is used for defining restore options for CRIU.
|
||||
type RestoreOptions struct {
|
||||
Directory string
|
||||
Verbose bool
|
||||
}
|
||||
|
||||
// MigrateOptions type is used for defining migrate options.
|
||||
type MigrateOptions struct {
|
||||
Directory string
|
||||
PredumpDir string
|
||||
ActionScript string
|
||||
Verbose bool
|
||||
Stop bool
|
||||
PredumpDir string
|
||||
PreservesInodes bool
|
||||
ActionScript string
|
||||
GhostLimit uint64
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user