mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
Automatic merge from release/2.1.0 -> release/2.2.0
* commit '21f1c5f15f775510f08659c5b7298f1adf0b7e0e': 在VM的diskinfo详情中增加image_id和image信息
This commit is contained in:
@@ -188,6 +188,17 @@ func (self *SGuestdisk) GetDetailedJson() *jsonutils.JSONDict {
|
||||
desc.Add(jsonutils.NewString(self.AioMode), "aio_mode")
|
||||
desc.Add(jsonutils.NewString(storage.MediumType), "medium_type")
|
||||
desc.Add(jsonutils.NewString(storage.StorageType), "storage_type")
|
||||
|
||||
imageId := disk.GetTemplateId()
|
||||
if len(imageId) > 0 {
|
||||
desc.Add(jsonutils.NewString(imageId), "image_id")
|
||||
cachedImageObj, _ := CachedimageManager.FetchById(imageId)
|
||||
if cachedImageObj != nil {
|
||||
cachedImage := cachedImageObj.(*SCachedimage)
|
||||
desc.Add(jsonutils.NewString(cachedImage.getName()), "image")
|
||||
}
|
||||
}
|
||||
|
||||
return desc
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user