1
0
mirror of https://github.com/lxc/go-lxc.git synced 2026-02-05 06:46:38 +01:00

convert last fmt.Error to the new format and drop name field

This commit is contained in:
S.Çağlar Onur
2014-02-19 14:45:18 -05:00
parent 7684d1ebc0
commit 8b79782cee
3 changed files with 4 additions and 4 deletions

View File

@@ -29,7 +29,6 @@ type Container struct {
container *C.struct_lxc_container
mu sync.RWMutex
name string
verbosity Verbosity
}
@@ -163,7 +162,7 @@ func (c *Container) Snapshots() ([]Snapshot, error) {
defer freeSnapshots(csnapshots, size)
if size < 1 {
return nil, fmt.Errorf("%s has no snapshots", c.name)
return nil, ErrNoSnapshot
}
p := uintptr(unsafe.Pointer(csnapshots))

View File

@@ -26,7 +26,9 @@ var (
ErrKMemLimit = NewError("your kernel does not support cgroup memory controller")
ErrLoadConfigFailed = NewError("loading config file for the container failed")
ErrMemLimit = NewError("your kernel does not support cgroup memory controller")
ErrMemorySwapLimit = NewError("your kernel does not support cgroup swap controller")
ErrNewFailed = NewError("allocating the container failed")
ErrNoSnapshot = NewError("container has no snapshot")
ErrNotDefined = NewError("container is not defined")
ErrNotFrozen = NewError("container is not frozen")
ErrNotRunning = NewError("container is not running")
@@ -44,7 +46,6 @@ var (
ErrShutdownFailed = NewError("shutting down the container failed")
ErrStartFailed = NewError("starting the container failed")
ErrStopFailed = NewError("stopping the container failed")
ErrMemorySwapLimit = NewError("your kernel does not support cgroup swap controller")
ErrUnfreezeFailed = NewError("unfreezing the container failed")
)

2
lxc.go
View File

@@ -36,7 +36,7 @@ func NewContainer(name string, lxcpath ...string) (*Container, error) {
if container == nil {
return nil, ErrNewFailed
}
return &Container{container: container, verbosity: Quiet, name: name}, nil
return &Container{container: container, verbosity: Quiet}, nil
}
// GetContainer increments the reference counter of the container object.