|
From: | Hailiang Zhang |
Subject: | Re: [Qemu-devel] [PATCH COLO-Frame v14 31/40] net/filter: Add a 'status' property for filter object |
Date: | Tue, 23 Feb 2016 17:37:06 +0800 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
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
.
[Prev in Thread] | Current Thread | [Next in Thread] |