Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
ciao-launcher: Ceph rootfs consumes 0 MB
Browse files Browse the repository at this point in the history
Ensure that we report the correct statistics for VM instances whose rootfs
are stored in a ceph cluster.

Signed-off-by: Mark Ryan <[email protected]>
  • Loading branch information
Mark Ryan committed Sep 15, 2016
1 parent 4f0d6d3 commit 570a79c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ciao-launcher/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,10 @@ func (q *qemuV) monitorVM(closedCh chan struct{}, connectedCh chan struct{},
return qmpChannel
}

func computeInstanceDiskspace(instanceDir string) int {
func (q *qemuV) computeInstanceDiskspace(instanceDir string) int {
if q.cfg.Image == "" {
return 0
}
vmImage := path.Join(instanceDir, "image.qcow2")
fi, err := os.Stat(vmImage)
if err != nil {
Expand All @@ -664,7 +667,7 @@ func computeInstanceDiskspace(instanceDir string) int {
}

func (q *qemuV) stats() (disk, memory, cpu int) {
disk = computeInstanceDiskspace(q.instanceDir)
disk = q.computeInstanceDiskspace(q.instanceDir)
memory = -1
cpu = -1

Expand Down

0 comments on commit 570a79c

Please sign in to comment.