From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyifN-0007WQ-FS for qemu-devel@nongnu.org; Mon, 15 Jul 2013 09:18:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyifK-0006Lq-JP for qemu-devel@nongnu.org; Mon, 15 Jul 2013 09:18:13 -0400 Message-ID: <51E3F681.3080002@redhat.com> Date: Mon, 15 Jul 2013 15:17:53 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1372315560-5478-1-git-send-email-aik@ozlabs.ru> <1372315560-5478-6-git-send-email-aik@ozlabs.ru> <871u78299c.fsf@codemonkey.ws> <51DB5413.8020101@ozlabs.ru> <51DB8587.30506@ozlabs.ru> <51E3F3B7.4090000@redhat.com> <51E3F585.4010301@ozlabs.ru> In-Reply-To: <51E3F585.4010301@ozlabs.ru> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/17] pseries: savevm support for XICS interrupt controller List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Anthony Liguori , Alexander Graf , qemu-devel , Paul Mackerras , Anthony Liguori , qemu-ppc@nongnu.org, David Gibson Il 15/07/2013 15:13, Alexey Kardashevskiy ha scritto: >> > >> > The vmstate's pre_save and post_load functions can dispatch to a method >> > in the subclass. Again, i8259 does exactly what you want: >> > >> > static void pic_dispatch_pre_save(void *opaque) >> > { >> > PICCommonState *s = opaque; >> > PICCommonClass *info = PIC_COMMON_GET_CLASS(s); >> > >> > if (info->pre_save) { >> > info->pre_save(s); >> > } >> > } > And this is not a hack. Hm. I do not get it. There is even INTERFACE_CLASS > defined but noone is using it. Instead you are proposing to add callbacks > called from callbacks. And this is all for not having dev==NULL in > vmstate_register()... Gosh :( This is not about having dev!=NULL. It is about not using vmstate_register at all. Paolo