From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0wO7-0003H1-1E for qemu-devel@nongnu.org; Fri, 24 Feb 2012 09:44:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0wO4-0003YI-Td for qemu-devel@nongnu.org; Fri, 24 Feb 2012 09:44:50 -0500 Received: from mail-gy0-f173.google.com ([209.85.160.173]:46413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0wO4-0003YB-Pd for qemu-devel@nongnu.org; Fri, 24 Feb 2012 09:44:44 -0500 Received: by ghrr14 with SMTP id r14so750938ghr.4 for ; Fri, 24 Feb 2012 06:44:40 -0800 (PST) Message-ID: <4F47A255.10105@codemonkey.ws> Date: Fri, 24 Feb 2012 08:44:37 -0600 From: Anthony Liguori 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> <4F4795B9.7090407@redhat.com> In-Reply-To: <4F4795B9.7090407@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Paolo Bonzini Cc: "qemu-devel@nongnu.org" , Igor Mammedov , =?ISO-8859-1?Q?Andreas_F=E4rber?= , Jan Kiszka On 02/24/2012 07:50 AM, Paolo Bonzini wrote: > 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. This creates another namespace that's independent of the QOM graph. This is something we should try to avoid. >> 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. Being stateful is a feature but the concept would work just as well if you didn't store the pin state. Then it just looks like: struct Pin { Object parent; /*< private >*/ NotifierLister level_change_notifiers; }; The reason to introduce another type (instead of attempting to convert qemu_irq) is that the life cycle of qemu_irq is very un-QOM. I don't think we can do it without incrementally refactoring the users of qemu_irq and a new type makes it easier to do that incrementally. Regards, Anthony Liguori > Paolo