@@ -80,6 +80,11 @@ void vhost_net_ack_features(struct vhost_net *net, unsigned features)
}
}
+unsigned long long vhost_net_features(VHostNetState *net)
+{
+ return net->dev.features;
+}
+
static int vhost_net_get_fd(NetClientState *backend)
{
switch (backend->info->type) {
@@ -113,6 +118,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)
net->dev.nvqs = 2;
net->dev.vqs = net->vqs;
+ net->dev.mandatory_features = options->mandatory_features;
r = vhost_dev_init(&net->dev, options->opaque,
options->force);
@@ -348,6 +354,10 @@ unsigned vhost_net_get_features(struct vhost_net *net, unsigned features)
void vhost_net_ack_features(struct vhost_net *net, unsigned features)
{
}
+unsigned long long vhost_net_features(struct vhost_net *net)
+{
+ return 0;
+}
bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
{
@@ -41,6 +41,7 @@ struct vhost_dev {
unsigned long long features;
unsigned long long acked_features;
unsigned long long backend_features;
+ unsigned long long mandatory_features;
bool started;
bool log_enabled;
vhost_log_chunk_t *log;
@@ -10,6 +10,7 @@ typedef struct VhostNetOptions {
NetClientState *net_backend;
void *opaque;
bool force;
+ unsigned long long mandatory_features;
} VhostNetOptions;
struct vhost_net *vhost_net_init(VhostNetOptions *options);
@@ -22,6 +23,7 @@ void vhost_net_cleanup(VHostNetState *net);
unsigned vhost_net_get_features(VHostNetState *net, unsigned features);
void vhost_net_ack_features(VHostNetState *net, unsigned features);
+unsigned long long vhost_net_features(VHostNetState *net);
bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,