qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vl: allow not specifying size in -m when using -M memory-backend
@ 2021-05-18 10:35 Paolo Bonzini
  2021-05-18 11:42 ` Igor Mammedov
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2021-05-18 10:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: imammedo, qemu-stable

Starting in QEMU 6.0's commit f5c9fcb82d ("vl: separate
qemu_create_machine", 2020-12-10), a function have_custom_ram_size()
replaced the return value of set_memory_options().

The purpose of the return value was to record the presence of
"-m size", and if it was not there, change the default RAM
size to the size of the memory backend passed with "-M
memory-backend".

With that commit, however, have_custom_ram_size() is now queried only
after set_memory_options has stored the fixed-up RAM size in QemuOpts for
"future use".  This was actually the only future use of the fixed-up RAM
size, so remove that code and fix the bug.

Cc: qemu-stable@nongnu.org
Fixes: f5c9fcb82d ("vl: separate qemu_create_machine", 2020-12-10)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 softmmu/vl.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index ac0ff6e160..21e55718a6 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2039,8 +2039,6 @@ static void set_memory_options(MachineClass *mc)
         exit(EXIT_FAILURE);
     }
 
-    /* store value for the future use */
-    qemu_opt_set_number(opts, "size", ram_size, &error_abort);
     maxram_size = ram_size;
 
     if (qemu_opt_get(opts, "maxmem")) {
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vl: allow not specifying size in -m when using -M memory-backend
  2021-05-18 10:35 [PATCH] vl: allow not specifying size in -m when using -M memory-backend Paolo Bonzini
@ 2021-05-18 11:42 ` Igor Mammedov
  0 siblings, 0 replies; 2+ messages in thread
From: Igor Mammedov @ 2021-05-18 11:42 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-stable

On Tue, 18 May 2021 12:35:31 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:

> Starting in QEMU 6.0's commit f5c9fcb82d ("vl: separate
> qemu_create_machine", 2020-12-10), a function have_custom_ram_size()
> replaced the return value of set_memory_options().
> 
> The purpose of the return value was to record the presence of
> "-m size", and if it was not there, change the default RAM
> size to the size of the memory backend passed with "-M
> memory-backend".
> 
> With that commit, however, have_custom_ram_size() is now queried only
> after set_memory_options has stored the fixed-up RAM size in QemuOpts for
> "future use".  This was actually the only future use of the fixed-up RAM
> size, so remove that code and fix the bug.
> 
> Cc: qemu-stable@nongnu.org
> Fixes: f5c9fcb82d ("vl: separate qemu_create_machine", 2020-12-10)
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  softmmu/vl.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index ac0ff6e160..21e55718a6 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -2039,8 +2039,6 @@ static void set_memory_options(MachineClass *mc)
>          exit(EXIT_FAILURE);
>      }
>  
> -    /* store value for the future use */
> -    qemu_opt_set_number(opts, "size", ram_size, &error_abort);
>      maxram_size = ram_size;
>  
>      if (qemu_opt_get(opts, "maxmem")) {



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-18 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 10:35 [PATCH] vl: allow not specifying size in -m when using -M memory-backend Paolo Bonzini
2021-05-18 11:42 ` Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).