virtio-balloon: Avoid using the word 'report' when referring to free page hinting
authorAlexander Duyck <alexander.h.duyck@linux.intel.com>
Wed, 15 Apr 2020 17:44:08 +0000 (10:44 -0700)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 17 Apr 2020 10:05:30 +0000 (06:05 -0400)
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 <alexander.h.duyck@linux.intel.com>
Link: https://lore.kernel.org/r/20200415174318.13597.99753.stgit@localhost.localdomain
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_balloon.c
include/uapi/linux/virtio_balloon.h

index 8c964b3eebdf0e8df2514de4a553c778c1a0227b..51086a5afdd4179d52ba109fc346564bcee29eb8 100644 (file)
@@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
        if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
                               &vb->config_read_bitmap))
                virtio_cread(vb->vdev, struct virtio_balloon_config,
-                            free_page_report_cmd_id,
+                            free_page_hint_cmd_id,
                             &vb->cmd_id_received_cache);
 
        return vb->cmd_id_received_cache;
index 19974392d3240fad6265dd7a7a6e045636268b17..dc3e656470dd589102771c2046c8de42fe5d670d 100644 (file)
@@ -48,8 +48,15 @@ struct virtio_balloon_config {
        __u32 num_pages;
        /* Number of pages we've actually got in balloon. */
        __u32 actual;
-       /* Free page report command id, readonly by guest */
-       __u32 free_page_report_cmd_id;
+       /*
+        * Free page hint command id, readonly by guest.
+        * Was previously named free_page_report_cmd_id so we
+        * need to carry that name for legacy support.
+        */
+       union {
+               __u32 free_page_hint_cmd_id;
+               __u32 free_page_report_cmd_id;  /* deprecated */
+       };
        /* Stores PAGE_POISON if page poisoning is in use */
        __u32 poison_val;
 };