[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 00/26] Add infrastructure for QIDL-based devi
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v4 00/26] Add infrastructure for QIDL-based device serialization |
Date: |
Mon, 15 Oct 2012 10:09:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121009 Thunderbird/16.0 |
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
- Re: [Qemu-devel] [PATCH v4 24/26] qidl: add QAPI-based code generator, (continued)
[Qemu-devel] [PATCH v4 25/26] qidl: qidl.h, definitions for qidl annotations, Michael Roth, 2012/10/12
[Qemu-devel] [PATCH v4 26/26] qidl: unit tests and build infrastructure, Michael Roth, 2012/10/12
Re: [Qemu-devel] [PATCH v4 00/26] Add infrastructure for QIDL-based device serialization,
Paolo Bonzini <=