Il 12/10/2012 23:10, Michael Roth ha scritto:
> 
> These patches add infrastructure and unit tests for QIDL, which provides
> a serialization framework for QEMU device structures by generating visitor
> routines for device structs based on simple field annotations. Examples of
> how this is done are included in patch 17, but, for brevity, a sample struct
> such as this:
> 
>     typedef struct SerialDevice {
>         SysBusDevice parent;
> 
>         uint8_t thr;            /* transmit holding register */
>         uint8_t lsr;            /* line status register */
>         uint8_t ier;            /* interrupt enable register */
> 
>         int int_pending;        /* whether we have a pending queued interrupt 
> */
>         CharDriverState *chr;   /* backend */
>     } SerialDevice;
> 
> can now be made serializable with the following changes:
> 
>     typedef struct SerialDevice SerialDevice;
> 
>     QIDL_DECLARE(SerialDevice) {
>         SysBusDevice parent;
> 
>         uint8_t thr;              /* transmit holding register */
>         uint8_t lsr;              /* line status register */
>         uint8_t ier;              /* interrupt enable register */
> 
>         int q_derived int_pending; /* whether we have a pending queued 
> interrupt */
>         CharDriverState q_immutable *chr; /* backend */
>     };
> 
> To make use of generated visitor code, and .c file need only call the
> QIDL_ENABLE() somewhere in the code body, which will then give it access to
> visitor routines for any QIDL-ified device structures in that file, or 
> included
> from other files. These routines can then be used for
> serialization/deserialization of the device state in a manner suitable for 
> tasks
> such as introspection/testing (generally via a r/w 'state' QOM property) or
> migration.
> 
> The overall goal is to expose all migrateable device state in this manner so
> that we can decouple serialization duties from savevm/VMState and convert them
> into a stable, code-agnostic wire protocol, relying instead on intermediate
> translation routines to handle the work of massaging serialized state into a
> format suitable for the wire and vice-versa.
> 
> The following WIP branch contains the first set of QIDL conversions:
> 
> https://github.com/mdroth/qemu/commits/qidl
> 
> So far i440fx, pcibus, cirrus_vga, uhci, rtc, and isa/piix ide have been
> converted, and I'm hoping to have most common PC devices converted over
> within the next few weeks.

Do you have any plan for scripted conversion?

Paolo

Reply via email to