On Mon, May 21, 2012 at 11:22:16AM +0200, Gerd Hoffmann wrote: > Hi, > > > + if (info->qxl0_guest_bug != -1 && info->qxl0_mode != -1) { > > + monitor_printf(mon, " qxl0\n"); > > + monitor_printf(mon, " guest_bug: %"PRIu64"d\n", > > info->qxl0_guest_bug); > > + monitor_printf(mon, " mode: %s\n", > > + SpiceQueryQXLMode_lookup[info->qxl0_mode]); > > + } > > Anything else we might want export while being at it? For example > whenever guest drivers use sync or async io commands? > > What about secondary displays?
OK, so I can fix this and remove the qxl0 hack at the same stroke. I was looking at using the system_bus, but that seems like another hack. The alternative is to keep a linked list of qxl devices private to qxl.c and use that, and the below functions become int qxl_guest_bug(int index) int qxl_mode(int index) int qxl_device_count(void) How does that sound? > > > +/* helpers for spice_info. only show first device */ > > +int qxl0_guest_bug(void) > > +{ > > + if (!qxl0) { > > + return -1; > > + } > > + return qxl0->guest_bug; > > +} > > + > > +int qxl0_mode(void) > > +{ > > + if (!qxl0) { > > + return -1; > > + } > > + return qxl0->mode; > > +} > > Hmm, that is a bit hackish. qxl0 exists only for the reason that > displaychangelisteners don't support passing through a opaque pointer > (or other way to get the state). I'd prefer to get rid of it, not add > more uses, although I can see that it is convenient ... > > > cheers, > Gerd