fate#314663 hyper-v memory ballooning support
[opensuse:kernel-source.git] / patches.suse / suse-hv-fate314663-0003-Drivers-hv-balloon-Fix-a-bug-in-the-definition-of-st.patch
1 Patch-mainline: submitted
2 From: <ohering@suse.de>
3 Date: Thu, 6 Dec 2012 11:06:54 -0800
4 Subject: [PATCH 3/3] Drivers: hv: balloon: Fix a bug in the definition of
5  struct dm_info_msg
6
7 There is bug in the definition of struct dm_info_msg. This patch fixes
8 the definition of this structure and makes the corresponding adjustments.
9
10 Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
11 Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
12 ---
13  drivers/hv/hv_balloon.c | 12 ++++++++----
14  1 file changed, 8 insertions(+), 4 deletions(-)
15
16 diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
17 index bbc4973..07a5afb 100644
18 --- a/drivers/hv/hv_balloon.c
19 +++ b/drivers/hv/hv_balloon.c
20 @@ -403,7 +403,7 @@ struct dm_info_header {
21   */
22  
23  struct dm_info_msg {
24 -       struct dm_info_header header;
25 +       struct dm_header hdr;
26         __u32 reserved;
27         __u32 info_size;
28         __u8  info[];
29 @@ -503,13 +503,17 @@ static void hot_add_req(struct hv_dynmem_device *dm, struct dm_hot_add *msg)
30  
31  static void process_info(struct hv_dynmem_device *dm, struct dm_info_msg *msg)
32  {
33 -       switch (msg->header.type) {
34 +       struct dm_info_header *info_hdr;
35 +
36 +       info_hdr = (struct dm_info_header *)msg->info;
37 +
38 +       switch (info_hdr->type) {
39         case INFO_TYPE_MAX_PAGE_CNT:
40                 pr_info("Received INFO_TYPE_MAX_PAGE_CNT\n");
41 -               pr_info("Data Size is %d\n", msg->header.data_size);
42 +               pr_info("Data Size is %d\n", info_hdr->data_size);
43                 break;
44         default:
45 -               pr_info("Received Unknown type: %d\n", msg->header.type);
46 +               pr_info("Received Unknown type: %d\n", info_hdr->type);
47         }
48  }
49  
50 -- 
51 1.8.0.1
52