From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bU2rO-0001x8-5O for qemu-devel@nongnu.org; Sun, 31 Jul 2016 22:21:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bU2rN-0008D5-37 for qemu-devel@nongnu.org; Sun, 31 Jul 2016 22:21:42 -0400 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]:36860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bU2rM-0008D0-Uq for qemu-devel@nongnu.org; Sun, 31 Jul 2016 22:21:41 -0400 Received: by mail-oi0-x244.google.com with SMTP id d204so12767480oig.3 for ; Sun, 31 Jul 2016 19:21:40 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <42ce627289b3f8976eaba62951224233e4d1e5cf.1469514677.git.alistair@alistair23.me> From: Alistair Francis Date: Sun, 31 Jul 2016 19:21:10 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v5 5/8] irq: Add a new irq device that allows the ORing of lines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Peter Crosthwaite , QEMU Developers , Konstanty Bialkowski On Tue, Jul 26, 2016 at 8:00 AM, Peter Maydell wrote: > On 26 July 2016 at 15:37, Alistair Francis wrote: >> Signed-off-by: Alistair Francis >> --- >> >> hw/core/irq.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ >> include/hw/irq.h | 13 +++++++++++++ >> 2 files changed, 57 insertions(+) >> >> diff --git a/hw/core/irq.c b/hw/core/irq.c >> index 49ff2e6..73b18b4 100644 >> --- a/hw/core/irq.c >> +++ b/hw/core/irq.c >> @@ -27,6 +27,7 @@ >> #include "qom/object.h" >> >> #define IRQ(obj) OBJECT_CHECK(struct IRQState, (obj), TYPE_IRQ) >> +#define OR_IRQ(obj) OBJECT_CHECK(struct OrIRQState, (obj), TYPE_OR_IRQ) >> >> struct IRQState { >> Object parent_obj; >> @@ -36,6 +37,15 @@ struct IRQState { >> int n; >> }; >> >> +struct OrIRQState { >> + Object parent_obj; >> + >> + qemu_irq in_irq; >> + qemu_irq *out_irqs; >> + int *levels; > > The data in the memory pointed to by 'levels' is state, and you > need to migrate it somehow. (Otherwise you'll give the wrong > results the next time an input changes following a migration.) A simple vmstate should be enough for that right? Thanks, Alistair > > thanks > -- PMM >