From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Tiwei Bie <tiwei.bie@intel.com>, Jason Wang <jasowang@redhat.com>
Subject: [Qemu-devel] [PULL 12/28] vhost-user: add Net prefix to internal state structure
Date: Wed, 23 May 2018 17:43:06 +0300 [thread overview]
Message-ID: <1527086545-68024-13-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1527086545-68024-1-git-send-email-mst@redhat.com>
From: Tiwei Bie <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>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.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 e0f16c8..fa28aad 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);
--
MST
next prev parent reply other threads:[~2018-05-23 14:43 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-23 14:42 [Qemu-devel] [PULL 00/28] pc, pci, virtio, vhost: fixes, features Michael S. Tsirkin
2018-05-23 14:42 ` [Qemu-devel] [PULL 01/28] hw/pci-host/q35: Replace hardcoded value with macro Michael S. Tsirkin
2018-05-23 14:42 ` [Qemu-devel] [PULL 02/28] allocate pci id for mdpy Michael S. Tsirkin
2018-05-23 14:42 ` [Qemu-devel] [PULL 03/28] virtio-balloon: add hugetlb page allocation counts Michael S. Tsirkin
2018-05-23 14:42 ` [Qemu-devel] [PULL 04/28] vhost: add trace for IOTLB miss Michael S. Tsirkin
2018-05-23 14:42 ` [Qemu-devel] [PULL 05/28] update-linux-headers.sh: drop kvm_para.h hacks Michael S. Tsirkin
2018-05-23 14:42 ` [Qemu-devel] [PULL 06/28] include/standard-headers: add asm-x86/kvm_para.h Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 07/28] x86/cpu: use standard-headers/asm-x86.kvm_para.h Michael S. Tsirkin
2018-05-25 11:06 ` Peter Maydell
2018-05-25 11:53 ` Peter Maydell
2018-05-25 12:18 ` Michael S. Tsirkin
2018-05-25 12:21 ` Peter Maydell
2018-05-25 12:27 ` Michael S. Tsirkin
2018-05-25 12:30 ` Peter Maydell
2018-05-25 12:35 ` Michael S. Tsirkin
2018-05-25 12:38 ` Peter Maydell
2018-05-25 12:19 ` Michael S. Tsirkin
2018-05-25 14:13 ` Paolo Bonzini
2018-05-23 14:43 ` [Qemu-devel] [PULL 08/28] linux-headers: drop kvm_para.h Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 09/28] update-linux-headers.sh: unistd.h, kvm consistency Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 10/28] linux-headers: add unistd.h on all arches Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 11/28] linux-headers: add kvm header for mips Michael S. Tsirkin
2018-05-23 14:43 ` Michael S. Tsirkin [this message]
2018-05-23 14:43 ` [Qemu-devel] [PULL 13/28] vhost-user: support receiving file descriptors in slave_read Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 15/28] vhost-user+postcopy: Use qemu_set_nonblock Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 14/28] virtio: support setting memory region based host notifier Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 16/28] libvhost-user: Send messages with no data Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 17/28] hw/virtio: Fix brace Werror with clang 6.0.0 Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 19/28] nvdimm: fix typo in label-size definition Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 18/28] contrib/vhost-user-blk: enable protocol feature for vhost-user-blk Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 20/28] intel-iommu: send PSI always even if across PDEs Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 21/28] intel-iommu: remove IntelIOMMUNotifierNode Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 22/28] intel-iommu: add iommu lock Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 23/28] intel-iommu: only do page walk for MAP notifiers Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 24/28] intel-iommu: introduce vtd_page_walk_info Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 25/28] intel-iommu: pass in address space when page walk Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 26/28] intel-iommu: trace domain id during " Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 27/28] util: implement simple iova tree Michael S. Tsirkin
2018-05-23 14:43 ` [Qemu-devel] [PULL 28/28] intel-iommu: rework the page walk logic Michael S. Tsirkin
2018-05-23 15:17 ` [Qemu-devel] [PULL 00/28] pc, pci, virtio, vhost: fixes, features no-reply
2018-05-24 14:18 ` Peter Maydell
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=1527086545-68024-13-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=tiwei.bie@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: 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).