qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhijian <lizhijian@cn.fujitsu.com>
To: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>,
	qemu devel <qemu-devel@nongnu.org>,
	Jason Wang <jasowang@redhat.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>,
	"eddie . dong" <eddie.dong@intel.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] net/net: Add ReadState for reuse codes
Date: Tue, 10 May 2016 10:57:51 +0800	[thread overview]
Message-ID: <57314E2F.4010305@cn.fujitsu.com> (raw)
In-Reply-To: <1462532187-22787-1-git-send-email-zhangchen.fnst@cn.fujitsu.com>



On 05/06/2016 06:56 PM, Zhang Chen wrote:
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>   include/net/net.h   |  8 ++++++
>   net/filter-mirror.c | 60 ++++++++------------------------------------
>   net/net.c           | 56 ++++++++++++++++++++++++++++++++++++++++++
>   net/socket.c        | 71 +++++++++++++----------------------------------------
>   4 files changed, 91 insertions(+), 104 deletions(-)
>
> diff --git a/include/net/net.h b/include/net/net.h
> index 73e4c46..1439cf9 100644
> --- a/include/net/net.h
> +++ b/include/net/net.h
> @@ -102,6 +102,14 @@ typedef struct NICState {
>       bool peer_deleted;
>   } NICState;
>
> +typedef struct ReadState {
> +    int state; /* 0 = getting length, 1 = getting data */
> +    uint32_t index;
> +    uint32_t packet_len;
> +    uint8_t buf[NET_BUFSIZE];
> +} ReadState;
> +
> +int net_fill_rstate(ReadState *rs, const uint8_t *buf, int size);
>   char *qemu_mac_strdup_printf(const uint8_t *macaddr);
>   NetClientState *qemu_find_netdev(const char *id);
>   int qemu_find_net_clients_except(const char *id, NetClientState **ncs,
> diff --git a/net/filter-mirror.c b/net/filter-mirror.c
> index c0c4dc6..bcec509 100644
> --- a/net/filter-mirror.c
> +++ b/net/filter-mirror.c
> @@ -40,10 +40,7 @@ typedef struct MirrorState {
>       char *outdev;
>       CharDriverState *chr_in;
>       CharDriverState *chr_out;
> -    int state; /* 0 = getting length, 1 = getting data */
> -    unsigned int index;
> -    unsigned int packet_len;
> -    uint8_t buf[REDIRECTOR_MAX_LEN];
you may need to remove 'REDIRECTOR_MAX_LEN' defination too.

Thanks
Li Zhijian

  reply	other threads:[~2016-05-10  2:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 10:56 [Qemu-devel] [PATCH] net/net: Add ReadState for reuse codes Zhang Chen
2016-05-10  2:57 ` Li Zhijian [this message]
2016-05-10  5:33   ` Zhang Chen
2016-05-11  7:01   ` Zhang Chen
2016-05-11  9:01 ` Jason Wang
2016-05-11 11:20   ` Zhang Chen
2016-05-12  1:11     ` Jason Wang
2016-05-12  6:33       ` Zhang Chen
2016-05-12  8:07         ` Jason Wang
2016-05-12  8:23           ` Zhang Chen

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=57314E2F.4010305@cn.fujitsu.com \
    --to=lizhijian@cn.fujitsu.com \
    --cc=dgilbert@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wency@cn.fujitsu.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).