History

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.

Alexander Duyck committed 6 years ago

Commit 31ba5141 parent dc39cbb2 files · +10 −3Browse files

Unified · Split

2 files
  1. drivers/virtio/virtio_balloon.c +1 −1
  2. include/uapi/linux/virtio_balloon.h +9 −2
drivers/virtio/virtio_balloon.c+1−1
@@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb) · 579 unmodified lines
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+9−2
@@ -48,8 +48,15 @@ struct virtio_balloon_config { · 47 unmodified lines
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 };