Skip to content

Commit

Permalink
Fix memory conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuribori committed Aug 17, 2020
1 parent 91a912f commit 8c4a78a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/virt2vmx/convmap.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(fn [_ val]
(let [ival (Integer/parseInt (first val))]
(format "memSize = \"%s\"\n"
(str (/ (- ival (mod ival 4096)) 1024)))))
(let [megabytes (/ (* ival 1024) 1000000)]
(str (- megabytes (mod megabytes 4)))))))
:vcpu
(fn [_ val] (format "numvcpus = \"%s\"\n" (first val)))
:disk
Expand Down

0 comments on commit 8c4a78a

Please sign in to comment.