[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv3] add "info ioapic" monitor command
From: |
Anthony Liguori |
Subject: |
Re: [Qemu-devel] [PATCHv3] add "info ioapic" monitor command |
Date: |
Wed, 06 Jan 2010 13:50:21 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0 |
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