qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window


From: Mike Kronenberg
Subject: Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window
Date: Mon, 8 Sep 2008 19:08:32 +0200

Hi,

Some OS (especially *nix) versions have pretty small size restrictions on shmem.
OS X for instance has a restriction of total 4mb for all processes.

I first ran into this limits with an early server/viewer patch submitted to this list using terminal/shmem. (Was it submitted by Anthony? The Idea was dropped in favor of VNC later.)

Then some months ago, after the last cocoa OpenGL patch, I started a new OpenGL version of Q, with qemu as a separate server and Q as a viewer app. The Idea was to have a lean qemu server process running and then attach a viewer/controller to it and have fast/resizable/fullscreen video opposed to the vnc solution. They share the video-buffer with mmap instead of shmem. I've got some notes on the experiment and shmem size limitation on this blogentry http://mike.kronenberg.org/?p=40

For the OpenGL implementation, look at cocoa.m... I think my last patch was never applied... but the OpenGL code should work correctly.

Just some thoughts.

Mike Kronenberg



On 08.09.2008, at 18:05, Anthony Liguori wrote:

Daniel P. Berrange wrote:
On Mon, Sep 08, 2008 at 04:08:01PM +0100, Jamie Lokier wrote:

Gerd Hoffmann wrote:

Beside that I still think it would be a good idea to separate qemu and the gui into two separate processes, so you can close the GUI window and keep the VM running. It also solves the dependency issue for distros as the gtk frontend with all the dependencies can just go into a separate
sub-package.

Extending VNC with a "shared memory" extension, similar to Xlib's
MIT-SHM extension, and implementing it in QEMU and Gtk-VNC would be a
nice way to do this.


Funny you should mention that. Anthony had code todo exactly that against for both QEMU and GTK-VNC a while back. We had it in the GTK-VNC for a short while but removed it due to some race conditions in its impl, and it interracted badly with our OpenGL impl. We could easily revisit this
idea if it were thought to be important / useful.


The difficulty is deleting the shared memory segment reliably.

Normally, what you want to do is:

shmget()
shmat()
shmctl(IPC_RMID)

...

shmdt()

And the first sequence has to be as reliable and quick as possible because if you exit before the shmctl(), you'll leak the shared memory.

Unfortunately, you have to shmget() in the client and shmat() in the server and client, so that means:

shmget()
shmat()

...

notify server of key
wait for server to confirm shmat()

...

shmctl(IPC_RMID)

..

shmdt()

Which leaves a huge window open where bad things can happen. The client can exit, the client can crash. This is particularly troublesome in a library because it's really not nice to try and register an atexit() handler or something like that from a library.

It would be nice to come up with a solution to this.

Regards,

Anthony Liguori

Daniel









reply via email to

[Prev in Thread] Current Thread [Next in Thread]