From: Tiwei Bie <tiwei.bie@intel.com> To: mst@redhat.com, jasowang@redhat.com, alex.williamson@redhat.com, pbonzini@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org Cc: cunming.liang@intel.com, dan.daly@intel.com, jianfeng.tan@intel.com, zhihong.wang@intel.com, xiao.w.wang@intel.com, tiwei.bie@intel.com Subject: [Qemu-devel] [PATCH v3 1/6] vhost-user: add Net prefix to internal state structure Date: Thu, 12 Apr 2018 23:12:27 +0800 [thread overview] Message-ID: <20180412151232.17506-2-tiwei.bie@intel.com> (raw) In-Reply-To: <20180412151232.17506-1-tiwei.bie@intel.com> We are going to introduce a shared vhost user state which will be named as 'VhostUserState'. So add 'Net' prefix to the existing internal state structure in the vhost-user netdev to avoid conflict. Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> --- net/vhost-user.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index e0f16c895b..fa28aad12d 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -20,38 +20,38 @@ #include "qemu/option.h" #include "trace.h" -typedef struct VhostUserState { +typedef struct NetVhostUserState { NetClientState nc; CharBackend chr; /* only queue index 0 */ VHostNetState *vhost_net; guint watch; uint64_t acked_features; bool started; -} VhostUserState; +} NetVhostUserState; VHostNetState *vhost_user_get_vhost_net(NetClientState *nc) { - VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); + NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_USER); return s->vhost_net; } uint64_t vhost_user_get_acked_features(NetClientState *nc) { - VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); + NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_USER); return s->acked_features; } static void vhost_user_stop(int queues, NetClientState *ncs[]) { - VhostUserState *s; + NetVhostUserState *s; int i; for (i = 0; i < queues; i++) { assert(ncs[i]->info->type == NET_CLIENT_DRIVER_VHOST_USER); - s = DO_UPCAST(VhostUserState, nc, ncs[i]); + s = DO_UPCAST(NetVhostUserState, nc, ncs[i]); if (s->vhost_net) { /* save acked features */ @@ -68,7 +68,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) { VhostNetOptions options; struct vhost_net *net = NULL; - VhostUserState *s; + NetVhostUserState *s; int max_queues; int i; @@ -77,7 +77,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) for (i = 0; i < queues; i++) { assert(ncs[i]->info->type == NET_CLIENT_DRIVER_VHOST_USER); - s = DO_UPCAST(VhostUserState, nc, ncs[i]); + s = DO_UPCAST(NetVhostUserState, nc, ncs[i]); options.net_backend = ncs[i]; options.opaque = be; @@ -123,7 +123,7 @@ static ssize_t vhost_user_receive(NetClientState *nc, const uint8_t *buf, without GUEST_ANNOUNCE capability. */ if (size == 60) { - VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); + NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); int r; static int display_rarp_failure = 1; char mac_addr[6]; @@ -146,7 +146,7 @@ static ssize_t vhost_user_receive(NetClientState *nc, const uint8_t *buf, static void vhost_user_cleanup(NetClientState *nc) { - VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); + NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); if (s->vhost_net) { vhost_net_cleanup(s->vhost_net); @@ -180,7 +180,7 @@ static bool vhost_user_has_ufo(NetClientState *nc) static NetClientInfo net_vhost_user_info = { .type = NET_CLIENT_DRIVER_VHOST_USER, - .size = sizeof(VhostUserState), + .size = sizeof(NetVhostUserState), .receive = vhost_user_receive, .cleanup = vhost_user_cleanup, .has_vnet_hdr = vhost_user_has_vnet_hdr, @@ -190,7 +190,7 @@ static NetClientInfo net_vhost_user_info = { static gboolean net_vhost_user_watch(GIOChannel *chan, GIOCondition cond, void *opaque) { - VhostUserState *s = opaque; + NetVhostUserState *s = opaque; qemu_chr_fe_disconnect(&s->chr); @@ -203,7 +203,7 @@ static void chr_closed_bh(void *opaque) { const char *name = opaque; NetClientState *ncs[MAX_QUEUE_NUM]; - VhostUserState *s; + NetVhostUserState *s; Error *err = NULL; int queues; @@ -212,7 +212,7 @@ static void chr_closed_bh(void *opaque) MAX_QUEUE_NUM); assert(queues < MAX_QUEUE_NUM); - s = DO_UPCAST(VhostUserState, nc, ncs[0]); + s = DO_UPCAST(NetVhostUserState, nc, ncs[0]); qmp_set_link(name, false, &err); vhost_user_stop(queues, ncs); @@ -229,7 +229,7 @@ static void net_vhost_user_event(void *opaque, int event) { const char *name = opaque; NetClientState *ncs[MAX_QUEUE_NUM]; - VhostUserState *s; + NetVhostUserState *s; Chardev *chr; Error *err = NULL; int queues; @@ -239,7 +239,7 @@ static void net_vhost_user_event(void *opaque, int event) MAX_QUEUE_NUM); assert(queues < MAX_QUEUE_NUM); - s = DO_UPCAST(VhostUserState, nc, ncs[0]); + s = DO_UPCAST(NetVhostUserState, nc, ncs[0]); chr = qemu_chr_fe_get_driver(&s->chr); trace_vhost_user_event(chr->label, event); switch (event) { @@ -283,7 +283,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, { Error *err = NULL; NetClientState *nc, *nc0 = NULL; - VhostUserState *s; + NetVhostUserState *s; int i; assert(name); @@ -296,7 +296,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, nc->queue_index = i; if (!nc0) { nc0 = nc; - s = DO_UPCAST(VhostUserState, nc, nc); + s = DO_UPCAST(NetVhostUserState, nc, nc); if (!qemu_chr_fe_init(&s->chr, chr, &err)) { error_report_err(err); return -1; @@ -305,7 +305,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, } - s = DO_UPCAST(VhostUserState, nc, nc0); + s = DO_UPCAST(NetVhostUserState, nc, nc0); do { if (qemu_chr_fe_wait_connected(&s->chr, &err) < 0) { error_report_err(err); -- 2.11.0
WARNING: multiple messages have this Message-ID (diff)
From: Tiwei Bie <tiwei.bie@intel.com> To: mst@redhat.com, jasowang@redhat.com, alex.williamson@redhat.com, pbonzini@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org, virtio-dev@lists.oasis-open.org Cc: cunming.liang@intel.com, dan.daly@intel.com, jianfeng.tan@intel.com, zhihong.wang@intel.com, xiao.w.wang@intel.com, tiwei.bie@intel.com Subject: [virtio-dev] [PATCH v3 1/6] vhost-user: add Net prefix to internal state structure Date: Thu, 12 Apr 2018 23:12:27 +0800 [thread overview] Message-ID: <20180412151232.17506-2-tiwei.bie@intel.com> (raw) In-Reply-To: <20180412151232.17506-1-tiwei.bie@intel.com> We are going to introduce a shared vhost user state which will be named as 'VhostUserState'. So add 'Net' prefix to the existing internal state structure in the vhost-user netdev to avoid conflict. Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> --- net/vhost-user.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index e0f16c895b..fa28aad12d 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -20,38 +20,38 @@ #include "qemu/option.h" #include "trace.h" -typedef struct VhostUserState { +typedef struct NetVhostUserState { NetClientState nc; CharBackend chr; /* only queue index 0 */ VHostNetState *vhost_net; guint watch; uint64_t acked_features; bool started; -} VhostUserState; +} NetVhostUserState; VHostNetState *vhost_user_get_vhost_net(NetClientState *nc) { - VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); + NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_USER); return s->vhost_net; } uint64_t vhost_user_get_acked_features(NetClientState *nc) { - VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); + NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_USER); return s->acked_features; } static void vhost_user_stop(int queues, NetClientState *ncs[]) { - VhostUserState *s; + NetVhostUserState *s; int i; for (i = 0; i < queues; i++) { assert(ncs[i]->info->type == NET_CLIENT_DRIVER_VHOST_USER); - s = DO_UPCAST(VhostUserState, nc, ncs[i]); + s = DO_UPCAST(NetVhostUserState, nc, ncs[i]); if (s->vhost_net) { /* save acked features */ @@ -68,7 +68,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) { VhostNetOptions options; struct vhost_net *net = NULL; - VhostUserState *s; + NetVhostUserState *s; int max_queues; int i; @@ -77,7 +77,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be) for (i = 0; i < queues; i++) { assert(ncs[i]->info->type == NET_CLIENT_DRIVER_VHOST_USER); - s = DO_UPCAST(VhostUserState, nc, ncs[i]); + s = DO_UPCAST(NetVhostUserState, nc, ncs[i]); options.net_backend = ncs[i]; options.opaque = be; @@ -123,7 +123,7 @@ static ssize_t vhost_user_receive(NetClientState *nc, const uint8_t *buf, without GUEST_ANNOUNCE capability. */ if (size == 60) { - VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); + NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); int r; static int display_rarp_failure = 1; char mac_addr[6]; @@ -146,7 +146,7 @@ static ssize_t vhost_user_receive(NetClientState *nc, const uint8_t *buf, static void vhost_user_cleanup(NetClientState *nc) { - VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc); + NetVhostUserState *s = DO_UPCAST(NetVhostUserState, nc, nc); if (s->vhost_net) { vhost_net_cleanup(s->vhost_net); @@ -180,7 +180,7 @@ static bool vhost_user_has_ufo(NetClientState *nc) static NetClientInfo net_vhost_user_info = { .type = NET_CLIENT_DRIVER_VHOST_USER, - .size = sizeof(VhostUserState), + .size = sizeof(NetVhostUserState), .receive = vhost_user_receive, .cleanup = vhost_user_cleanup, .has_vnet_hdr = vhost_user_has_vnet_hdr, @@ -190,7 +190,7 @@ static NetClientInfo net_vhost_user_info = { static gboolean net_vhost_user_watch(GIOChannel *chan, GIOCondition cond, void *opaque) { - VhostUserState *s = opaque; + NetVhostUserState *s = opaque; qemu_chr_fe_disconnect(&s->chr); @@ -203,7 +203,7 @@ static void chr_closed_bh(void *opaque) { const char *name = opaque; NetClientState *ncs[MAX_QUEUE_NUM]; - VhostUserState *s; + NetVhostUserState *s; Error *err = NULL; int queues; @@ -212,7 +212,7 @@ static void chr_closed_bh(void *opaque) MAX_QUEUE_NUM); assert(queues < MAX_QUEUE_NUM); - s = DO_UPCAST(VhostUserState, nc, ncs[0]); + s = DO_UPCAST(NetVhostUserState, nc, ncs[0]); qmp_set_link(name, false, &err); vhost_user_stop(queues, ncs); @@ -229,7 +229,7 @@ static void net_vhost_user_event(void *opaque, int event) { const char *name = opaque; NetClientState *ncs[MAX_QUEUE_NUM]; - VhostUserState *s; + NetVhostUserState *s; Chardev *chr; Error *err = NULL; int queues; @@ -239,7 +239,7 @@ static void net_vhost_user_event(void *opaque, int event) MAX_QUEUE_NUM); assert(queues < MAX_QUEUE_NUM); - s = DO_UPCAST(VhostUserState, nc, ncs[0]); + s = DO_UPCAST(NetVhostUserState, nc, ncs[0]); chr = qemu_chr_fe_get_driver(&s->chr); trace_vhost_user_event(chr->label, event); switch (event) { @@ -283,7 +283,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, { Error *err = NULL; NetClientState *nc, *nc0 = NULL; - VhostUserState *s; + NetVhostUserState *s; int i; assert(name); @@ -296,7 +296,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, nc->queue_index = i; if (!nc0) { nc0 = nc; - s = DO_UPCAST(VhostUserState, nc, nc); + s = DO_UPCAST(NetVhostUserState, nc, nc); if (!qemu_chr_fe_init(&s->chr, chr, &err)) { error_report_err(err); return -1; @@ -305,7 +305,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, } - s = DO_UPCAST(VhostUserState, nc, nc0); + s = DO_UPCAST(NetVhostUserState, nc, nc0); do { if (qemu_chr_fe_wait_connected(&s->chr, &err) < 0) { error_report_err(err); -- 2.11.0 --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
next prev parent reply other threads:[~2018-04-12 15:14 UTC|newest] Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-04-12 15:12 [Qemu-devel] [PATCH v3 0/6] Extend vhost-user to support registering external host notifiers Tiwei Bie 2018-04-12 15:12 ` [virtio-dev] " Tiwei Bie 2018-04-12 15:12 ` Tiwei Bie [this message] 2018-04-12 15:12 ` [virtio-dev] [PATCH v3 1/6] vhost-user: add Net prefix to internal state structure Tiwei Bie 2018-04-12 15:12 ` [Qemu-devel] [PATCH v3 2/6] vhost-user: introduce shared vhost-user state Tiwei Bie 2018-04-12 15:12 ` [virtio-dev] " Tiwei Bie 2018-05-23 13:44 ` [Qemu-devel] " Michael S. Tsirkin 2018-05-23 13:44 ` [virtio-dev] " Michael S. Tsirkin 2018-05-23 15:36 ` [Qemu-devel] " Michael S. Tsirkin 2018-05-23 15:36 ` [virtio-dev] " Michael S. Tsirkin 2018-05-23 15:43 ` [Qemu-devel] " Michael S. Tsirkin 2018-05-23 15:43 ` [virtio-dev] " Michael S. Tsirkin 2018-05-23 23:21 ` [Qemu-devel] " Tiwei Bie 2018-05-23 23:21 ` [virtio-dev] " Tiwei Bie 2018-05-24 2:24 ` [Qemu-devel] " Tiwei Bie 2018-05-24 2:24 ` [virtio-dev] " Tiwei Bie 2018-05-24 7:03 ` [Qemu-devel] " Tiwei Bie 2018-05-24 7:03 ` [virtio-dev] " Tiwei Bie 2018-05-24 10:59 ` [Qemu-devel] " Tiwei Bie 2018-05-24 10:59 ` [virtio-dev] " Tiwei Bie 2018-05-24 13:55 ` [Qemu-devel] " Michael S. Tsirkin 2018-05-24 13:55 ` [virtio-dev] " Michael S. Tsirkin 2018-05-24 14:54 ` [Qemu-devel] " Tiwei Bie 2018-05-24 14:54 ` Tiwei Bie 2018-05-24 14:30 ` [Qemu-devel] " Michael S. Tsirkin 2018-05-24 14:30 ` [virtio-dev] " Michael S. Tsirkin 2018-05-24 15:22 ` [Qemu-devel] " Tiwei Bie 2018-05-24 15:22 ` [virtio-dev] " Tiwei Bie 2018-05-24 13:50 ` [Qemu-devel] " Michael S. Tsirkin 2018-05-24 13:50 ` [virtio-dev] " Michael S. Tsirkin 2018-04-12 15:12 ` [Qemu-devel] [PATCH v3 3/6] vhost-user: support receiving file descriptors in slave_read Tiwei Bie 2018-04-12 15:12 ` [virtio-dev] " Tiwei Bie 2018-05-23 21:25 ` [Qemu-devel] " Michael S. Tsirkin 2018-05-23 21:25 ` [virtio-dev] " Michael S. Tsirkin 2018-05-23 23:12 ` [Qemu-devel] " Tiwei Bie 2018-05-23 23:12 ` Tiwei Bie 2018-05-24 13:48 ` [Qemu-devel] " Michael S. Tsirkin 2018-05-24 13:48 ` Michael S. Tsirkin 2018-05-24 14:56 ` [Qemu-devel] " Tiwei Bie 2018-05-24 14:56 ` Tiwei Bie 2018-04-12 15:12 ` [Qemu-devel] [PATCH v3 4/6] virtio: support setting memory region based host notifier Tiwei Bie 2018-04-12 15:12 ` [virtio-dev] " Tiwei Bie 2018-04-12 15:12 ` [Qemu-devel] [PATCH v3 5/6] vhost: allow backends to filter memory sections Tiwei Bie 2018-04-12 15:12 ` [virtio-dev] " Tiwei Bie 2018-04-12 15:12 ` [Qemu-devel] [PATCH v3 6/6] vhost-user: support registering external host notifiers Tiwei Bie 2018-04-12 15:12 ` [virtio-dev] " Tiwei Bie 2018-04-18 16:34 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-18 16:34 ` [virtio-dev] " Michael S. Tsirkin 2018-04-19 11:14 ` [Qemu-devel] " Tiwei Bie 2018-04-19 11:14 ` [virtio-dev] " Tiwei Bie 2018-04-19 12:43 ` [Qemu-devel] " Liang, Cunming 2018-04-19 12:43 ` [virtio-dev] " Liang, Cunming 2018-04-19 13:02 ` [Qemu-devel] " Paolo Bonzini 2018-04-19 13:02 ` Paolo Bonzini 2018-04-19 15:19 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 15:19 ` Michael S. Tsirkin 2018-04-19 15:51 ` [Qemu-devel] " Paolo Bonzini 2018-04-19 15:51 ` Paolo Bonzini 2018-04-19 15:59 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 15:59 ` Michael S. Tsirkin 2018-04-19 16:07 ` [Qemu-devel] " Paolo Bonzini 2018-04-19 16:07 ` Paolo Bonzini 2018-04-19 16:48 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 16:48 ` Michael S. Tsirkin 2018-04-19 16:24 ` [Qemu-devel] " Liang, Cunming 2018-04-19 16:24 ` Liang, Cunming 2018-04-19 16:55 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 16:55 ` Michael S. Tsirkin 2018-04-20 3:01 ` [Qemu-devel] " Liang, Cunming 2018-04-20 3:01 ` Liang, Cunming 2018-04-19 15:42 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 15:42 ` [virtio-dev] " Michael S. Tsirkin 2018-04-19 15:52 ` [Qemu-devel] " Paolo Bonzini 2018-04-19 15:52 ` [virtio-dev] " Paolo Bonzini 2018-04-19 16:34 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 16:34 ` [virtio-dev] " Michael S. Tsirkin 2018-04-19 16:52 ` [Qemu-devel] " Liang, Cunming 2018-04-19 16:52 ` [virtio-dev] " Liang, Cunming 2018-04-19 16:59 ` [Qemu-devel] " Paolo Bonzini 2018-04-19 16:59 ` Paolo Bonzini 2018-04-19 17:27 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 17:27 ` Michael S. Tsirkin 2018-04-19 17:35 ` [Qemu-devel] " Paolo Bonzini 2018-04-19 17:35 ` Paolo Bonzini 2018-04-19 17:39 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 17:39 ` Michael S. Tsirkin 2018-04-19 17:00 ` [Qemu-devel] " Michael S. Tsirkin 2018-04-19 17:00 ` [virtio-dev] " Michael S. Tsirkin 2018-04-19 23:05 ` [Qemu-devel] " Liang, Cunming 2018-04-19 23:05 ` [virtio-dev] " Liang, Cunming 2018-04-19 16:27 ` [Qemu-devel] " Liang, Cunming 2018-04-19 16:27 ` [virtio-dev] " Liang, Cunming 2018-05-02 10:32 ` [Qemu-devel] " Tiwei Bie 2018-05-02 10:32 ` [virtio-dev] " Tiwei Bie 2018-05-16 1:41 ` [Qemu-devel] [PATCH v3 0/6] Extend vhost-user to " Michael S. Tsirkin 2018-05-16 1:41 ` [virtio-dev] " Michael S. Tsirkin 2018-05-16 1:56 ` [Qemu-devel] " Tiwei Bie 2018-05-16 1:56 ` [virtio-dev] " Tiwei Bie
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=20180412151232.17506-2-tiwei.bie@intel.com \ --to=tiwei.bie@intel.com \ --cc=alex.williamson@redhat.com \ --cc=cunming.liang@intel.com \ --cc=dan.daly@intel.com \ --cc=jasowang@redhat.com \ --cc=jianfeng.tan@intel.com \ --cc=mst@redhat.com \ --cc=pbonzini@redhat.com \ --cc=qemu-devel@nongnu.org \ --cc=stefanha@redhat.com \ --cc=virtio-dev@lists.oasis-open.org \ --cc=xiao.w.wang@intel.com \ --cc=zhihong.wang@intel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.