public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Glauber de Oliveira Costa <gcosta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org,
	Glauber de Oliveira Costa
	<gcosta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] remove duplicate code
Date: Tue,  2 Oct 2007 17:31:41 -0300	[thread overview]
Message-ID: <11913571011888-git-send-email-gcosta@redhat.com> (raw)

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 <gcosta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 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/

             reply	other threads:[~2007-10-02 20:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02 20:31 Glauber de Oliveira Costa [this message]
     [not found] ` <11913571011888-git-send-email-gcosta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-10-02 23:21   ` [PATCH] remove duplicate code Glauber de Oliveira Costa
  -- strict thread matches above, loose matches on Subject: below --
2007-10-02 20:36 Glauber de Oliveira Costa
     [not found] ` <11913574143708-git-send-email-gcosta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-10-07 11:46   ` Avi Kivity
2009-03-22 10:37 Gleb Natapov
2009-03-22 11:11 ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11913571011888-git-send-email-gcosta@redhat.com \
    --to=gcosta-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox