From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUceG-0004By-QK for qemu-devel@nongnu.org; Thu, 09 Jun 2011 06:39:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUceF-0006of-UL for qemu-devel@nongnu.org; Thu, 09 Jun 2011 06:39:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUceF-0006oQ-Mv for qemu-devel@nongnu.org; Thu, 09 Jun 2011 06:39:35 -0400 Message-ID: <4DF0A2E2.90501@redhat.com> Date: Thu, 09 Jun 2011 12:39:30 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <4DEF2F25.5070104@redhat.com> <1307559319-16183-1-git-send-email-andreas.faerber@web.de> <1307559319-16183-2-git-send-email-andreas.faerber@web.de> <1307559319-16183-3-git-send-email-andreas.faerber@web.de> <1307559319-16183-4-git-send-email-andreas.faerber@web.de> In-Reply-To: <1307559319-16183-4-git-send-email-andreas.faerber@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v4 03/12] isa: Provide set_state callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: hpoussin@reactos.org, qemu-devel@nongnu.org Hi, > +const VMStateDescription vmstate_isa_device = { > + .name = "ISADevice", > + .version_id = 1, > + .minimum_version_id = 1, > + .fields = (VMStateField []) { > + VMSTATE_BOOL(enabled, ISADevice), > + VMSTATE_END_OF_LIST() > + } > +}; That alone isn't enougth. You also need to save iobase and irq. And have a pre-load callback which disables the device + a post-load callback which re-enables them with the new settings. I get the feeling that doing all this in the pc87312 emulation is easier as it needs to have this logic anyway for config register writes and you can probably reuse the code for loadvm pre- and postprocessing. cheers, Gerd