public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Glauber de Oliveira Costa
	<gcosta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] remove duplicate code
Date: Sun, 07 Oct 2007 13:46:27 +0200	[thread overview]
Message-ID: <4708C713.1040105@qumranet.com> (raw)
In-Reply-To: <11913574143708-git-send-email-gcosta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Glauber de Oliveira Costa wrote:
> 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
> @@ -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();
>   

This touches original qemu lines, which is likely to cause me pain on 
the next merge.  Maybe a goto after the kvm allocation code can remove 
the need to touch that code.

In any case this code is being worked on to be much more similar to 
regular qemu.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

  parent reply	other threads:[~2007-10-07 11:46 UTC|newest]

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

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=4708C713.1040105@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=gcosta-H+wXaHxf7aLQT0dZR+AlfA@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