]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Drivers: hv: balloon: Fix info request to show max page count
authorAlex Ng <alexng@messages.microsoft.com>
Sun, 6 Nov 2016 21:14:12 +0000 (13:14 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Nov 2016 09:01:17 +0000 (10:01 +0100)
Balloon driver was only printing the size of the info blob and not the
actual content. This fixes it so that the info blob (max page count as
configured in Hyper-V) is printed out.

Signed-off-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv_balloon.c

index 8cac29a24f21b32c728a5085ce79345cdef8a63a..14c3dc4bd23c0b81c1a6cd2df84179af6963ab49 100644 (file)
@@ -1034,8 +1034,13 @@ static void process_info(struct hv_dynmem_device *dm, struct dm_info_msg *msg)
 
        switch (info_hdr->type) {
        case INFO_TYPE_MAX_PAGE_CNT:
-               pr_info("Received INFO_TYPE_MAX_PAGE_CNT\n");
-               pr_info("Data Size is %d\n", info_hdr->data_size);
+               if (info_hdr->data_size == sizeof(__u64)) {
+                       __u64 *max_page_count = (__u64 *)&info_hdr[1];
+
+                       pr_info("INFO_TYPE_MAX_PAGE_CNT = %llu\n",
+                               *max_page_count);
+               }
+
                break;
        default:
                pr_info("Received Unknown type: %d\n", info_hdr->type);