Skip to contentSkip to conversation

vl.c: error out if -mem-path is used together with -M memory-backend

PATCH In review Igor Mammedov 2 participants 2 messages Apr 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vl.c: error out if -mem-path is used together with -M memory-backend

the former is not actually used by explicit backend, so instead of silently ignoring the option in non valid context, exit with error.

---
 softmmu/vl.c | 5 +++++
 1 file changed, 5 insertions(+)
softmmu/vl.c +5 -0
index 58a40bcfc1..32c0047889 100644
@@ -4315,6 +4315,11 @@ void qemu_init(int argc, char **argv, char **envp)
                              "explicitly specified 'memory-backend' property");
                 exit(EXIT_FAILURE);
         }
+        if (mem_path) {
+            error_report("'-mem-path' can't be used together with"
+                         "'-machine memory-backend'");
+            exit(EXIT_FAILURE);
+        }
         ram_size = backend_size;
     }
 
Signature · 1 line
2.18.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Igor Mammedov

the former is not actually used by explicit backend, so instead of silently ignoring the option in non valid context, exit with error.

Quoted 24 lines
---
 softmmu/vl.c | 5 +++++
 1 file changed, 5 insertions(+)
softmmu/vl.c +5 -1
index 58a40bcfc1..32c0047889 100644
@@ -4315,6 +4315,11 @@ void qemu_init(int argc, char **argv, char **envp)
                              "explicitly specified 'memory-backend' property");
                 exit(EXIT_FAILURE);
         }
+        if (mem_path) {
+            error_report("'-mem-path' can't be used together with"
+                         "'-machine memory-backend'");
+            exit(EXIT_FAILURE);
+        }
         ram_size = backend_size;
     }
 
--

2.18.1

Signature · 1 line
Marc-André Lureau