Received: from eggs.gnu.org ([2001:4830:134:3::10]:46276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD5cj-0001cM-A7 for qemu-devel@nongnu.org; Mon, 19 Jan 2015 01:15:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YD5ce-0007IA-3a for qemu-devel@nongnu.org; Mon, 19 Jan 2015 01:15:41 -0500 Received: from smtp.sangfor.com.cn ([58.251.49.30]:33483 helo=mail.sangfor.com.cn) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD5cd-0007Gq-Ay for qemu-devel@nongnu.org; Mon, 19 Jan 2015 01:15:35 -0500 Date: Mon, 19 Jan 2015 14:15:21 +0800 From: "=?utf-8?B?WmhhbmcgSGFveXU=?=" References: <201501171448236261522@sangfor.com.cn>, , Message-ID: <201501191415200853264@sangfor.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] =?utf-8?q?=5BPATCH=5D_spice-char=3A_fix_wrong_assert?= =?utf-8?q?_condition?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?UGV0ZXIgTWF5ZGVsbA==?= Cc: =?utf-8?B?UGFvbG8gQm9uemluaQ==?= , =?utf-8?B?cWVtdS1kZXZlbA==?= On 2015-01-17 19:55:16, Peter Maydell wrote: >On 17 January 2015 at 11:52, Peter Maydell wrote: > > On 17 January 2015 at 06:48, Zhang Haoyu wrote: > >> G_IO_OUT|G_IO_HUP are passed from all of the callers > >> of chr_add_watch hooker, the assert condition MUST be > >> changed. >> > > "All the callers do this currently" isn't a reason to > > change an assert. Possible reasons to change it include: > > * "X is required because if we don't then things break because Y" >> * "it is meaningless (a programming error) to do X, because Y" > > > > Can you give the reasoning for changing this assert? > > Does it apply also to other add_watch hook functions? > > Would the assert be better at a higher level in the callstack? > > ...that said, I've just figured out what your patch is trying > to fix. I think that kind of makes the point about the commit > message not really being very clear about why the change is >being made, though. (Should we be checking > '(cond & G_IO_OUT) != 0'? I think '(cond & G_IO_OUT) != 0' is better, v2 will be posted. > Is this a bandaid over missing > functionality in the spice chardriver?) I really don't know about this. > > -- PMM