From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyibA-0005M4-P0 for qemu-devel@nongnu.org; Mon, 15 Jul 2013 09:13:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uyib9-00046w-7K for qemu-devel@nongnu.org; Mon, 15 Jul 2013 09:13:52 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:51355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyib9-00046i-0U for qemu-devel@nongnu.org; Mon, 15 Jul 2013 09:13:51 -0400 Received: by mail-pd0-f174.google.com with SMTP id 10so10731564pdc.19 for ; Mon, 15 Jul 2013 06:13:50 -0700 (PDT) Message-ID: <51E3F585.4010301@ozlabs.ru> Date: Mon, 15 Jul 2013 23:13:41 +1000 From: Alexey Kardashevskiy 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> In-Reply-To: <51E3F3B7.4090000@redhat.com> 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: Paolo Bonzini Cc: Anthony Liguori , Alexander Graf , qemu-devel , Paul Mackerras , Anthony Liguori , qemu-ppc@nongnu.org, David Gibson On 07/15/2013 11:05 PM, Paolo Bonzini wrote: > Il 09/07/2013 05:37, Alexey Kardashevskiy ha scritto: >> >> btw xics-kvm does not introduce new members but does have very different >> .pre_save and .post_load. This actually was the whole point of splitting >> xics into xics and xics-kvm. I cannot see how I can fix it without hacks. >> Property's can be inherited from a parent class (?) but VMStateDescription >> cannot. > > 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 :( -- Alexey