From: Konrad Rzeszutek Wilk Date: Fri, 30 Sep 2016 14:50:32 +0000 (-0400) Subject: tmem/sysctl: Add union in struct xen_sysctl_tmem_op X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~212 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=92928ab27709fe6eab50648aa7a9aaad7ede8da4;p=xen.git tmem/sysctl: Add union in struct xen_sysctl_tmem_op 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 Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/tools/libxc/xc_tmem.c b/tools/libxc/xc_tmem.c index 24c8b43c03..e1de16e563 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 95b97b8016..abc2f67e37 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 ba003a86d8..fc20a9f7be 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 728b80ca32..af128a8134 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);