diff mbox series

[v5,75/79] make mem_path local variable

Message ID 20200217173452.15243-76-imammedo@redhat.com
State New
Headers show
Series refactor main RAM allocation to use hostmem backend | expand

Commit Message

Igor Mammedov Feb. 17, 2020, 5:34 p.m. UTC
It's no longer used anywhere beside main(),
so make it local variable that is used for CLI compat
purposes to keep -mem-path option working.

Under hood QEMU will use it to create
  memory-backend-file,mem-path=...
backend and use its MemoryRegion as main RAM.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
CC: pbonzini@redhat.com
---
 include/sysemu/sysemu.h | 1 -
 vl.c                    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

Comments

Richard Henderson Feb. 17, 2020, 6:40 p.m. UTC | #1
On 2/17/20 9:34 AM, Igor Mammedov wrote:
> It's no longer used anywhere beside main(),
> so make it local variable that is used for CLI compat
> purposes to keep -mem-path option working.
> 
> Under hood QEMU will use it to create
>   memory-backend-file,mem-path=...
> backend and use its MemoryRegion as main RAM.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> CC: pbonzini@redhat.com
> ---
>  include/sysemu/sysemu.h | 1 -
>  vl.c                    | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index c0678c1ca3..ae78b2a122 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -50,7 +50,6 @@  extern uint8_t *boot_splash_filedata;
 extern bool enable_mlock;
 extern bool enable_cpu_pm;
 extern QEMUClockType rtc_clock;
-extern const char *mem_path;
 extern int mem_prealloc;
 
 #define MAX_OPTION_ROMS 16
diff --git a/vl.c b/vl.c
index a7edcba094..15cc5bd565 100644
--- a/vl.c
+++ b/vl.c
@@ -140,7 +140,6 @@  enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
 int display_opengl;
 const char* keyboard_layout = NULL;
 ram_addr_t ram_size;
-const char *mem_path = NULL;
 int mem_prealloc = 0; /* force preallocation of physical target memory */
 bool enable_mlock = false;
 bool enable_cpu_pm = false;
@@ -2883,6 +2882,7 @@  int main(int argc, char **argv, char **envp)
     Error *err = NULL;
     bool list_data_dirs = false;
     char *dir, **dirs;
+    const char *mem_path = NULL;
     BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
     QemuPluginList plugin_list = QTAILQ_HEAD_INITIALIZER(plugin_list);