@@ -143,11 +143,6 @@ The guests name.
The domain's own ID.
-#### ~/image/device-model-pid = INTEGER [INTERNAL]
-
-The process ID of the device model associated with this domain, if it
-has one.
-
#### ~/cpu/[0-9]+/availability = ("online"|"offline") [PV]
One node for each virtual CPU up to the guest's configured
@@ -463,9 +458,10 @@ in the value supplied by the guest in this case).
Contains the status of the device models running on the domain.
-#### ~/libxl/$DOMID/qdisk-backend-pid [w]
+#### ~/libxl/$DOMID/dm-pid-$EMUID [w] = INTEGER [INTERNAL]
-Contains the PIDs of the device models running on the domain.
+Contains the PIDs of the device models running on this domain, to
+service $DOMID.
## Virtual Machine Paths
@@ -1867,7 +1867,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss,
}
const char *dom_path = libxl__xs_get_dompath(gc, domid);
- spawn->pidpath = GCSPRINTF("%s/%s", dom_path, "image/device-model-pid");
+ spawn->pidpath = libxl__dm_xs_pid_path(gc, domid, emuid);
if (vnc && vnc->passwd) {
/* This xenstore key will only be used by qemu-xen-traditionnal.
@@ -1901,7 +1901,7 @@ retry_transaction:
spawn->xspath = libxl__device_model_xs_path(gc, LIBXL_TOOLSTACK_DOMID,
domid, emuid, "/state");
spawn->timeout_ms = LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000;
- spawn->pidpath = GCSPRINTF("%s/image/device-model-pid", dom_path);
+ spawn->pidpath = libxl__dm_xs_pid_path(gc, domid, emuid);
spawn->midproc_cb = libxl__spawn_record_pid;
spawn->confirm_cb = device_model_confirm;
spawn->failure_cb = device_model_startup_failed;
@@ -2036,7 +2036,7 @@ void libxl__spawn_qdisk_backend(libxl__egc *egc, libxl__dm_spawn_state *dmss)
* because we will call this from unprivileged driver domains,
* so save it in the current domain libxl private dir.
*/
- dmss->spawn.pidpath = GCSPRINTF("libxl/%u/qdisk-backend-pid", domid);
+ dmss->spawn.pidpath = libxl__dm_xs_pid_path(gc, domid, EMUID_PV);
dmss->spawn.midproc_cb = libxl__spawn_record_pid;
dmss->spawn.confirm_cb = device_model_confirm;
dmss->spawn.failure_cb = device_model_startup_failed;
@@ -2101,7 +2101,7 @@ int libxl__destroy_qdisk_backend(libxl__gc *gc, uint32_t domid)
char *pid_path;
int rc;
- pid_path = GCSPRINTF("libxl/%u/qdisk-backend-pid", domid);
+ pid_path = libxl__dm_xs_pid_path(gc, domid, EMUID_PV);
rc = kill_device_model(gc, pid_path);
if (rc)
@@ -2129,8 +2129,7 @@ int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid,
LOG(ERROR, "xs_rm failed for %s", path);
/* We should try to destroy the device model anyway. */
- rc = kill_device_model(gc,
- GCSPRINTF("/local/domain/%d/image/device-model-pid", domid));
+ rc = kill_device_model(gc, libxl__dm_xs_pid_path(gc, domid, emuid));
if (rc)
LOG(ERROR, "libxl__destroy_device_model failed for %d (emuid=%d)",
domid, emuid);
@@ -576,6 +576,12 @@ char *libxl__device_model_xs_path(libxl__gc *gc, uint32_t dm_domid,
return s;
}
+char *libxl__dm_xs_pid_path(libxl__gc *gc, int guest_domid, int emuid)
+{
+ return GCSPRINTF("libxl/%d/dm-pid-%d", guest_domid, emuid);
+}
+
+
/*
* Local variables:
* mode: C
@@ -1986,6 +1986,9 @@ _hidden char *libxl__dm_xs_path_rel(libxl__gc *gc,
uint32_t domid, int emuid);
/* returns relative path (ie assuming we are the toolstack) */
+_hidden char *libxl__dm_xs_pid_path(libxl__gc *gc,
+ int guest_domid, int emuid);
+
/*
* Calling context and GC for event-generating functions:
*