diff options
Diffstat (limited to 'drivers/lguest')
-rw-r--r-- | drivers/lguest/lguest_device.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c index 37344aaee22f..a661bbdae3d6 100644 --- a/drivers/lguest/lguest_device.c +++ b/drivers/lguest/lguest_device.c | |||
@@ -98,6 +98,10 @@ static u32 lg_get_features(struct virtio_device *vdev) | |||
98 | return features; | 98 | return features; |
99 | } | 99 | } |
100 | 100 | ||
101 | /* The virtio core takes the features the Host offers, and copies the | ||
102 | * ones supported by the driver into the vdev->features array. Once | ||
103 | * that's all sorted out, this routine is called so we can tell the | ||
104 | * Host which features we understand and accept. */ | ||
101 | static void lg_finalize_features(struct virtio_device *vdev) | 105 | static void lg_finalize_features(struct virtio_device *vdev) |
102 | { | 106 | { |
103 | unsigned int i, bits; | 107 | unsigned int i, bits; |
@@ -108,6 +112,10 @@ static void lg_finalize_features(struct virtio_device *vdev) | |||
108 | /* Give virtio_ring a chance to accept features. */ | 112 | /* Give virtio_ring a chance to accept features. */ |
109 | vring_transport_features(vdev); | 113 | vring_transport_features(vdev); |
110 | 114 | ||
115 | /* The vdev->feature array is a Linux bitmask: this isn't the | ||
116 | * same as a the simple array of bits used by lguest devices | ||
117 | * for features. So we do this slow, manual conversion which is | ||
118 | * completely general. */ | ||
111 | memset(out_features, 0, desc->feature_len); | 119 | memset(out_features, 0, desc->feature_len); |
112 | bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8; | 120 | bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8; |
113 | for (i = 0; i < bits; i++) { | 121 | for (i = 0; i < bits; i++) { |