]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tmem/sysctl: Add union in struct xen_sysctl_tmem_op
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 30 Sep 2016 14:50:32 +0000 (10:50 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 30 Sep 2016 19:26:41 +0000 (15:26 -0400)
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]"

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
tools/libxc/xc_tmem.c
xen/common/tmem.c
xen/common/tmem_control.c
xen/include/public/sysctl.h

index 24c8b43c034c837d171a54aca3c0f7a580fdb68b..e1de16e563f37f5cdc799f440c82f542668e2e41 100644 (file)
@@ -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);
 
index 95b97b8016cfa58becd864c2fcb2f33b11c85418..abc2f67e37584088fa9c8d4e87640de9d686a832 100644 (file)
@@ -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);
index ba003a86d8b6e8009baf5fbcdf949820a86ba9ee..fc20a9f7be71696cf454423acc311dd386444f4c 100644 (file)
@@ -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);
index 728b80ca32baffe089fc674b8be1c771e149a731..af128a8134c990a55a8bb3f23ab7f270108d71a3 100644 (file)
@@ -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);