4 * Copyright Red Hat, Inc. 2010
7 * Michael S. Tsirkin <mst@redhat.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
13 #include "qemu/osdep.h"
16 #include "net/vhost-user.h"
18 #include "hw/virtio/virtio-net.h"
19 #include "net/vhost_net.h"
20 #include "qemu/error-report.h"
23 uint64_t vhost_net_get_max_queues(VHostNetState
*net
)
28 struct vhost_net
*vhost_net_init(VhostNetOptions
*options
)
30 error_report("vhost-net support is not compiled in");
34 int vhost_net_start(VirtIODevice
*dev
,
36 int data_queue_pairs
, int cvq
)
40 void vhost_net_stop(VirtIODevice
*dev
,
42 int data_queue_pairs
, int cvq
)
46 void vhost_net_cleanup(struct vhost_net
*net
)
50 uint64_t vhost_net_get_features(struct vhost_net
*net
, uint64_t features
)
55 int vhost_net_get_config(struct vhost_net
*net
, uint8_t *config
,
60 int vhost_net_set_config(struct vhost_net
*net
, const uint8_t *data
,
61 uint32_t offset
, uint32_t size
, uint32_t flags
)
66 void vhost_net_ack_features(struct vhost_net
*net
, uint64_t features
)
70 uint64_t vhost_net_get_acked_features(VHostNetState
*net
)
75 bool vhost_net_virtqueue_pending(VHostNetState
*net
, int idx
)
80 void vhost_net_virtqueue_mask(VHostNetState
*net
, VirtIODevice
*dev
,
85 int vhost_net_notify_migration_done(struct vhost_net
*net
, char* mac_addr
)
90 VHostNetState
*get_vhost_net(NetClientState
*nc
)
95 int vhost_set_vring_enable(NetClientState
*nc
, int enable
)
100 int vhost_net_set_mtu(struct vhost_net
*net
, uint16_t mtu
)