From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mjc5l-0006Q4-Ug for qemu-devel@nongnu.org; Fri, 04 Sep 2009 12:56:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mjc5g-0006Mj-8u for qemu-devel@nongnu.org; Fri, 04 Sep 2009 12:56:53 -0400 Received: from [199.232.76.173] (port=37213 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mjc5g-0006MX-5I for qemu-devel@nongnu.org; Fri, 04 Sep 2009 12:56:48 -0400 Received: from mail-ew0-f223.google.com ([209.85.219.223]:56786) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjbvM-0004IU-MY for qemu-devel@nongnu.org; Fri, 04 Sep 2009 12:46:10 -0400 Received: by ewy23 with SMTP id 23so982489ewy.8 for ; Fri, 04 Sep 2009 09:46:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090904164030.GA31240@amit-x200.redhat.com> References: <1252055670-26958-1-git-send-email-amit.shah@redhat.com> <20090904163306.GA31086@amit-x200.redhat.com> <20090904164030.GA31240@amit-x200.redhat.com> From: Blue Swirl Date: Fri, 4 Sep 2009 19:45:41 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH] virtio-console: Have a static instance of virtconsole Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu-devel@nongnu.org On Fri, Sep 4, 2009 at 7:40 PM, Amit Shah wrote: > On (Fri) Sep 04 2009 [19:37:25], Blue Swirl wrote: >> On Fri, Sep 4, 2009 at 7:33 PM, Amit Shah wrote: >> > On (Fri) Sep 04 2009 [19:26:27], Blue Swirl wrote: >> >> On Fri, Sep 4, 2009 at 12:14 PM, Amit Shah wrote: >> >> > Currently the VirtIOConsole struct is allocated from the call >> >> > to virtio_common_init, also doing an UP_CAST implicitly. >> >> > >> >> > The new multiport functionality will need a few arrays and >> >> > it's easier to move to the new VMState infrastructure by >> >> > keeping it all within one struct. >> >> >> >> > +VirtIOConsole virtconsole; >> >> >> >> IMHO this is going to wrong direction. What kind of code would need a >> >> static instance? >> > >> > Adding multiple ports to the console device, we'll have to store an >> > array of ports here as well as config space. Both of these are >> > device-specific. >> >> There could be a master device which managed all ports. > > There's only one instance of a virtio device created, and this device > hosts multiple ports. And VirIOConsole is the master structure. But instead of this, you should have a separate structure for the master one, if that way you can avoid the static instance.