Skip to content

Commit 31ba514

Browse files
Alexander Duyckmstsirkin
authored andcommitted
virtio-balloon: Avoid using the word 'report' when referring to free page hinting
It can be confusing to have multiple features within the same driver that are using the same verbage. As such this patch is creating a union of free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up the userspace code a bit in terms of readability while maintaining the functionality of legacy code. Signed-off-by: Alexander Duyck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent dc39cbb commit 31ba514

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

drivers/virtio/virtio_balloon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
580580
if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
581581
&vb->config_read_bitmap))
582582
virtio_cread(vb->vdev, struct virtio_balloon_config,
583-
free_page_report_cmd_id,
583+
free_page_hint_cmd_id,
584584
&vb->cmd_id_received_cache);
585585

586586
return vb->cmd_id_received_cache;

include/uapi/linux/virtio_balloon.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,15 @@ struct virtio_balloon_config {
4848
__u32 num_pages;
4949
/* Number of pages we've actually got in balloon. */
5050
__u32 actual;
51-
/* Free page report command id, readonly by guest */
52-
__u32 free_page_report_cmd_id;
51+
/*
52+
* Free page hint command id, readonly by guest.
53+
* Was previously named free_page_report_cmd_id so we
54+
* need to carry that name for legacy support.
55+
*/
56+
union {
57+
__u32 free_page_hint_cmd_id;
58+
__u32 free_page_report_cmd_id; /* deprecated */
59+
};
5360
/* Stores PAGE_POISON if page poisoning is in use */
5461
__u32 poison_val;
5562
};

0 commit comments

Comments
 (0)