From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNfjz-00069G-F3 for qemu-devel@nongnu.org; Mon, 15 Oct 2012 04:09:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNfjv-0006Uc-5l for qemu-devel@nongnu.org; Mon, 15 Oct 2012 04:09:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNfju-0006UL-Tz for qemu-devel@nongnu.org; Mon, 15 Oct 2012 04:09:31 -0400 Message-ID: <507BC4B3.3090201@redhat.com> Date: Mon, 15 Oct 2012 10:09:23 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1350076268-18461-1-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1350076268-18461-1-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 00/26] Add infrastructure for QIDL-based device serialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, qemu-devel@nongnu.org, blauwirbel@gmail.com 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