提交 e05dc4cf 编写于 作者: Z Zhang Chen 提交者: Jason Wang

net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle

Because filter_mirror_receive_iov() and filter_redirector_receive_iov()
both use the filter_mirror_send() to send packet, so I change
filter_mirror_send() to filter_send() that looks more common.
And fix some codestyle.
Signed-off-by: NZhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: NJason Wang <jasowang@redhat.com>
上级 e2f84016
......@@ -43,9 +43,9 @@ typedef struct MirrorState {
SocketReadState rs;
} MirrorState;
static int filter_mirror_send(CharBackend *chr_out,
const struct iovec *iov,
int iovcnt)
static int filter_send(CharBackend *chr_out,
const struct iovec *iov,
int iovcnt)
{
int ret = 0;
ssize_t size = 0;
......@@ -141,9 +141,9 @@ static ssize_t filter_mirror_receive_iov(NetFilterState *nf,
MirrorState *s = FILTER_MIRROR(nf);
int ret;
ret = filter_mirror_send(&s->chr_out, iov, iovcnt);
ret = filter_send(&s->chr_out, iov, iovcnt);
if (ret) {
error_report("filter_mirror_send failed(%s)", strerror(-ret));
error_report("filter mirror send failed(%s)", strerror(-ret));
}
/*
......@@ -164,9 +164,9 @@ static ssize_t filter_redirector_receive_iov(NetFilterState *nf,
int ret;
if (qemu_chr_fe_get_driver(&s->chr_out)) {
ret = filter_mirror_send(&s->chr_out, iov, iovcnt);
ret = filter_send(&s->chr_out, iov, iovcnt);
if (ret) {
error_report("filter_mirror_send failed(%s)", strerror(-ret));
error_report("filter redirector send failed(%s)", strerror(-ret));
}
return iov_size(iov, iovcnt);
} else {
......@@ -286,8 +286,9 @@ static char *filter_redirector_get_indev(Object *obj, Error **errp)
return g_strdup(s->indev);
}
static void
filter_redirector_set_indev(Object *obj, const char *value, Error **errp)
static void filter_redirector_set_indev(Object *obj,
const char *value,
Error **errp)
{
MirrorState *s = FILTER_REDIRECTOR(obj);
......@@ -302,8 +303,9 @@ static char *filter_mirror_get_outdev(Object *obj, Error **errp)
return g_strdup(s->outdev);
}
static void
filter_mirror_set_outdev(Object *obj, const char *value, Error **errp)
static void filter_mirror_set_outdev(Object *obj,
const char *value,
Error **errp)
{
MirrorState *s = FILTER_MIRROR(obj);
......@@ -323,8 +325,9 @@ static char *filter_redirector_get_outdev(Object *obj, Error **errp)
return g_strdup(s->outdev);
}
static void
filter_redirector_set_outdev(Object *obj, const char *value, Error **errp)
static void filter_redirector_set_outdev(Object *obj,
const char *value,
Error **errp)
{
MirrorState *s = FILTER_REDIRECTOR(obj);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册