From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3cot-0003hr-QA for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:04:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3con-0005or-6L for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:04:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46321 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3con-0005ng-0J for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:04:13 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 29 Jul 2013 04:03:56 +0200 Message-Id: <1375063438-3149-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC for-next 0/2] QOM VMStateDescription remix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Juan Quintela , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori , "Michael S. Tsirkin" Hello, Based on a comment from mst, this mini-series proposes to change semantic= s of VMStateDescription registration to be more similar to those of static pro= perties. Today, a device has one VMStateDescription, the last assignment to dc->vm= sd wins. This means that a device must take care to include state of its parent ty= pe. To avoid dealing with individual fields, VMSTATE_STRUCT() and wrappers ha= ve been used. Such fields often require access of the deprecated QOM parent = field. The proposal is that, e.g., TYPE_CPU assigns its own VMStateDescription a= nd derived types (e.g., TYPE_ALPHA_CPU) register a VMStateDescription with n= ame and versions to be used and only the fields specific to that type. In this v1, versions of the parents' vmsd are ignored, so someone changin= g CPU's DeviceClass::vmsd (as opposed to DeviceClass::vmsd->fields[0].vmsd) would= need to assure appropriate .field_exists tests or bump the version of derived = types' vmsd as if a field had been added there. Only rudimentarily tested: I've run some machines that didn't crash on st= artup. Regards, Andreas Cc: Michael S. Tsirkin Cc: Juan Quintela Cc: Anthony Liguori Cc: Paolo Bonzini Andreas F=C3=A4rber (2): qdev: Construct VMStateDescription from type hierarchy cpu: Move VMSTATE_CPU() into TYPE_CPU VMStateDescription hw/core/qdev.c | 102 ++++++++++++++++++++++++++++++++++++++++= +----- include/hw/qdev-core.h | 1 + include/qom/cpu.h | 4 -- qom/cpu.c | 10 +++++ stubs/vmstate.c | 1 + target-alpha/machine.c | 1 - target-openrisc/machine.c | 1 - 7 files changed, 103 insertions(+), 17 deletions(-) --=20 1.8.1.4