[PATCH for-5.0] vl.c: error out if -mem-path is used together with -M memory-backend

Igor Mammedov posted 1 patch 4 years ago
Test docker-quick@centos7 passed
Test FreeBSD passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200409134133.11339-1-imammedo@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>
softmmu/vl.c | 5 +++++
1 file changed, 5 insertions(+)
[PATCH for-5.0] vl.c: error out if -mem-path is used together with -M memory-backend
Posted by Igor Mammedov 4 years ago
the former is not actually used by explicit backend, so instead of
silently ignoring the option in non valid context, exit with error.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 softmmu/vl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 58a40bcfc1..32c0047889 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -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


Re: [PATCH for-5.0] vl.c: error out if -mem-path is used together with -M memory-backend
Posted by Marc-André Lureau 4 years ago
On Thu, Apr 9, 2020 at 3:41 PM Igor Mammedov <imammedo@redhat.com> wrote:
>
> the former is not actually used by explicit backend, so instead of
> silently ignoring the option in non valid context, exit with error.
>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  softmmu/vl.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 58a40bcfc1..32c0047889 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -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
>
>


-- 
Marc-André Lureau