diff mbox

[v2,5/9] tmem/sysctl: Add union in struct xen_sysctl_tmem_op

Message ID 1475259114-8693-6-git-send-email-konrad.wilk@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Konrad Rzeszutek Wilk Sept. 30, 2016, 6:11 p.m. UTC
No functional change. We do this to prepare for another
entry to be added in the union. See patch titled:
"tmem/libxc: Squash XEN_SYSCTL_TMEM_OP_[SET|SAVE]"

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
v2: New submission.
---
 tools/libxc/xc_tmem.c       | 4 ++--
 xen/common/tmem.c           | 8 ++++----
 xen/common/tmem_control.c   | 4 ++--
 xen/include/public/sysctl.h | 4 +++-
 4 files changed, 11 insertions(+), 9 deletions(-)

Comments

Andrew Cooper Sept. 30, 2016, 6:28 p.m. UTC | #1
On 30/09/16 19:11, Konrad Rzeszutek Wilk wrote:
> No functional change. We do this to prepare for another
> entry to be added in the union. See patch titled:
> "tmem/libxc: Squash XEN_SYSCTL_TMEM_OP_[SET|SAVE]"
>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox

Patch

diff --git a/tools/libxc/xc_tmem.c b/tools/libxc/xc_tmem.c
index 24c8b43..e1de16e 100644
--- a/tools/libxc/xc_tmem.c
+++ b/tools/libxc/xc_tmem.c
@@ -81,7 +81,7 @@  int xc_tmem_control(xc_interface *xch,
         }
     }
 
-    set_xen_guest_handle(sysctl.u.tmem_op.buf, buf);
+    set_xen_guest_handle(sysctl.u.tmem_op.u.buf, buf);
 
     rc = do_sysctl(xch, &sysctl);
 
@@ -127,7 +127,7 @@  int xc_tmem_control_oid(xc_interface *xch,
         }
     }
 
-    set_xen_guest_handle(sysctl.u.tmem_op.buf, buf);
+    set_xen_guest_handle(sysctl.u.tmem_op.u.buf, buf);
 
     rc = do_sysctl(xch, &sysctl);
 
diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 95b97b8..abc2f67 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -1841,19 +1841,19 @@  int do_tmem_control(struct xen_sysctl_tmem_op *op)
     case XEN_SYSCTL_TMEM_OP_RESTORE_BEGIN:
     case XEN_SYSCTL_TMEM_OP_SAVE_END:
         ret = tmemc_save_subop(op->cli_id, pool_id, cmd,
-                               guest_handle_cast(op->buf, char), op->arg1);
+                               guest_handle_cast(op->u.buf, char), op->arg1);
         break;
     case XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_PAGE:
         ret = tmemc_save_get_next_page(op->cli_id, pool_id,
-                                       guest_handle_cast(op->buf, char), op->arg1);
+                                       guest_handle_cast(op->u.buf, char), op->arg1);
         break;
     case XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_INV:
         ret = tmemc_save_get_next_inv(op->cli_id,
-                                      guest_handle_cast(op->buf, char), op->arg1);
+                                      guest_handle_cast(op->u.buf, char), op->arg1);
         break;
     case XEN_SYSCTL_TMEM_OP_RESTORE_PUT_PAGE:
         ret = tmemc_restore_put_page(op->cli_id, pool_id, oidp, op->arg2,
-                                     guest_handle_cast(op->buf, char), op->arg1);
+                                     guest_handle_cast(op->u.buf, char), op->arg1);
         break;
     case XEN_SYSCTL_TMEM_OP_RESTORE_FLUSH_PAGE:
         ret = tmemc_restore_flush_page(op->cli_id, pool_id, oidp, op->arg2);
diff --git a/xen/common/tmem_control.c b/xen/common/tmem_control.c
index ba003a8..fc20a9f 100644
--- a/xen/common/tmem_control.c
+++ b/xen/common/tmem_control.c
@@ -384,7 +384,7 @@  int tmem_control(struct xen_sysctl_tmem_op *op)
         break;
     case XEN_SYSCTL_TMEM_OP_LIST:
         ret = tmemc_list(op->cli_id,
-                         guest_handle_cast(op->buf, char), op->arg1, op->arg2);
+                         guest_handle_cast(op->u.buf, char), op->arg1, op->arg2);
         break;
     case XEN_SYSCTL_TMEM_OP_SET_WEIGHT:
     case XEN_SYSCTL_TMEM_OP_SET_COMPRESS:
@@ -401,7 +401,7 @@  int tmem_control(struct xen_sysctl_tmem_op *op)
     case XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_NPAGES:
     case XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_UUID:
         ret = tmemc_save_subop(op->cli_id, pool_id, cmd,
-                               guest_handle_cast(op->buf, char), op->arg1);
+                               guest_handle_cast(op->u.buf, char), op->arg1);
         break;
     default:
         ret = do_tmem_control(op);
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 728b80c..af128a8 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -818,7 +818,9 @@  struct xen_sysctl_tmem_op {
     uint32_t arg2;      /* IN: If not applicable to command use 0. */
     uint32_t pad;       /* Padding so structure is the same under 32 and 64. */
     xen_tmem_oid_t oid; /* IN: If not applicable to command use 0s. */
-    XEN_GUEST_HANDLE_64(char) buf; /* IN/OUT: Buffer to save and restore ops. */
+    union {
+        XEN_GUEST_HANDLE_64(char) buf; /* IN/OUT: Buffer to save and restore ops. */
+    } u;
 };
 typedef struct xen_sysctl_tmem_op xen_sysctl_tmem_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tmem_op_t);