From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54826 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oobzo-0006fm-3M for qemu-devel@nongnu.org; Thu, 26 Aug 2010 08:55:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oobzm-0005z8-Qt for qemu-devel@nongnu.org; Thu, 26 Aug 2010 08:55:55 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:49519) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oobzm-0005z0-Lj for qemu-devel@nongnu.org; Thu, 26 Aug 2010 08:55:54 -0400 Received: by qwh5 with SMTP id 5so1623319qwh.4 for ; Thu, 26 Aug 2010 05:55:54 -0700 (PDT) Message-ID: <4C766456.3050408@codemonkey.ws> Date: Thu, 26 Aug 2010 07:55:50 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v3 07/10] spice: add keyboard References: <1282745970-11506-1-git-send-email-kraxel@redhat.com> <1282745970-11506-8-git-send-email-kraxel@redhat.com> <4C7574B0.40203@codemonkey.ws> <4C760FD2.6010701@redhat.com> In-Reply-To: <4C760FD2.6010701@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On 08/26/2010 01:55 AM, Gerd Hoffmann wrote: > Hi, > >>> + >>> + qemu_spice_input_init(); >> >> Why not pass spice_server to qemu_spice_input_init() and avoid the >> global? >> > > We need the global anyway for the guest devices (not yet in this > series). They are created using -device. Thus the initialization > functions are not called from spice code and we can't simply pass a > reference to spice_server. Let's avoid it where we can and we'll do what we need to do for the guest devices. In general, for the cases that we truly need a global, I'd prefer getting to it via a function instead of having a non-static variable. Regards, Anthony Liguori > > cheers, > Gerd