@@ -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);
@@ -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);
@@ -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);
@@ -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);
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(-)