From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcVz0-00040M-4L for qemu-devel@nongnu.org; Wed, 15 May 2013 03:18:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcVyy-00025P-JW for qemu-devel@nongnu.org; Wed, 15 May 2013 03:18:42 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:50459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcVyx-00025D-Ug for qemu-devel@nongnu.org; Wed, 15 May 2013 03:18:40 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 May 2013 17:10:08 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 12A2D357804A for ; Wed, 15 May 2013 17:18:33 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4F7IPMr20381794 for ; Wed, 15 May 2013 17:18:25 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4F7IW2e006174 for ; Wed, 15 May 2013 17:18:32 +1000 Message-ID: <519336B8.4000507@linux.vnet.ibm.com> Date: Wed, 15 May 2013 15:18:16 +0800 From: Lei Li MIME-Version: 1.0 References: <1366867752-11578-1-git-send-email-lilei@linux.vnet.ibm.com> <1366867752-11578-3-git-send-email-lilei@linux.vnet.ibm.com> <51922170.8070808@redhat.com> <5193259F.9020803@linux.vnet.ibm.com> <51932EE9.7050904@redhat.com> In-Reply-To: <51932EE9.7050904@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] vnc: Support for LED state extension List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , Laszlo Ersek Cc: lagarcia@br.ibm.com, aliguori@us.ibm.com, qemu-devel On 05/15/2013 02:44 PM, Gerd Hoffmann wrote: > On 05/15/13 08:05, Lei Li wrote: >> On 05/14/2013 07:35 PM, Gerd Hoffmann wrote: >>> On 04/25/13 07:29, Lei Li wrote: >>>> + /* Sending the current led state message to the client */ >>>> + if (ledstate != current_led_state(vs)) { >>>> + vnc_led_state_change(vs); >>>> + } >>> This check never becomes true as the vnc modifier/led state just got >>> updated to match ledstate ... >> Oh... then how about get rid of this check, let vnc_led_state_change send >> the current led state message directly? > Only sending an update if something did actually change makes sense I > think, but you need to check before updating the state, i.e. something > like this: > > bool has_changed = ledstate != current_led_state(vs); > > [ update modifiers/led state ] > > if (has_changed) > vnc_led_state_change() I see. Thanks for your very good suggestions! I'll send the fix soon. > cheers, > Gerd > > -- Lei