Patchwork [5/8] virtio-balloon: fill in the table of feature_sizes

login
register
mail settings
Submitter Jesse Larrew
Date Feb. 19, 2013, 11:04 p.m.
Message ID <1361315093-19383-6-git-send-email-jlarrew@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/221922/
State New
Headers show

Comments

Jesse Larrew - Feb. 19, 2013, 11:04 p.m.
There are two feature bits for virtio-balloon:

   VIRTIO_BALLOON_F_MUST_TELL_HOST, and
   VIRTIO_BALLOON_F_STATS_VQ.

Since these features don't require additional fields in the config struct,
set the 'end' field to the end of the last field in the struct.

Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
---
 hw/virtio-balloon.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
index 81f27e9..c64e1b7 100644
--- a/hw/virtio-balloon.c
+++ b/hw/virtio-balloon.c
@@ -30,8 +30,10 @@ 
 #endif
 
 static VirtIOFeature feature_sizes[] = {
-    {.flags = 0xffffffff, /* dummy table -- all features included. */
-     .end = sizeof(struct virtio_balloon_config)},
+    {.flags = 1 << VIRTIO_BALLOON_F_MUST_TELL_HOST,
+     .end = endof(struct virtio_balloon_config, actual)},
+    {.flags = 1 << VIRTIO_BALLOON_F_STATS_VQ,
+     .end = endof(struct virtio_balloon_config, actual)},
     {}
 };