qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nathaniel McCallum <npmccallum@gentoo.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Just a thought (high level API)
Date: Wed, 09 Feb 2005 22:47:05 -0500	[thread overview]
Message-ID: <1108007226.8060.28.camel@localhost.localdomain> (raw)
In-Reply-To: <20050210023426.GA15123@jbrown.mylinuxbox.org>

On Wed, 2005-02-09 at 21:34 -0500, Jim C. Brown wrote:
> After thinking about it for a while, your approach is better. I then thought
> about taking it a step farther, and we could use multiple processes. The qemu
> exectuable would hold the main emulator engine, but it would send graphical
> output via a well documented protocol to a front-end process, and console
> output to a process (probably the same one but concievably a different one)
> via another protocol.

Interesting... though this would introduce a level of latency,
particularly troublesome when we are using 100% CPU for emulation.  We
then also have to deal with the IPC issue: UNIX/Linux/Mac can use dbus
or a unix socket, Windows can't use either of these.

While multiple processes would certainly be more stable, is it worth the
complexity it introduces?  A well planned out API might give us just as
much flexibility with higher performance and portability.

One advantage of the protocol/ipc method would be that you get free
bindings to any language (ie. any language can use the protocol).
However, the main languages that would use the API would be C (console
and gtk/gnome), C++ (w32 and qt/kde) and Obj-C (Mac) which can all use
the C API without any bindings, so its not a huge advantage unless
someone wants to embed qemu into something done in another language.
The API wouldn't be that big though, so bindings wouldn't be all that
problematic.

I'm open to the protcol/multiple processes approach if we can do it
with:
   1. low latency
   2. portability
   3. simplicity

> In other words, a config file?
> 
> This has already been discussed, and Fabrice mentioned support for .qmu files
> a while ago. To my knowledge, these have never been used and I don't know if
> they are still supported.
> 
> This approach would only work if all front-ends standardized to the same config
> file format, or if this parsing was done directly by the qemu engine ... or if
> all front ends invoked a standard parser to handle this. This would go along
> with the multiple process idea for the UI.

If we put this in the libqemu library from the get go, GUIs will use it.
If you notice how I modeled this in the header in my first email: You
generate a QEMUVirtualMachine from a QEMUVirtualMachineProfile which you
can load from a file or serialize to a file.  This standard struct would
be the standard place to define virtual machine parameters.

> I already have this, but it is done via a shell script that converts the
> parameters into command line options. It shouldn't be difficult to convert
> it into Python or Perl. (Writing a C program that does the same is also possible,
> and should be no more difficult than writing any other C program. ;)

It has to be C (portability without massive dependencies), though we may
want to use glib.  It has great functions for reading and writing config
files (in addition to a million other things).  glib is getting pretty
standard these days and has great Window support.  In fact, from what I
can see, glib would in some places reduce the code quite a bit in qemu.

Nathaniel

  reply	other threads:[~2005-02-10  4:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09 15:09 [Qemu-devel] Just a thought (high level API) Nathaniel McCallum
2005-02-09 15:52 ` McMullan, Jason
2005-02-10  0:02 ` Jim C. Brown
2005-02-10  1:28   ` Nathaniel McCallum
2005-02-10  2:34     ` Jim C. Brown
2005-02-10  3:47       ` Nathaniel McCallum [this message]
2005-02-10 19:59 ` Fabrice Bellard
2005-02-10 20:32   ` Nathaniel McCallum
2005-02-10 21:21     ` Fabrice Bellard
2005-02-10 22:16     ` Magnus Damm
2005-02-11 11:07     ` Jan Marten Simons
2005-02-11 12:20       ` Johannes Schindelin
2005-02-11 15:07         ` Jim C. Brown
2005-02-11 15:35           ` Nathaniel McCallum
2005-02-11 16:14             ` [Qemu-devel] " Ronald
2005-02-11 23:02               ` Nathaniel McCallum
2005-02-11 23:39                 ` [Qemu-devel] " Ronald
2005-02-11 18:27         ` [Qemu-devel] " Jan Marten Simons
2005-02-11 18:30           ` Paul Brook
2005-02-11 20:03             ` Nathaniel McCallum
2005-02-11 22:55               ` art yerkes
2005-02-11 23:04                 ` Nathaniel McCallum

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=1108007226.8060.28.camel@localhost.localdomain \
    --to=npmccallum@gentoo.org \
    --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 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).