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