This patch removes duplicate code at vl.c. Once the KVM-only
part defines how much physicall memory it wants, the rest should
be the same for everybody.

Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]>
---
 qemu/vl.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/qemu/vl.c b/qemu/vl.c
index fe49d2c..4f8cf51 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -8246,7 +8246,7 @@ int main(int argc, char **argv)
                     help(1);
                 if (ram_size > PHYS_RAM_MAX_SIZE) {
                     fprintf(stderr, "qemu: at most %d MB RAM can be 
simulated\n",
-                            PHYS_RAM_MAX_SIZE / (1024 * 1024));
+                            (int)PHYS_RAM_MAX_SIZE / (1024 * 1024));
                     exit(1);
                 }
                 break;
@@ -8657,20 +8657,15 @@ int main(int argc, char **argv)
                    fprintf(stderr, "Could not create KVM context\n");
                    exit(1);
            }
-    } else {
-           phys_ram_base = qemu_vmalloc(phys_ram_size);
-           if (!phys_ram_base) {
-                   fprintf(stderr, "Could not allocate physical memory\n");
-                   exit(1);
-           }
-    }
-#else
-    phys_ram_base = qemu_vmalloc(phys_ram_size);
-    if (!phys_ram_base) {
-        fprintf(stderr, "Could not allocate physical memory\n");
-        exit(1);
-    }
+    } else
 #endif
+    {
+      phys_ram_base = qemu_vmalloc(phys_ram_size);
+      if (!phys_ram_base) {
+          fprintf(stderr, "Could not allocate physical memory\n");
+          exit(1);
+      }
+    }
 
     /* we always create the cdrom drive, even if no disk is there */
     bdrv_init();
-- 
1.4.4.2


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to