From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwOkU-00066S-11 for qemu-devel@nongnu.org; Mon, 08 Jul 2013 23:37:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwOkS-0003Uo-A7 for qemu-devel@nongnu.org; Mon, 08 Jul 2013 23:37:53 -0400 Received: from mail-ye0-f176.google.com ([209.85.213.176]:55271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwOkS-0003Ug-6V for qemu-devel@nongnu.org; Mon, 08 Jul 2013 23:37:52 -0400 Received: by mail-ye0-f176.google.com with SMTP id m14so1841989yen.7 for ; Mon, 08 Jul 2013 20:37:51 -0700 (PDT) Message-ID: <51DB8587.30506@ozlabs.ru> Date: Tue, 09 Jul 2013 13:37:43 +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> In-Reply-To: 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: Anthony Liguori Cc: Anthony Liguori , Alexander Graf , qemu-devel , qemu-ppc@nongnu.org, Paolo Bonzini , Paul Mackerras , David Gibson On 07/09/2013 10:49 AM, Anthony Liguori wrote: > On Mon, Jul 8, 2013 at 7:06 PM, Alexey Kardashevskiy wrote: >>> You should tie the vmstate section to DeviceState::vmsd. You only need >>> to do this because you haven't converted everything to QOM yet. >>> >>> Please do that to avoid these hacks. >> >> >> How? I want to support migration from xics to xics-kvm and vice versa. >> vmsd cannot be inherited and even if they could, different device names >> would kill that support. > > Please look at hw/intc/i8259_common.c and then hw/i386/kvm/i8259.c and > hw/i386/intc/i8259.c. btw do I have to put xics_kvm.c to hw/ppc64/kvm (which does not exist yet) or to hw/intc? What is the system here? I am really confused. > The vmsd is in the common base class shared between the KVM version > and the non-KVM version. As long as the subclasses don't introduce > any new state members, you can safely migrate between the two devices. 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. > You should consider splitting the implementations up into separate > files just like i8259 too. -- Alexey