qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Let event loop use non-default GMainContext
@ 2018-04-16  8:52 Eva Chen
  2018-04-20  7:39 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Eva Chen @ 2018-04-16  8:52 UTC (permalink / raw)
  To: qemu-devel

Hello,

It seems that AIO use global default GMainContext by
*g_main_context_default()*.
I want to replace all default GMainContext into another GMainContext by
*g_main_context_new()*, but I have no idea when and where to add
*g_main_context_new()*.

It should be only created new GMainContext once, then others use this new
GMainContext.
But it's hard to create a global variable that will not cause redefine
during make

Is there any suggestion which data structure is suitable for adding a
GMainContext?
or is there any advice for replacing default GMainContext?

The reason for replacing default GMainContext is that I simultaneously run
two qemu, called A and B, in threads. However, these two QEMU using the
same default GMainContext causes A QEMU to handle the event from B QEMU,
and run B's handler instead of A's handler.

I will be grateful for any help, thanks.

Sincerely,
Eva



​

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Let event loop use non-default GMainContext
  2018-04-16  8:52 [Qemu-devel] Let event loop use non-default GMainContext Eva Chen
@ 2018-04-20  7:39 ` Stefan Hajnoczi
       [not found]   ` <CAG0V3WTu2TBFRkcRyO7oHuGWxa=wuEAvRjkK6f39AcswDWNmxg@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2018-04-20  7:39 UTC (permalink / raw)
  To: Eva Chen; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

On Mon, Apr 16, 2018 at 04:52:34PM +0800, Eva Chen wrote:
> The reason for replacing default GMainContext is that I simultaneously run
> two qemu, called A and B, in threads. However, these two QEMU using the
> same default GMainContext causes A QEMU to handle the event from B QEMU,
> and run B's handler instead of A's handler.

I think you will hit many other issues if you try to run two instances
of QEMU within a single process.  There have been several efforts to
simulate heterogenous systems (e.g. different CPUs as part of one
computer).  Some of them run multiple QEMU instances and communicate
between the processes.

Before going further, have you looked into existing work on emulating
heterogenous systems under QEMU?

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Let event loop use non-default GMainContext
       [not found]   ` <CAG0V3WTu2TBFRkcRyO7oHuGWxa=wuEAvRjkK6f39AcswDWNmxg@mail.gmail.com>
@ 2018-04-21 10:04     ` Stefan Hajnoczi
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2018-04-21 10:04 UTC (permalink / raw)
  To: Eva Chen; +Cc: qemu-devel

On Sat, Apr 21, 2018 at 11:29 AM, Eva Chen <debby83729@gmail.com> wrote:
> Thanks for your reply.
>
> Actually, I don't know there is existing work on emulating heterogeneous
> system under QEMU. The only work I know is that QEMU has implemented
> multicore in one QEMU process. But what I want to do is to simulate two
> heterogeneous cpu core at the same time.
> May I ask if you know any related work?

I'm not familiar with the work that has been done, but here are two
starting points you may find interesting:

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.1007.285&rep=rep1&type=pdf

https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg00171.html

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-21 10:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-16  8:52 [Qemu-devel] Let event loop use non-default GMainContext Eva Chen
2018-04-20  7:39 ` Stefan Hajnoczi
     [not found]   ` <CAG0V3WTu2TBFRkcRyO7oHuGWxa=wuEAvRjkK6f39AcswDWNmxg@mail.gmail.com>
2018-04-21 10:04     ` Stefan Hajnoczi

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).