[et-mgmt-tools] [PATCH] Fix memory check in interactive mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

When memory is interactively input to virt-install, memory is not checked.

------------------------------------------------------------
# virt-install --name TEST --hvm
How much RAM should be allocated (in megabytes)? 1
 What would you like to use as the disk (path)?
------------------------------------------------------------

This patch fixes it.


Signed-off-by: Masayuki Sunou <fj1826dm@xxxxxxxxxxxxxxxxx>

Thanks,
Masayuki Sunou.

-------------------------------------------------------------------------------
diff -r 7fd35e3303c6 virt-install
--- a/virt-install	Fri May 25 10:49:47 2007 -0400
+++ b/virt-install	Thu May 31 10:49:20 2007 +0900
@@ -87,14 +87,14 @@ def get_name(name, guest):
 
 def get_memory(memory, guest):
     while 1:
-        memory = prompt_for_input("How much RAM should be allocated (in megabytes)?", memory)
-        if memory < MIN_RAM:
-            print "ERROR: Installs currently require %d megs of RAM." %(MIN_RAM,)
-            print ""
-            memory = None
-            continue
-        try:
-            guest.memory = int(memory)
+        try:
+            memory = int(prompt_for_input("How much RAM should be allocated (in megabytes)?", memory))
+            if memory < MIN_RAM:
+                print "ERROR: Installs currently require %d megs of RAM." %(MIN_RAM,)
+                print ""
+                memory = None
+                continue
+            guest.memory = memory
             break
         except ValueError, e:
             print "ERROR: ", e
-------------------------------------------------------------------------------


[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux