diff --git a/io/file.go b/io/file.go index 957b2d7e..945be4d7 100644 --- a/io/file.go +++ b/io/file.go @@ -233,6 +233,7 @@ func GetDiskStat(path string) (diskStat types.DiskStat, err error) { DiskID: fsidFormatted, Path: path, Type: usage.Fstype, + Driver: types.DiskDriverNone, FreeBlocks: int64(statfs.Bfree), TotalBlocks: int64(statfs.Blocks), BlockSize: statfs.Bsize, diff --git a/io/file_test.go b/io/file_test.go index e1be2c5f..241ddecc 100644 --- a/io/file_test.go +++ b/io/file_test.go @@ -606,6 +606,7 @@ func getDiskStat(path string) (*types.DiskStat, error) { DiskID: fsStat.Fsid, Path: fsStat.Path, Type: fsStat.Type, + Driver: types.DiskDriverNone, FreeBlocks: fsStat.FreeBlock, TotalBlocks: fsStat.TotalBlock, BlockSize: fsStat.BlockSize, diff --git a/types/file.go b/types/file.go index 3ebb6c9e..99c035d3 100644 --- a/types/file.go +++ b/types/file.go @@ -6,10 +6,22 @@ import ( var FileLockDefaultTimeout = 24 * time.Hour +type DiskDriver string + +const ( + DiskDriverNone = DiskDriver("") + DiskDriverAio = DiskDriver("aio") + DiskDriverNvme = DiskDriver("nvme") + DiskDriverVirtioScsi = DiskDriver("virtio-scsi") + DiskDriverVirtioBlk = DiskDriver("virtio-blk") +) + type DiskStat struct { DiskID string + Name string Path string Type string + Driver DiskDriver FreeBlocks int64 TotalBlocks int64 BlockSize int64