From: Igor Mammedov <imammedo@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Markus Armbruster <armbru@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Like Xu <like.xu@linux.intel.com>,
QEMU Trivial <qemu-trivial@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable
Date: Thu, 4 Apr 2019 12:05:33 +0200 [thread overview]
Message-ID: <20190404120533.427a2beb@redhat.com> (raw)
In-Reply-To: <CAFEAcA8ogWn50wWBttM2QpfQoZ8UYnXfG3NSkuSc8j8WOWt6FA@mail.gmail.com>
On Tue, 2 Apr 2019 23:23:42 +0700
Peter Maydell <peter.maydell@linaro.org> wrote:
> On Tue, 2 Apr 2019 at 23:13, Markus Armbruster <armbru@redhat.com> wrote:
> >
> > Igor Mammedov <imammedo@redhat.com> writes:
> > > maybe we can assert in qdev_get_machine() if machine hasn't been created yet?
> > > with this at least it will be hard to misuse function or catch invalid users.
> > > (but it still might miss some use cases/CLI options which are not tested)
> >
> > Good idea. When my code created "/machine" as a container, debugging
> > the resulting crash took me a bit of time. The assertion you propose
> > would've saved me some.
>
> One wrinkle to watch out for is code paths that are used in the
> linux-user emulator, where there is no machine at all... For instance
> cpu_common_realizefn() handles this case by explicitly checking
> whether the thing it gets back from qdev_get_machine() is a
> TYPE_MACHINE or not.
this one can be solved by adding 'ignore_memory_transaction_failures'
property to the CPU class where it applies (I'm not sure why it's
in generic cpu code instead of ARM only) and then setting compat
property in affected boards code.
but looking at users qdev_get_machine() it's not the only place where it
would explode in *-user build, so it would need to be taken care of
as well.
>
> thanks
> -- PMM
>
next prev parent reply other threads:[~2019-04-04 10:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 8:48 [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable Like Xu
2019-04-02 11:27 ` Markus Armbruster
2019-04-02 13:09 ` Like Xu
2019-04-02 15:47 ` Igor Mammedov
2019-04-02 16:13 ` Markus Armbruster
2019-04-02 16:23 ` Peter Maydell
2019-04-02 19:16 ` Eduardo Habkost
2019-04-03 0:03 ` Peter Maydell
2019-04-04 10:05 ` Igor Mammedov [this message]
2019-04-04 10:41 ` Peter Maydell
2019-04-04 7:41 ` Like Xu
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=20190404120533.427a2beb@redhat.com \
--to=imammedo@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=like.xu@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=thuth@redhat.com \
/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).