qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Gleb Natapov <gleb@redhat.com>
Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCHv3] add "info ioapic" monitor command
Date: Wed, 06 Jan 2010 13:50:21 -0600	[thread overview]
Message-ID: <4B44E97D.5090806@codemonkey.ws> (raw)
In-Reply-To: <20100106163502.GQ4905@redhat.com>

On 01/06/2010 10:35 AM, Gleb Natapov wrote:
> Knowing ioapic configuration is very useful for the poor soles
> how need to debug guest occasionally.
>    

This needs to be implemented in terms of VMState.  There is no reason 
for it not to be.

I've just gone through the code in great detail.  You just need to 
implement a vmstate_get_field that looks up a field given an instance 
name and instance id.  You then need to add a to_str callback in 
VMStateInfo.  The vmstate_get_field code will look very much like the 
vmstate_save code except it calls to_str().

The new monitor command should be 'device_info name [instance_id] [field]'.

For the ioapic, you can introduce a new VMStateInfo type that duplicates 
the vmstate_info_uint64 type except it has a different to_str callback 
that decodes the apic fields.  It's just then a matter of a few macros 
and updating the VMState description for the ioapic.

It's the same or less code than your current patch and it lays the 
ground work for a consistent command to look up arbitrary device info.

Regards,

Anthony Liguori

  reply	other threads:[~2010-01-06 19:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 16:35 [Qemu-devel] [PATCHv3] add "info ioapic" monitor command Gleb Natapov
2010-01-06 19:50 ` Anthony Liguori [this message]
2010-01-06 21:12   ` Gleb Natapov

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=4B44E97D.5090806@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=gleb@redhat.com \
    --cc=lcapitulino@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).