remove duplicate code
PATCH 1/1 remove duplicate code
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(-)
qemu/vl.c +9 -14
@@ -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 ();
Signature · 7 lines
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/
A message that is not in the archive (sent off-list or not yet received): 11913571011888-git-send-email-gcosta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
qemu/vl.c int main(int argc, char **argv) · line 8252
Quoted 9 lines · Glauber de Oliveira Costa
qemu/vl.c +1
-1@@ -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 ;
Ok, this is the wrong version. The above diff is bogus. I'll resend a new one.
Signature · 10 lines
Glauber de Oliveira Costa. "Free as in Freedom" http://glommer.net "The less confident you are, the more serious you have to act." ------------------------------------------------------------------------- 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/