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

Submitted by Jesse Larrew on Feb. 18, 2013, 10:22 p.m.

Details

Message ID 1361226165-19030-6-git-send-email-jlarrew@linux.vnet.ibm.com
State New
Headers show

Commit Message

Jesse Larrew Feb. 18, 2013, 10:22 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 hide | download patch | download mbox

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)},
     {}
 };