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.
Unified · Split
| @@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb) · 579 unmodified lines | |||
| 580 | if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID, | 580 | if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID, |
| 581 | &vb->config_read_bitmap)) | 581 | &vb->config_read_bitmap)) |
| 582 | virtio_cread(vb->vdev, struct virtio_balloon_config, | 582 | virtio_cread(vb->vdev, struct virtio_balloon_config, |
| 583 | free_page_report_cmd_id, | 583 | free_page_hint_cmd_id, |
| 584 | &vb->cmd_id_received_cache); | 584 | &vb->cmd_id_received_cache); |
| 585 | 585 | ||
| 586 | return vb->cmd_id_received_cache; | 586 | return vb->cmd_id_received_cache; |
| @@ -48,8 +48,15 @@ struct virtio_balloon_config { · 47 unmodified lines | |||
| 48 | __u32 num_pages; | 48 | __u32 num_pages; |
| 49 | /* Number of pages we've actually got in balloon. */ | 49 | /* Number of pages we've actually got in balloon. */ |
| 50 | __u32 actual; | 50 | __u32 actual; |
| 51 | /* Free page report command id, readonly by guest */ | 51 | /* |
| 52 | __u32 free_page_report_cmd_id; | 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 | }; | ||
| 53 | /* Stores PAGE_POISON if page poisoning is in use */ | 60 | /* Stores PAGE_POISON if page poisoning is in use */ |
| 54 | __u32 poison_val; | 61 | __u32 poison_val; |
| 55 | }; | 62 | }; |