mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
libxl: make userdata_path libxl internal function
Later patch will make use of it to generate file path and name. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
8d09ef6906
commit
34714e3222
2 files changed
+10
-7
No files matched your search
@@ -1807,9 +1807,9 @@ char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid)
|
||||
return GCSPRINTF(LIBXL_UUID_FMT, LIBXL_UUID_BYTES(uuid));
|
||||
}
|
||||
|
||||
static const char *userdata_path(libxl__gc *gc, uint32_t domid,
|
||||
const char *userdata_userid,
|
||||
const char *wh)
|
||||
const char *libxl__userdata_path(libxl__gc *gc, uint32_t domid,
|
||||
const char *userdata_userid,
|
||||
const char *wh)
|
||||
{
|
||||
libxl_ctx *ctx = libxl__gc_owner(gc);
|
||||
char *uuid_string;
|
||||
@@ -1844,7 +1844,7 @@ void libxl__userdata_destroyall(libxl__gc *gc, uint32_t domid)
|
||||
glob_t gl;
|
||||
int r, i;
|
||||
|
||||
pattern = userdata_path(gc, domid, "*", "?");
|
||||
pattern = libxl__userdata_path(gc, domid, "*", "?");
|
||||
if (!pattern)
|
||||
goto out;
|
||||
|
||||
@@ -1875,7 +1875,7 @@ int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
|
||||
int e, rc;
|
||||
int fd = -1;
|
||||
|
||||
filename = userdata_path(gc, domid, userdata_userid, "d");
|
||||
filename = libxl__userdata_path(gc, domid, userdata_userid, "d");
|
||||
if (!filename) {
|
||||
rc = ERROR_NOMEM;
|
||||
goto out;
|
||||
@@ -1886,7 +1886,7 @@ int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
|
||||
goto out;
|
||||
}
|
||||
|
||||
newfilename = userdata_path(gc, domid, userdata_userid, "n");
|
||||
newfilename = libxl__userdata_path(gc, domid, userdata_userid, "n");
|
||||
if (!newfilename) {
|
||||
rc = ERROR_NOMEM;
|
||||
goto out;
|
||||
@@ -1937,7 +1937,7 @@ int libxl_userdata_retrieve(libxl_ctx *ctx, uint32_t domid,
|
||||
int datalen = 0;
|
||||
void *data = 0;
|
||||
|
||||
filename = userdata_path(gc, domid, userdata_userid, "d");
|
||||
filename = libxl__userdata_path(gc, domid, userdata_userid, "d");
|
||||
if (!filename) {
|
||||
rc = ERROR_NOMEM;
|
||||
goto out;
|
||||
|
||||
@@ -992,6 +992,9 @@ _hidden int libxl__toolstack_restore(uint32_t domid, const uint8_t *buf,
|
||||
uint32_t size, void *data);
|
||||
_hidden int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid);
|
||||
|
||||
_hidden const char *libxl__userdata_path(libxl__gc *gc, uint32_t domid,
|
||||
const char *userdata_userid,
|
||||
const char *wh);
|
||||
_hidden void libxl__userdata_destroyall(libxl__gc *gc, uint32_t domid);
|
||||
|
||||
_hidden int libxl__domain_resume(libxl__gc *gc, uint32_t domid,
|
||||
|
||||