磁盘大小向上取整 (#385)

This commit is contained in:
屈轩
2019-04-13 21:23:09 +08:00
committed by yunion-ci-robot
parent 6c51431034
commit 98eab54ab7
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ import (
"context"
"fmt"
"io"
"math"
"net/http"
"os"
"os/exec"
@@ -433,7 +434,7 @@ func (self *SImage) SaveImageFromStream(reader io.Reader) error {
self.DiskFormat = format
}
if virtualSizeBytes > 0 {
self.MinDiskMB = int32(virtualSizeBytes / 1024 / 1024)
self.MinDiskMB = int32(math.Ceil(float64(virtualSizeBytes) / 1024 / 1024))
}
return nil
})