Codebase list golang-gopkg-lxc-go-lxc.v2 / 2dd0dc9
Merge pull request #142 from tomponline/tp-container-state Container: Check container isn't nil when checking state Stéphane Graber authored 3 years ago GitHub committed 3 years ago
1 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
278278
279279 // Caller needs to hold the lock
280280 func (c *Container) state() State {
281 if c.container == nil {
282 return StateMap["STOPPED"]
283 }
284
281285 return StateMap[C.GoString(C.go_lxc_state(c.container))]
282286 }
283287
19861990
19871991 if o.FSType != "" {
19881992 fstype := C.CString(o.FSType)
1989 specs.fstype = fstype
1993 specs.fstype = fstype
19901994 defer C.free(unsafe.Pointer(fstype))
19911995 }
19921996
1993 if o.FSSize > 0 {
1997 if o.FSSize > 0 {
19941998 specs.fssize = C.uint64_t(o.FSSize)
19951999 }
19962000
1997 if o.ZFS.Root != "" {
2001 if o.ZFS.Root != "" {
19982002 zfsroot := C.CString(o.ZFS.Root)
19992003 specs.zfs.zfsroot = zfsroot
20002004 defer C.free(unsafe.Pointer(zfsroot))
20012005 }
2002
2006
20032007 if o.LVM.VG != "" {
20042008 vg := C.CString(o.LVM.VG)
20052009 specs.lvm.vg = vg