EGC_GC;
libxl_evgen_domain_death *const evg = *evg_upd;
- LOG(DEBUG, "%s", why);
+ LOGD(DEBUG, evg->domid, "%s", why);
libxl_evgen_domain_death *evg_next = LIBXL_TAILQ_NEXT(evg, entry);
*evg_upd = evg_next;
}
gotend = &domaininfos[rc];
- LOG(DEBUG, "[evg=%p:%"PRIu32"] nentries=%d rc=%d %ld..%ld",
- evg, evg->domid, nentries, rc,
- rc>0 ? (long)domaininfos[0].domain : 0,
- rc>0 ? (long)domaininfos[rc-1].domain : 0);
+ LOGD(DEBUG, evg->domid, "[evg=%p] nentries=%d rc=%d %ld..%ld",
+ evg, nentries, rc,
+ rc>0 ? (long)domaininfos[0].domain : 0,
+ rc>0 ? (long)domaininfos[rc-1].domain : 0);
for (;;) {
if (!evg) {
goto all_reported;
}
- LOG(DEBUG, "[evg=%p:%"PRIu32"]"
- " got=domaininfos[%d] got->domain=%ld",
- evg, evg->domid, (int)(got - domaininfos),
- got < gotend ? (long)got->domain : -1L);
+ LOGD(DEBUG, evg->domid, "[evg=%p]"
+ " got=domaininfos[%d] got->domain=%ld",
+ evg, (int)(got - domaininfos),
+ got < gotend ? (long)got->domain : -1L);
if (!rc) {
domain_death_occurred(egc, &evg, "empty list");
}
assert(evg->domid == got->domain);
- LOG(DEBUG, " exists shutdown_reported=%d"" dominf.flags=%x",
- evg->shutdown_reported, got->flags);
+ LOGD(DEBUG, evg->domid, "Exists shutdown_reported=%d"" dominf.flags=%x",
+ evg->shutdown_reported, got->flags);
if (got->flags & XEN_DOMINF_dying) {
domain_death_occurred(egc, &evg, "dying");
STATE_AO_GC(dds->ao);
if (rc)
- LOG(ERROR, "destruction of domain %u failed", dds->domid);
+ LOGD(ERROR, dds->domid, "Destruction of domain failed");
libxl__ao_complete(egc, ao, rc);
}
const char *savefile;
if (rc) {
- LOG(ERROR, "unable to destroy stubdom with domid %u", dis->domid);
+ LOGD(ERROR, dds->domain.domid, "Unable to destroy stubdom with domid %u",
+ dis->domid);
dds->rc = rc;
}
savefile = libxl__device_model_savefile(gc, dis->domid);
rc = libxl__remove_file(gc, savefile);
if (rc) {
- LOG(ERROR, "failed to remove device-model savefile %s", savefile);
+ LOGD(ERROR, dds->domain.domid, "Failed to remove device-model savefile %s",
+ savefile);
}
destroy_finish_check(egc, dds);
libxl__domain_destroy_state *dds = CONTAINER_OF(dis, *dds, domain);
if (rc) {
- LOG(ERROR, "unable to destroy guest with domid %u", dis->domid);
+ LOGD(ERROR, dis->domid, "Unable to destroy guest");
dds->rc = rc;
}
if (status) {
if (WIFEXITED(status) && WEXITSTATUS(status)<126) {
- LOGEV(ERROR, WEXITSTATUS(status),
- "xc_domain_destroy failed for %"PRIu32"", dis->domid);
+ LOGEVD(ERROR, WEXITSTATUS(status), dis->domid,
+ "xc_domain_destroy failed");
} else {
libxl_report_child_exitstatus(CTX, XTL_ERROR,
"async domain destroy", pid, status);
if (aodev->rc) {
if (aodev->dev) {
- LOG(ERROR, "unable to %s %s with id %u",
+ LOGD(ERROR, aodev->dev->domid, "Unable to %s %s with id %u",
libxl__device_action_to_string(aodev->action),
libxl__device_kind_to_string(aodev->dev->kind),
aodev->dev->devid);
char *be_path, *pdpath;
int rc;
- LOG(DEBUG,
- "Run from a script; checking for physical-device-path (vdev %s)",
- disk->vdev);
+ LOGD(DEBUG, guest_domid,
+ "Run from a script; checking for physical-device-path (vdev %s)",
+ disk->vdev);
rc = libxl__device_from_disk(gc, guest_domid, disk, &device);
if (rc < 0)
pdpath = libxl__sprintf(gc, "%s/physical-device-path", be_path);
- LOG(DEBUG, "Attempting to read node %s", pdpath);
+ LOGD(DEBUG, guest_domid, "Attempting to read node %s", pdpath);
path = libxl__xs_read(gc, XBT_NULL, pdpath);
if (path)
- LOG(DEBUG, "Accessing cooked block device %s", path);
+ LOGD(DEBUG, guest_domid, "Accessing cooked block device %s", path);
else
- LOG(DEBUG, "No physical-device-path, can't access locally.");
+ LOGD(DEBUG, guest_domid, "No physical-device-path, can't access locally.");
goto out;
}
int rc;
if (aodev->rc) {
- LOGE(ERROR, "unable to %s %s with id %u",
- libxl__device_action_to_string(aodev->action),
- libxl__device_kind_to_string(aodev->dev->kind),
- aodev->dev->devid);
+ LOGED(ERROR, aodev->dev->domid, "Unable to %s %s with id %u",
+ libxl__device_action_to_string(aodev->action),
+ libxl__device_kind_to_string(aodev->dev->kind),
+ aodev->dev->devid);
goto out;
}
{
STATE_AO_GC(dmss->spawn.ao);
- LOG(DEBUG, "qdisk backend spawn for domain %u %s", dmss->guest_domid,
- rc ? "failed" : "succeed");
+ LOGD(DEBUG, dmss->guest_domid, "qdisk backend spawn %s",
+ rc ? "failed" : "succeed");
libxl__nested_ao_free(dmss->spawn.ao);
}
dguest->domid = dev->domid;
LIBXL_SLIST_INIT(&dguest->devices);
LIBXL_SLIST_INSERT_HEAD(&ddomain->guests, dguest, next);
- LOG(DEBUG, "added domain %u to the list of active guests",
- dguest->domid);
+ LOGD(DEBUG, dguest->domid, "Added domain to the list of active guests");
}
ddev = search_for_device(dguest, dev);
if (ddev == NULL && state == XenbusStateClosed) {
ddev = libxl__zalloc(NOGC, sizeof(*ddev));
ddev->dev = dev;
LIBXL_SLIST_INSERT_HEAD(&dguest->devices, ddev, next);
- LOG(DEBUG, "added device %s to the list of active devices", path);
+ LOGD(DEBUG, dev->domid, "Added device %s to the list of active devices",
+ path);
rc = add_device(egc, nested_ao, dguest, ddev);
if (rc > 0)
free_ao = true;
*/
LIBXL_SLIST_REMOVE(&dguest->devices, ddev, libxl__ddomain_device,
next);
- LOG(DEBUG, "removed device %s from the list of active devices", path);
+ LOGD(DEBUG, dev->domid, "Removed device %s from the list of active devices",
+ path);
rc = remove_device(egc, nested_ao, dguest, ddev);
if (rc > 0)
free_ao = true;
if (num_devs == 0) {
LIBXL_SLIST_REMOVE(&ddomain->guests, dguest, libxl__ddomain_guest,
next);
- LOG(DEBUG, "removed domain %u from the list of active guests",
- dguest->domid);
+ LOGD(DEBUG, dguest->domid, "Removed domain from the list of active guests");
/* Clear any leftovers in libxl/<domid> */
libxl__xs_rm_checked(gc, XBT_NULL,
GCSPRINTF("libxl/%u", dguest->domid));
if (target) {
*target_memkb = strtoull(target, &endptr, 10);
if (*endptr != '\0') {
- LOGE(ERROR, "invalid memory target %s from %s\n", target,
+ LOGED(ERROR, 0, "Invalid memory target %s from %s\n", target,
target_path);
rc = ERROR_FAIL;
goto out;
if (staticmax) {
*max_memkb = strtoull(staticmax, &endptr, 10);
if (*endptr != '\0') {
- LOGE(ERROR, "invalid memory static-max %s from %s\n", staticmax,
+ LOGED(ERROR, 0, "Invalid memory static-max %s from %s\n",
+ staticmax,
max_path);
rc = ERROR_FAIL;
goto out;