Skip to contentSkip to conversation

virtio_balloon: update_balloon_size(): update correct field

PATCH Applied Luiz Capitulino 2 participants 2 messages Dec 4, 2013 – Dec 5, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio_balloon: update_balloon_size(): update correct field

According to the virtio spec, the device configuration field that should be updated after an inflation or deflation operation is the 'actual' field, not the 'num_pages' one.

Commit 855e0c5288177bcb193f6f6316952d2490478e1c swapped them in update_balloon_size(). Fix it.

---
 drivers/virtio/virtio_balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_balloon.c +1 -1
index c444654..5c4a95b 100644
@@ -285,7 +285,7 @@ static void update_balloon_size(struct virtio_balloon *vb)
 {
 	__le32 actual = cpu_to_le32(vb->num_pages);
 
-	virtio_cwrite(vb->vdev, struct virtio_balloon_config, num_pages,
+	virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
 		      &actual);
 }
 
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 8 lines · Luiz Capitulino

According to the virtio spec, the device configuration field that should be updated after an inflation or deflation operation is the 'actual' field, not the 'num_pages' one.

Commit 855e0c5288177bcb193f6f6316952d2490478e1c swapped them in update_balloon_size(). Fix it.

Damn, exactly right. Good catch.

Applied,
Rusty.

Quoted 18 lines
 drivers/virtio/virtio_balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_balloon.c +1 -1
index c444654..5c4a95b 100644
@@ -285,7 +285,7 @@ static void update_balloon_size(struct virtio_balloon *vb)
 {
 	__le32 actual = cpu_to_le32(vb->num_pages);
 
-	virtio_cwrite(vb->vdev, struct virtio_balloon_config, num_pages,
+	virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
 		      &actual);
 }
 
Signature · 1 line
1.8.1.4