mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
libxl: add pid path to libxl__spawner_starting
libxl_spawner_record_pid() should be able to write the pid to arbitrary paths. v2: - use const char* for ->pid_path, and update comment Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
This commit is contained in:
1 parent
e5d6417e8a
commit
b46dfd222e
3 files changed
+3
-1
No files matched your search
@@ -848,6 +848,7 @@ int libxl__create_device_model(libxl__gc *gc,
|
||||
|
||||
p->domid = info->domid;
|
||||
p->dom_path = libxl__xs_get_dompath(gc, info->domid);
|
||||
p->pid_path = "image/device-model-pid";
|
||||
if (!p->dom_path) {
|
||||
rc = ERROR_FAIL;
|
||||
goto out_close;
|
||||
|
||||
@@ -151,7 +151,7 @@ void libxl_spawner_record_pid(void *for_spawn, pid_t innerchild)
|
||||
char *path = NULL, *pid = NULL;
|
||||
int len;
|
||||
|
||||
if (asprintf(&path, "%s/%s", starting->dom_path, "image/device-model-pid") < 0)
|
||||
if (asprintf(&path, "%s/%s", starting->dom_path, starting->pid_path) < 0)
|
||||
goto out;
|
||||
|
||||
len = asprintf(&pid, "%d", innerchild);
|
||||
|
||||
@@ -268,6 +268,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
char *dom_path; /* from libxl_malloc, only for libxl_spawner_record_pid */
|
||||
const char *pid_path; /* only for libxl_spawner_record_pid */
|
||||
int domid;
|
||||
libxl__spawn_starting *for_spawn;
|
||||
} libxl__spawner_starting;
|
||||
|
||||