[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] libxl: Mark libxl_retrieve_domain_configuration as for external callers only
commit 2e8bfb005277fd1651ee3ab11f04717abee3d370 Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> AuthorDate: Tue Oct 4 10:19:36 2016 +0100 Commit: Wei Liu <wei.liu2@xxxxxxxxxx> CommitDate: Tue Oct 4 10:55:21 2016 +0100 libxl: Mark libxl_retrieve_domain_configuration as for external callers only This function takes the userdata lock. Incautious use inside libxl can result in nested acquisition of that lock, and deadlock. There is no good reason to use this function inside libxl, but it is a superficially attractive option. Make future regressions easier to spot by marking the function for external use only. Similar arguments apply for the application-facing userdata accessors, so do those too. Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/libxl.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 969a089..acbf476 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -1352,7 +1352,8 @@ void libxl_domain_config_dispose(libxl_domain_config *d_config); * works with DomU. */ int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid, - libxl_domain_config *d_config); + libxl_domain_config *d_config) + LIBXL_EXTERNAL_CALLERS_ONLY; int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags, /* LIBXL_SUSPEND_* */ @@ -1945,12 +1946,14 @@ void libxl_cpuid_set(libxl_ctx *ctx, uint32_t domid, */ int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid, const char *userdata_userid, - const uint8_t *data, int datalen); + const uint8_t *data, int datalen) + LIBXL_EXTERNAL_CALLERS_ONLY; /* If datalen==0, data is not used and the user data for * that domain and userdata_userid is deleted. */ int libxl_userdata_retrieve(libxl_ctx *ctx, uint32_t domid, const char *userdata_userid, - uint8_t **data_r, int *datalen_r); + uint8_t **data_r, int *datalen_r) + LIBXL_EXTERNAL_CALLERS_ONLY; /* On successful return, *data_r is from malloc. * If there is no data for that domain and userdata_userid, * *data_r and *datalen_r will be set to 0. -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |