qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Multi-head support RFC


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] Multi-head support RFC
Date: Wed, 20 Nov 2013 08:39:35 +0100

> >     graphic_console_init(..., &state->heads[i]);
> >
> > so you can figure the head in the callbacks.
> 
> What I had prototyped (I got impatient) was to add a helper: 
> qemu_console_hw_opaque() to console.c so the HwOps could query the 
> opaque pointer. I don't like it because it requires an additional 
> function call at the top of frequently called operations... However I'm 
> not a huge fan of the head state array either, since it will require 
> either pointer duplication, or pointer acrobatics, or the same helper 
> function to get the card state.

Yes, easiest way to get the device state struct from the head state
struct is a pointer in each the head state (this is what you mean with
pointer duplication, right?).

I still think it is the best way.  You get a direct pointer to your head
state.  Device state is only one pointer dereference away.

Anything else requires extra effort to lookup the head state from
whatever information (QemuConsole, index, ...) we pass to the hwops
function.

cheers,
  Gerd






reply via email to

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