feat(region): fix ISO size display (#23128)

SGuestcdrom.Size is Byte, not MB

Co-authored-by: happygame <happygame1024@gmail.com>
This commit is contained in:
Zexi Li
2025-08-20 12:08:23 +08:00
committed by GitHub
co-authored by happygame
parent 390feec8ec
commit 90aef7ef0c
+3 -1
View File
@@ -136,7 +136,9 @@ func (self *SGuestcdrom) GetImage() (*SCachedimage, error) {
func (self *SGuestcdrom) GetDetails() string {
if len(self.ImageId) > 0 {
if self.Size > 0 {
return fmt.Sprintf("%s(%s/%dMB)", self.Name, self.ImageId, self.Size)
// Size is stored in bytes, convert to MB for display
sizeMB := self.Size / 1024 / 1024
return fmt.Sprintf("%s(%s/%dMB)", self.Name, self.ImageId, sizeMB)
} else {
return fmt.Sprintf("%s(inserting)", self.ImageId)
}