From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber de Oliveira Costa Subject: [PATCH] remove duplicate code Date: Tue, 2 Oct 2007 17:36:54 -0300 Message-ID: <11913574143708-git-send-email-gcosta@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org, Glauber de Oliveira Costa To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org 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 --- 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 @@ -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/