#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 */
{
VhostNetOptions options;
struct vhost_net *net = NULL;
- VhostUserState *s;
+ NetVhostUserState *s;
int max_queues;
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]);
options.net_backend = ncs[i];
options.opaque = be;
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];
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);
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,
static gboolean net_vhost_user_watch(GIOChannel *chan, GIOCondition cond,
void *opaque)
{
- VhostUserState *s = opaque;
+ NetVhostUserState *s = opaque;
qemu_chr_fe_disconnect(&s->chr);
{
const char *name = opaque;
NetClientState *ncs[MAX_QUEUE_NUM];
- VhostUserState *s;
+ NetVhostUserState *s;
Error *err = NULL;
int queues;
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);
{
const char *name = opaque;
NetClientState *ncs[MAX_QUEUE_NUM];
- VhostUserState *s;
+ NetVhostUserState *s;
Chardev *chr;
Error *err = NULL;
int queues;
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) {
{
Error *err = NULL;
NetClientState *nc, *nc0 = NULL;
- VhostUserState *s;
+ NetVhostUserState *s;
int i;
assert(name);
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;
}
- 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);