From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyiTs-0001Ar-QL for qemu-devel@nongnu.org; Mon, 15 Jul 2013 09:06:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyiTq-0001Eq-PM for qemu-devel@nongnu.org; Mon, 15 Jul 2013 09:06:20 -0400 Message-ID: <51E3F3B7.4090000@redhat.com> Date: Mon, 15 Jul 2013 15:05:59 +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> In-Reply-To: <51DB8587.30506@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 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); } } Paolo