From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYA9o-0000Kc-2o for qemu-devel@nongnu.org; Tue, 23 Feb 2016 05:25:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYA9l-0002cx-6r for qemu-devel@nongnu.org; Tue, 23 Feb 2016 05:25:27 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:54923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYA9k-0002cr-KW for qemu-devel@nongnu.org; Tue, 23 Feb 2016 05:25:25 -0500 References: <1454750932-7556-1-git-send-email-zhang.zhanghailiang@huawei.com> <1454750932-7556-32-git-send-email-zhang.zhanghailiang@huawei.com> <56C533D3.5020307@redhat.com> <56C53A22.2010706@huawei.com> <56CC19AE.3010200@redhat.com> From: Hailiang Zhang Message-ID: <56CC2842.9060708@huawei.com> Date: Tue, 23 Feb 2016 17:37:06 +0800 MIME-Version: 1.0 In-Reply-To: <56CC19AE.3010200@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH COLO-Frame v14 31/40] net/filter: Add a 'status' property for filter object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , qemu-devel@nongnu.org Cc: xiecl.fnst@cn.fujitsu.com, lizhijian@cn.fujitsu.com, quintela@redhat.com, armbru@redhat.com, yunhong.jiang@intel.com, eddie.dong@intel.com, peter.huangpeng@huawei.com, dgilbert@redhat.com, arei.gonglei@huawei.com, stefanha@redhat.com, amit.shah@redhat.com, zhangchen.fnst@cn.fujitsu.com, hongyang.yang@easystack.cn On 2016/2/23 16:34, Jason Wang wrote: > > > On 02/18/2016 11:27 AM, Hailiang Zhang wrote: >>>> +static void netfilter_set_status(Object *obj, const char *str, >>>> Error **errp) >>>> +{ >>>> + NetFilterState *nf = NETFILTER(obj); >>>> + >>>> + if (!strcmp(str, "enable")) { >>>> + nf->enabled = true; >>>> + } else if (!strcmp(str, "disable")) { >>>> + nf->enabled = false; >>> >>> Do we need a filter specific callback here to drain filter's queue? E.g >>> for filter-buffer ,need to release all the packets that has been >>> buffered. >>> >> >> I don't think we need to do that here, we drain the filter's queue >> explicitly >> when we try to change the filter's status . > > I think we don't do this. E.g what happens if we disable a filter buffer? > Ha, got it, these buffered packets will be buffered until we enable it again, we indeed need to release them while disable it. >> Besides, it seems that, we didn't have a callback in filter layer to >> process >> the queued packets for different types of filters. > > Just need a type specific callback, no? > Yes, we have change the status in filter layer, for different type of filter, they may need to do different things. we need such a callback in NetFilterClass to respond to this. Thanks, Hailaing > . >