From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS3qv-0002Rb-UX for qemu-devel@nongnu.org; Tue, 26 Jul 2016 11:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS3qt-0006FX-Tk for qemu-devel@nongnu.org; Tue, 26 Jul 2016 11:01:00 -0400 Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:34065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS3qs-0006FK-MH for qemu-devel@nongnu.org; Tue, 26 Jul 2016 11:00:59 -0400 Received: by mail-qt0-x235.google.com with SMTP id u25so8520047qtb.1 for ; Tue, 26 Jul 2016 08:00:58 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <42ce627289b3f8976eaba62951224233e4d1e5cf.1469514677.git.alistair@alistair23.me> References: <42ce627289b3f8976eaba62951224233e4d1e5cf.1469514677.git.alistair@alistair23.me> From: Peter Maydell Date: Tue, 26 Jul 2016 16:00:38 +0100 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: Alistair Francis Cc: QEMU Developers , Peter Crosthwaite , Konstanty Bialkowski 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.) thanks -- PMM