From: Jason Wang <jasowang@redhat.com>
To: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>,
qemu devel <qemu-devel@nongnu.org>
Cc: zhanghailiang <zhang.zhanghailiang@huawei.com>,
Li Zhijian <lizhijian@cn.fujitsu.com>,
Gui jianfeng <guijianfeng@cn.fujitsu.com>,
"eddie.dong" <eddie.dong@intel.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Yang Hongyang <hongyang.yang@easystack.cn>
Subject: Re: [Qemu-devel] [PATCH V2] net/filter-mirror: Change filter_mirror_send interface
Date: Wed, 16 Mar 2016 12:12:22 +0800 [thread overview]
Message-ID: <56E8DD26.3060803@redhat.com> (raw)
In-Reply-To: <1458036171-573-1-git-send-email-zhangchen.fnst@cn.fujitsu.com>
On 03/15/2016 06:02 PM, Zhang Chen wrote:
> Change filter_mirror_send interface to make it easier
> to used by other filter
>
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
> net/filter-mirror.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/net/filter-mirror.c b/net/filter-mirror.c
> index 2e2ed27..1b1ec16 100644
> --- a/net/filter-mirror.c
> +++ b/net/filter-mirror.c
> @@ -34,11 +34,10 @@ typedef struct MirrorState {
> CharDriverState *chr_out;
> } MirrorState;
>
> -static int filter_mirror_send(NetFilterState *nf,
> +static int filter_mirror_send(CharDriverState *chr_out,
> const struct iovec *iov,
> int iovcnt)
> {
> - MirrorState *s = FILTER_MIRROR(nf);
> int ret = 0;
> ssize_t size = 0;
> uint32_t len = 0;
> @@ -50,14 +49,14 @@ static int filter_mirror_send(NetFilterState *nf,
> }
>
> len = htonl(size);
> - ret = qemu_chr_fe_write_all(s->chr_out, (uint8_t *)&len, sizeof(len));
> + ret = qemu_chr_fe_write_all(chr_out, (uint8_t *)&len, sizeof(len));
> if (ret != sizeof(len)) {
> goto err;
> }
>
> buf = g_malloc(size);
> iov_to_buf(iov, iovcnt, 0, buf, size);
> - ret = qemu_chr_fe_write_all(s->chr_out, (uint8_t *)buf, size);
> + ret = qemu_chr_fe_write_all(chr_out, (uint8_t *)buf, size);
> g_free(buf);
> if (ret != size) {
> goto err;
> @@ -76,9 +75,10 @@ static ssize_t filter_mirror_receive_iov(NetFilterState *nf,
> int iovcnt,
> NetPacketSent *sent_cb)
> {
> + MirrorState *s = FILTER_MIRROR(nf);
> int ret;
>
> - ret = filter_mirror_send(nf, iov, iovcnt);
> + ret = filter_mirror_send(s->chr_out, iov, iovcnt);
> if (ret) {
> error_report("filter_mirror_send failed(%s)", strerror(-ret));
> }
Applied to -net.
Thanks
prev parent reply other threads:[~2016-03-16 4:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-15 10:02 [Qemu-devel] [PATCH V2] net/filter-mirror: Change filter_mirror_send interface Zhang Chen
2016-03-16 4:12 ` Jason Wang [this message]
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=56E8DD26.3060803@redhat.com \
--to=jasowang@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eddie.dong@intel.com \
--cc=guijianfeng@cn.fujitsu.com \
--cc=hongyang.yang@easystack.cn \
--cc=lizhijian@cn.fujitsu.com \
--cc=qemu-devel@nongnu.org \
--cc=zhang.zhanghailiang@huawei.com \
--cc=zhangchen.fnst@cn.fujitsu.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).