[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable |
Date: |
Thu, 4 Apr 2019 12:05:33 +0200 |
On Tue, 2 Apr 2019 23:23:42 +0700
Peter Maydell <address@hidden> wrote:
> On Tue, 2 Apr 2019 at 23:13, Markus Armbruster <address@hidden> wrote:
> >
> > Igor Mammedov <address@hidden> 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
>
- [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Like Xu, 2019/04/02
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Markus Armbruster, 2019/04/02
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Like Xu, 2019/04/02
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Igor Mammedov, 2019/04/02
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Markus Armbruster, 2019/04/02
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Peter Maydell, 2019/04/02
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Eduardo Habkost, 2019/04/02
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Peter Maydell, 2019/04/02
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable,
Igor Mammedov <=
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Peter Maydell, 2019/04/04
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] vl.c: make current_machine as non-global variable, Like Xu, 2019/04/04