From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0vY8-0003Z9-9W for qemu-devel@nongnu.org; Fri, 24 Feb 2012 08:51:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0vY0-0005cZ-Rv for qemu-devel@nongnu.org; Fri, 24 Feb 2012 08:51:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0vY0-0005cQ-Ir for qemu-devel@nongnu.org; Fri, 24 Feb 2012 08:50:56 -0500 Message-ID: <4F4795B9.7090407@redhat.com> Date: Fri, 24 Feb 2012 14:50:49 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1329347774-23262-1-git-send-email-imammedo@redhat.com> <1329347774-23262-2-git-send-email-imammedo@redhat.com> <4F3CE7A5.30600@siemens.com> <4F3CF9AE.5020701@codemonkey.ws> <4F3E8817.7050001@redhat.com> <4F478B2D.9050903@redhat.com> <4F4790F6.3070301@suse.de> <4F47934C.9080808@redhat.com> <4F4794D5.7010704@codemonkey.ws> In-Reply-To: <4F4794D5.7010704@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/7] Introduce a new bus "ICC" to connect APIC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: "qemu-devel@nongnu.org" , Igor Mammedov , =?ISO-8859-1?Q?Andreas_F=E4rber?= , Jan Kiszka On 02/24/2012 02:47 PM, Anthony Liguori wrote: >> > > I agree with you in principle, but in practice, there is not obvious way > to serialize gpio_in/gpio_out via Visitors. Finding some way to do it > as an integer is clearly wrong IMHO. "%s/gpio_in[%d]" % (object_get_canonical_path(...), opaque->n) is what I was thinking about. > I think a simple Pin object with the following interfaces: > > /** > * Connect a pin to a qemu_irq such that whenever the pin is > * raised, qemu_irq_raise() is called too on irq. > */ > void pin_connect_qemu_irq(Pin *obj, qemu_irq irq); > > /** > * Returns a qemu_irq such that whenever qemu_irq_raise() is > * called, pin_set_level(obj, true) is called. > */ > qemu_irq pin_get_qemu_irq(Pin *obj); > > Let's you incrementally refactor objects to use Pins while maintaining the existing qemu_irq infrastructure. Sure, a simple bridge is a fine alternative. What I'm not sure about is making Pins stateful, because that means you have to serialize them. Paolo