mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
btrfs: information for the information gods
Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
parent
68a25a5b74
commit
318b11f62f
3 changed files with 32 additions and 1 deletions
|
|
@ -60,7 +60,10 @@ func (d *Driver) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) Status() [][2]string {
|
func (d *Driver) Status() [][2]string {
|
||||||
return nil
|
return [][2]string{
|
||||||
|
{"Build Version", BtrfsBuildVersion()},
|
||||||
|
{"Library Version", fmt.Sprintf("%d", BtrfsLibVersion())},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) Cleanup() error {
|
func (d *Driver) Cleanup() error {
|
||||||
|
|
|
||||||
15
daemon/graphdriver/btrfs/version.go
Normal file
15
daemon/graphdriver/btrfs/version.go
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// +build linux
|
||||||
|
|
||||||
|
package btrfs
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include <btrfs/version.h>
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
func BtrfsBuildVersion() string {
|
||||||
|
return string(C.BTRFS_BUILD_VERSION)
|
||||||
|
}
|
||||||
|
func BtrfsLibVersion() int {
|
||||||
|
return int(C.BTRFS_LIB_VERSION)
|
||||||
|
}
|
||||||
13
daemon/graphdriver/btrfs/version_test.go
Normal file
13
daemon/graphdriver/btrfs/version_test.go
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
// +build linux
|
||||||
|
|
||||||
|
package btrfs
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestBuildVersion(t *testing.T) {
|
||||||
|
if len(BtrfsBuildVersion()) == 0 {
|
||||||
|
t.Errorf("expected output from btrfs build version, but got empty string")
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue