From: Jason Wang <jasowang@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>, qemu-devel@nongnu.org
Cc: hongyang.yang@easystack.cn
Subject: Re: [Qemu-devel] [PATCH v2 1/2] filter: Add 'status' property for filter object
Date: Mon, 29 Feb 2016 15:26:24 +0800 [thread overview]
Message-ID: <56D3F2A0.9060403@redhat.com> (raw)
In-Reply-To: <1456710366-10980-2-git-send-email-zhang.zhanghailiang@huawei.com>
On 02/29/2016 09:46 AM, zhanghailiang wrote:
> With this property, users can control if this filter is 'on'
> or 'off'. The default behavior for filter is 'on'.
>
> For some types of filters, they may need to react to status changing,
> So here, we introduced status changing callback/notifier for filter class.
>
> We will skip the disabled ('off') filter when delivering packets in net layer.
>
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Yang Hongyang <hongyang.yang@easystack.cn>
> ---
> v2:
> - Split the processing of buffer-filter into a new patch (Jason)
> - Use 'status' instead of 'enabled' to store the filter state (Jason)
> - Rename FilterDisable() callback to FilterStatusChanged(Jason)
> ---
Thanks, looks good, just few nits.
> include/net/filter.h | 4 ++++
> net/filter.c | 42 ++++++++++++++++++++++++++++++++++++++++++
> qemu-options.hx | 4 +++-
> 3 files changed, 49 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/filter.h b/include/net/filter.h
> index 5639976..ebef0dc 100644
> --- a/include/net/filter.h
> +++ b/include/net/filter.h
> @@ -36,12 +36,15 @@ typedef ssize_t (FilterReceiveIOV)(NetFilterState *nc,
> int iovcnt,
> NetPacketSent *sent_cb);
>
> +typedef void (FilterStatusChanged) (NetFilterState *nf, Error **errp);
> +
> typedef struct NetFilterClass {
> ObjectClass parent_class;
>
> /* optional */
> FilterSetup *setup;
> FilterCleanup *cleanup;
> + FilterStatusChanged *status_changed;
> /* mandatory */
> FilterReceiveIOV *receive_iov;
> } NetFilterClass;
> @@ -55,6 +58,7 @@ struct NetFilterState {
> char *netdev_id;
> NetClientState *netdev;
> NetFilterDirection direction;
> + char *status;
Let's use bool instead.
next prev parent reply other threads:[~2016-02-29 7:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 1:46 [Qemu-devel] [PATCH v2 0/2] Introduce 'status' property for netfilter zhanghailiang
2016-02-29 1:46 ` [Qemu-devel] [PATCH v2 1/2] filter: Add 'status' property for filter object zhanghailiang
2016-02-29 7:26 ` Jason Wang [this message]
2016-02-29 7:34 ` Hailiang Zhang
2016-03-01 2:37 ` Jason Wang
2016-02-29 1:46 ` [Qemu-devel] [PATCH v2 2/2] filter-buffer: Add status_changed callback processing zhanghailiang
2016-02-29 7:27 ` Jason Wang
2016-02-29 7:36 ` Hailiang Zhang
2016-03-01 2:40 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56D3F2A0.9060403@redhat.com \
--to=jasowang@redhat.com \
--cc=hongyang.yang@easystack.cn \
--cc=qemu-devel@nongnu.org \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).