[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 10/17] Add mandatory_features to vhost_dev
From: |
Antonios Motakis |
Subject: |
[Qemu-devel] [PATCH v8 10/17] Add mandatory_features to vhost_dev |
Date: |
Thu, 13 Feb 2014 13:03:21 +0100 |
This will be used in a following patch to ensure that a vhost-user
client reconnecting to QEMU supports the features that were exposed
by the first client that initiated the virtio-net session.
Signed-off-by: Antonios Motakis <address@hidden>
Signed-off-by: Nikolay Nikolaev <address@hidden>
---
hw/net/vhost_net.c | 10 ++++++++++
include/hw/virtio/vhost.h | 1 +
include/net/vhost_net.h | 2 ++
3 files changed, 13 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 13b4734..4490173 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -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)
{
diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h
index 97641b6..0068d40 100644
--- a/include/hw/virtio/vhost.h
+++ b/include/hw/virtio/vhost.h
@@ -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;
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index 2067ee2..b39bb45 100644
--- a/include/net/vhost_net.h
+++ b/include/net/vhost_net.h
@@ -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,
--
1.8.3.2
- Re: [Qemu-devel] [PATCH v8 01/17] Convert -mem-path to QemuOpts and add prealloc and share properties, (continued)
[Qemu-devel] [PATCH v8 03/17] Add chardev API qemu_chr_fe_set_msgfds, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 04/17] Add chardev API qemu_chr_fe_get_msgfds, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 05/17] Add G_IO_HUP handler for socket chardev, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 06/17] vhost_net should call the poll callback only when it is set, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 07/17] Refactor virtio-net to use generic get_vhost_net, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 08/17] vhost_net_init will use VhostNetOptions to get all its arguments, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 09/17] Add vhost_ops to vhost_dev struct and replace all relevant ioctls, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 10/17] Add mandatory_features to vhost_dev,
Antonios Motakis <=
[Qemu-devel] [PATCH v8 11/17] Add vhost-backend and VhostBackendType, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 12/17] Add vhost-user as a vhost backend, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 13/17] Add new vhost-user netdev backend, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 14/17] Add the vhost-user netdev backend to the command line, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 15/17] Add vhost-user protocol documentation, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 16/17] libqemustub: add stubs to be able to use qemu-char.c, Antonios Motakis, 2014/02/13
[Qemu-devel] [PATCH v8 17/17] Add qtest for vhost-user, Antonios Motakis, 2014/02/13
Re: [Qemu-devel] [PATCH v8 00/17] Vhost and vhost-net support for userspace based backends, Michael S. Tsirkin, 2014/02/26