From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Igor Mammedov <imammedo@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 12:55:40 +0000 [thread overview]
Message-ID: <20200317125540.GB3369@work-vm> (raw)
In-Reply-To: <20200317133418.7e084477@redhat.com>
* Igor Mammedov (imammedo@redhat.com) wrote:
> 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 ...
Oops, didn't see that.
(I tripped over this because I hadn't originally realised that it was
an object ID rather than object type with options)
Dave
> >
> > 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 "
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
prev parent reply other threads:[~2020-03-17 12:56 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
2020-03-17 12:55 ` Dr. David Alan Gilbert [this message]
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=20200317125540.GB3369@work-vm \
--to=dgilbert@redhat.com \
--cc=imammedo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.