qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] monitor: Add port write command


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] monitor: Add port write command
Date: Tue, 14 Jul 2009 10:06:07 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

Jan Kiszka wrote:
Useful for testing hardware emulations or manipulating its state to
stress guest drivers.

Signed-off-by: Jan Kiszka <address@hidden>

Patch looks good.

Makes me think of an idea I had a while ago. It's a rather radical change but I think we could target it for 0.12. Today, the vast majority of our save/restore code looks like:

save:
// version checks
qemu_put_type(f, &field);
...

load:
// version checks
qemu_get_type(f, &field);
...
// optional depending on version
qemu_get_type(f, &field);

device_reset(s);

We could convert this to something this to be largely data drive. For instance,

SaveVMFields fields[] = {
{ offsetof(DeviceState, field), "field", TYPE, VERSION },
{},
};

SaveVMDescription desc = {
 .fields = fields,
 .version = CURRENT_VERSION,
 .reset = device_reset,
};

What would be really cool about this change is that we could introduce a new set of commands to manipulate device state. We could save/restore individual device state and that would allow us to dump device state via the monitor and to manipulate individual fields of the device state. I think this could be pretty useful for debugging.

I'm curious if anyone else is interested in this sort of change.

Regards,

Anthony Liguori




reply via email to

[Prev in Thread] Current Thread [Next in Thread]