From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWQub-0000ee-5s for qemu-devel@nongnu.org; Mon, 21 May 2012 07:36:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWQuW-0001hU-AB for qemu-devel@nongnu.org; Mon, 21 May 2012 07:36:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWQuW-0001hH-1m for qemu-devel@nongnu.org; Mon, 21 May 2012 07:36:24 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4LBaMxI024473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 May 2012 07:36:22 -0400 Date: Mon, 21 May 2012 14:35:14 +0300 From: Alon Levy Message-ID: <20120521113514.GF5846@garlic> References: <1337591088-18667-1-git-send-email-alevy@redhat.com> <1337591088-18667-2-git-send-email-alevy@redhat.com> <4FBA0948.60002@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FBA0948.60002@redhat.com> Subject: Re: [Qemu-devel] [RFC 2/2] hmp/qxl: info spice: add qxl0_mode & qxl0_guest_bug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org 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