vhost_net-stub.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. #include "qemu/osdep.h"
  13. #include "net/net.h"
  14. #include "net/tap.h"
  15. #include "net/vhost-user.h"
  16. #include "hw/virtio/virtio-net.h"
  17. #include "net/vhost_net.h"
  18. #include "qemu/error-report.h"
  19. uint64_t vhost_net_get_max_queues(VHostNetState *net)
  20. {
  21. return 1;
  22. }
  23. struct vhost_net *vhost_net_init(VhostNetOptions *options)
  24. {
  25. error_report("vhost-net support is not compiled in");
  26. return NULL;
  27. }
  28. int vhost_net_start(VirtIODevice *dev,
  29. NetClientState *ncs,
  30. int data_queue_pairs, int cvq)
  31. {
  32. return -ENOSYS;
  33. }
  34. void vhost_net_stop(VirtIODevice *dev,
  35. NetClientState *ncs,
  36. int data_queue_pairs, int cvq)
  37. {
  38. }
  39. void vhost_net_cleanup(struct vhost_net *net)
  40. {
  41. }
  42. uint64_t vhost_net_get_features(struct vhost_net *net, uint64_t features)
  43. {
  44. return features;
  45. }
  46. int vhost_net_get_config(struct vhost_net *net, uint8_t *config,
  47. uint32_t config_len)
  48. {
  49. return 0;
  50. }
  51. int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,
  52. uint32_t offset, uint32_t size, uint32_t flags)
  53. {
  54. return 0;
  55. }
  56. void vhost_net_ack_features(struct vhost_net *net, uint64_t features)
  57. {
  58. }
  59. uint64_t vhost_net_get_acked_features(VHostNetState *net)
  60. {
  61. return 0;
  62. }
  63. bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
  64. {
  65. return false;
  66. }
  67. void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
  68. int idx, bool mask)
  69. {
  70. }
  71. bool vhost_net_config_pending(VHostNetState *net)
  72. {
  73. return false;
  74. }
  75. void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mask)
  76. {
  77. }
  78. int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr)
  79. {
  80. return -1;
  81. }
  82. VHostNetState *get_vhost_net(NetClientState *nc)
  83. {
  84. return 0;
  85. }
  86. int vhost_set_vring_enable(NetClientState *nc, int enable)
  87. {
  88. return 0;
  89. }
  90. int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
  91. {
  92. return 0;
  93. }
  94. void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc,
  95. int vq_index)
  96. {
  97. }
  98. int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc,
  99. int vq_index)
  100. {
  101. return 0;
  102. }
  103. void vhost_net_save_acked_features(NetClientState *nc)
  104. {
  105. }