mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
libxl: libxl_uuid_copy now takes a ctx argument
Make it consistent with existing libxl functions like libxl_bitmap_copy etc. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
ab4440112b
commit
6276f66ebe
6 files changed
+24
-11
No files matched your search
+1
-1
@@ -2019,7 +2019,7 @@ int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
|
||||
if(devid == vtpms[i].devid) {
|
||||
vtpm->backend_domid = vtpms[i].backend_domid;
|
||||
vtpm->devid = vtpms[i].devid;
|
||||
libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
|
||||
libxl_uuid_copy(ctx, &vtpm->uuid, &vtpms[i].uuid);
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
+11
-3
@@ -319,13 +319,15 @@
|
||||
|
||||
#include <xentoollog.h>
|
||||
|
||||
typedef struct libxl__ctx libxl_ctx;
|
||||
|
||||
#include <libxl_uuid.h>
|
||||
#include <_libxl_list.h>
|
||||
|
||||
/* API compatibility. */
|
||||
#ifdef LIBXL_API_VERSION
|
||||
#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
|
||||
LIBXL_API_VERSION != 0x040400
|
||||
LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500
|
||||
#error Unknown LIBXL_API_VERSION
|
||||
#endif
|
||||
#endif
|
||||
@@ -498,6 +500,14 @@
|
||||
#define LIBXL_EXTERNAL_CALLERS_ONLY /* disappears for callers outside libxl */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* LIBXL_HAVE_UUID_COPY_CTX_PARAM
|
||||
*
|
||||
* If this is defined, libxl_uuid_copy has changed to take a libxl_ctx
|
||||
* structure.
|
||||
*/
|
||||
#define LIBXL_HAVE_UUID_COPY_CTX_PARAM 1
|
||||
|
||||
/*
|
||||
* LIBXL_HAVE_SSID_LABEL
|
||||
*
|
||||
@@ -594,8 +604,6 @@ bool libxl_defbool_val(libxl_defbool db);
|
||||
|
||||
const char *libxl_defbool_to_string(libxl_defbool b);
|
||||
|
||||
typedef struct libxl__ctx libxl_ctx;
|
||||
|
||||
#define LIBXL_TIMER_MODE_DEFAULT -1
|
||||
#define LIBXL_MEMKB_DEFAULT ~0ULL
|
||||
|
||||
|
||||
@@ -479,7 +479,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
|
||||
*domid = -1;
|
||||
|
||||
/* Ultimately, handle is an array of 16 uint8_t, same as uuid */
|
||||
libxl_uuid_copy((libxl_uuid *)handle, &info->uuid);
|
||||
libxl_uuid_copy(ctx, (libxl_uuid *)handle, &info->uuid);
|
||||
|
||||
ret = xc_domain_create(ctx->xch, info->ssidref, handle, flags, domid);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -536,7 +536,7 @@ int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
|
||||
if(!libxl_uuid_compare(uuid, &vtpms[i].uuid)) {
|
||||
vtpm->backend_domid = vtpms[i].backend_domid;
|
||||
vtpm->devid = vtpms[i].devid;
|
||||
libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
|
||||
libxl_uuid_copy(ctx, &vtpm->uuid, &vtpms[i].uuid);
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
#include "libxl_osdeps.h" /* must come before any other headers */
|
||||
|
||||
#include <libxl_uuid.h>
|
||||
|
||||
#include "libxl_internal.h"
|
||||
|
||||
#if defined(__linux__)
|
||||
@@ -35,7 +33,8 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in)
|
||||
return uuid_parse(in, uuid->uuid);
|
||||
}
|
||||
|
||||
void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src)
|
||||
void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
|
||||
const libxl_uuid *src)
|
||||
{
|
||||
uuid_copy(dst->uuid, src->uuid);
|
||||
}
|
||||
@@ -87,7 +86,8 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in)
|
||||
}
|
||||
#undef LIBXL__UUID_PTRS
|
||||
|
||||
void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src)
|
||||
void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
|
||||
const libxl_uuid *src)
|
||||
{
|
||||
memcpy(dst->uuid, src->uuid, sizeof(dst->uuid));
|
||||
}
|
||||
|
||||
@@ -56,7 +56,12 @@ typedef struct {
|
||||
int libxl_uuid_is_nil(const libxl_uuid *uuid);
|
||||
void libxl_uuid_generate(libxl_uuid *uuid);
|
||||
int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
|
||||
void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src);
|
||||
void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
|
||||
const libxl_uuid *src);
|
||||
#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
|
||||
void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
|
||||
#endif
|
||||
|
||||
void libxl_uuid_clear(libxl_uuid *uuid);
|
||||
int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2);
|
||||
const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid);
|
||||
|
||||