From: Eduardo Habkost <ehabkost@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, Cleber Rosa <crosa@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] cpu: Fix crash with empty -cpu option
Date: Thu, 18 Apr 2019 10:23:29 -0300 [thread overview]
Message-ID: <20190418132329.GF25134@habkost.net> (raw)
In-Reply-To: <20190418132216.7a53f1ce@redhat.com>
On Thu, Apr 18, 2019 at 01:22:16PM +0200, Igor Mammedov wrote:
> On Thu, 18 Apr 2019 00:45:01 -0300
> Eduardo Habkost <ehabkost@redhat.com> wrote:
>
> > Fix the following crash:
> >
> > $ qemu-system-x86_64 -cpu ''
> > qemu-system-x86_64: qom/cpu.c:291: cpu_class_by_name: \
> > Assertion `cpu_model && cc->class_by_name' failed.
> >
> > Regression test script included.
> >
> > Fixes: commit 99193d8f2ef5 ("cpu: drop unnecessary NULL check and cpu_common_class_by_name()")
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > ---
> > exec.c | 4 ++++
> > tests/acceptance/empty_cpu_model.py | 19 +++++++++++++++++++
> > 2 files changed, 23 insertions(+)
> > create mode 100644 tests/acceptance/empty_cpu_model.py
> >
> > diff --git a/exec.c b/exec.c
> > index 1ca95df9d8..d816b38863 100644
> > --- a/exec.c
> > +++ b/exec.c
> > @@ -999,6 +999,10 @@ const char *parse_cpu_option(MachineState *machine, const char *cpu_option)
> > const char *cpu_type;
> >
> > model_pieces = g_strsplit(cpu_option, ",", 2);
> > + if (!model_pieces[0]) {
> > + error_report("-cpu option cannot be empty");
> > + exit(1);
>
> s/1/EXIT_FAILURE/
Why?
There are 753 instances of "exit(1)" in the tree, and 171
instances of "exit(EXIT_FAILURE)".
--
Eduardo
next prev parent reply other threads:[~2019-04-18 13:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-18 3:45 [Qemu-devel] [PATCH] cpu: Fix crash with empty -cpu option Eduardo Habkost
2019-04-18 3:45 ` Eduardo Habkost
2019-04-18 8:09 ` Stefano Garzarella
2019-04-18 8:09 ` Stefano Garzarella
2019-04-18 11:22 ` Igor Mammedov
2019-04-18 13:23 ` Eduardo Habkost [this message]
2019-04-18 15:05 ` Igor Mammedov
2019-04-18 20:16 ` Eduardo Habkost
2019-04-18 20:16 ` Eduardo Habkost
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=20190418132329.GF25134@habkost.net \
--to=ehabkost@redhat.com \
--cc=crosa@redhat.com \
--cc=imammedo@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.