From: Igor Mammedov <imammedo@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH] vl.c/memdev: Error on bad memory backend
Date: Tue, 17 Mar 2020 13:34:18 +0100 [thread overview]
Message-ID: <20200317133418.7e084477@redhat.com> (raw)
In-Reply-To: <20200317120759.49367-1-dgilbert@redhat.com>
On Tue, 17 Mar 2020 12:07:59 +0000
"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> If memory-backend is a non-existent object, qemu crashes.
> Check that the backend actually resolves.
>
> e.g. ./qemu-system-x86_64 -machine pc,accel=kvm,memory-backend=foo
there is a patch to fix it already
[PATCH] softmmu: fix crash with invalid -M memory-backend=
by Marc-André
but looks like it fell through cracks ...
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> softmmu/vl.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index ff2685dff8..76507e99c4 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -4288,6 +4288,11 @@ void qemu_init(int argc, char **argv, char **envp)
>
> backend = object_resolve_path_type(current_machine->ram_memdev_id,
> TYPE_MEMORY_BACKEND, NULL);
> + if (!backend) {
> + error_report("Unknown memory backend object id '%s'",
> + current_machine->ram_memdev_id);
> + exit(EXIT_FAILURE);
> + }
> backend_size = object_property_get_uint(backend, "size", &error_abort);
> if (have_custom_ram_size && backend_size != ram_size) {
> error_report("Size specified by -m option must match size of "
next prev parent reply other threads:[~2020-03-17 12:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-17 12:07 [PATCH] vl.c/memdev: Error on bad memory backend Dr. David Alan Gilbert (git)
2020-03-17 12:34 ` Igor Mammedov [this message]
2020-03-17 12:55 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200317133418.7e084477@redhat.com \
--to=imammedo@redhat.com \
--cc=dgilbert@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).