xref: /openbmc/qemu/hw/net/vhost_net-stub.c (revision 6fae7ce1488e3f5bdcc1747564ea68e7f6f0e931)
1 /*
2  * vhost-net support
3  *
4  * Copyright Red Hat, Inc. 2010
5  *
6  * Authors:
7  *  Michael S. Tsirkin <mst@redhat.com>
8  *
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.
11  */
12 
13 #include "qemu/osdep.h"
14 #include "net/net.h"
15 #include "net/tap.h"
16 
17 #include "hw/virtio/virtio-net.h"
18 #include "net/vhost_net.h"
19 #include "qemu/error-report.h"
20 
21 
vhost_net_get_max_queues(VHostNetState * net)22 uint64_t vhost_net_get_max_queues(VHostNetState *net)
23 {
24     return 1;
25 }
26 
vhost_net_init(VhostNetOptions * options)27 struct vhost_net *vhost_net_init(VhostNetOptions *options)
28 {
29     error_report("vhost-net support is not compiled in");
30     return NULL;
31 }
32 
vhost_net_start(VirtIODevice * dev,NetClientState * ncs,int data_queue_pairs,int cvq)33 int vhost_net_start(VirtIODevice *dev,
34                     NetClientState *ncs,
35                     int data_queue_pairs, int cvq)
36 {
37     return -ENOSYS;
38 }
vhost_net_stop(VirtIODevice * dev,NetClientState * ncs,int data_queue_pairs,int cvq)39 void vhost_net_stop(VirtIODevice *dev,
40                     NetClientState *ncs,
41                     int data_queue_pairs, int cvq)
42 {
43 }
44 
vhost_net_cleanup(struct vhost_net * net)45 void vhost_net_cleanup(struct vhost_net *net)
46 {
47 }
48 
vhost_net_get_features(struct vhost_net * net,uint64_t features)49 uint64_t vhost_net_get_features(struct vhost_net *net, uint64_t features)
50 {
51     return features;
52 }
53 
vhost_net_get_config(struct vhost_net * net,uint8_t * config,uint32_t config_len)54 int vhost_net_get_config(struct vhost_net *net,  uint8_t *config,
55                          uint32_t config_len)
56 {
57     return 0;
58 }
vhost_net_set_config(struct vhost_net * net,const uint8_t * data,uint32_t offset,uint32_t size,uint32_t flags)59 int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,
60                          uint32_t offset, uint32_t size, uint32_t flags)
61 {
62     return 0;
63 }
64 
vhost_net_ack_features(struct vhost_net * net,uint64_t features)65 void vhost_net_ack_features(struct vhost_net *net, uint64_t features)
66 {
67 }
68 
vhost_net_get_acked_features(VHostNetState * net)69 uint64_t vhost_net_get_acked_features(VHostNetState *net)
70 {
71     return 0;
72 }
73 
vhost_net_virtqueue_pending(VHostNetState * net,int idx)74 bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
75 {
76     return false;
77 }
78 
vhost_net_virtqueue_mask(VHostNetState * net,VirtIODevice * dev,int idx,bool mask)79 void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
80                               int idx, bool mask)
81 {
82 }
83 
vhost_net_config_pending(VHostNetState * net)84 bool vhost_net_config_pending(VHostNetState *net)
85 {
86     return false;
87 }
88 
vhost_net_config_mask(VHostNetState * net,VirtIODevice * dev,bool mask)89 void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mask)
90 {
91 }
92 
vhost_net_notify_migration_done(struct vhost_net * net,char * mac_addr)93 int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr)
94 {
95     return -1;
96 }
97 
get_vhost_net(NetClientState * nc)98 VHostNetState *get_vhost_net(NetClientState *nc)
99 {
100     return 0;
101 }
102 
vhost_net_set_vring_enable(NetClientState * nc,int enable)103 int vhost_net_set_vring_enable(NetClientState *nc, int enable)
104 {
105     return 0;
106 }
107 
vhost_net_set_mtu(struct vhost_net * net,uint16_t mtu)108 int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
109 {
110     return 0;
111 }
112 
vhost_net_virtqueue_reset(VirtIODevice * vdev,NetClientState * nc,int vq_index)113 void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc,
114                                int vq_index)
115 {
116 
117 }
118 
vhost_net_virtqueue_restart(VirtIODevice * vdev,NetClientState * nc,int vq_index)119 int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc,
120                                 int vq_index)
121 {
122     return 0;
123 }
124 
vhost_net_save_acked_features(NetClientState * nc)125 void vhost_net_save_acked_features(NetClientState *nc)
126 {
127 
128 }
129