Automatic merge from release/2.7.0 -> release/2.8.0

* commit 'aef848974c9ec2329ac72a910309b3a3b011cfae':
  fix: try to recover image properties(mindisk, format) at startup
This commit is contained in:
邱剑
2019-03-13 16:27:25 +08:00
+1 -1
View File
@@ -1033,7 +1033,7 @@ func (self *SImage) DoCheckStatus(ctx context.Context, userCred mcclient.TokenCr
format := string(img.Format)
virtualSizeMB := int32(img.SizeBytes / 1024 / 1024)
if (len(format) > 0 && self.DiskFormat != format) || (virtualSizeMB > 0 && self.MinDiskMB != virtualSizeMB) {
self.GetModelManager().TableSpec().Update(self, func() error {
db.Update(self, func() error {
if len(format) > 0 {
self.DiskFormat = format
}