qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alon Levy <alevy@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC 2/2] hmp/qxl: info spice: add qxl0_mode & qxl0_guest_bug
Date: Mon, 21 May 2012 14:35:14 +0300	[thread overview]
Message-ID: <20120521113514.GF5846@garlic> (raw)
In-Reply-To: <4FBA0948.60002@redhat.com>

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

  reply	other threads:[~2012-05-21 11:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21  9:04 [Qemu-devel] [RFC 1/2] hw/qxl: ignore guest from guestbug until reset Alon Levy
2012-05-21  9:04 ` [Qemu-devel] [RFC 2/2] hmp/qxl: info spice: add qxl0_mode & qxl0_guest_bug Alon Levy
2012-05-21  9:22   ` Gerd Hoffmann
2012-05-21 11:35     ` Alon Levy [this message]
2012-05-21 11:55       ` Gerd Hoffmann
2012-05-21  9:12 ` [Qemu-devel] [RFC 1/2] hw/qxl: ignore guest from guestbug until reset Gerd Hoffmann
2012-05-21 11:33   ` Alon Levy
2012-05-23 12:01 ` [Qemu-devel] [PATCH] " Alon Levy

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=20120521113514.GF5846@garlic \
    --to=alevy@redhat.com \
    --cc=kraxel@redhat.com \
    --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).