}
if (libxl_device_model_version_from_string(dm_version, &value) < 0) {
- LOG(ERROR, "fatal: %s contain a wrong value (%s)", path, dm_version);
+ LOGD(ERROR, domid, "fatal: %s contain a wrong value (%s)", path, dm_version);
return -1;
}
return value;
libxl__carefd_begin();
fd = open(lockfile, O_RDWR|O_CREAT, 0666);
if (fd < 0)
- LOGE(ERROR, "cannot open lockfile %s, errno=%d", lockfile, errno);
+ LOGED(ERROR, domid,
+ "cannot open lockfile %s, errno=%d", lockfile, errno);
lock->carefd = libxl__carefd_opened(CTX, fd);
if (fd < 0) goto out;
continue;
default:
/* All other errno: EBADF, EINVAL, ENOLCK, EWOULDBLOCK */
- LOGE(ERROR,
- "unexpected error while trying to lock %s, fd=%d, errno=%d",
- lockfile, fd, errno);
+ LOGED(ERROR, domid,
+ "unexpected error while trying to lock %s, fd=%d, errno=%d",
+ lockfile, fd, errno);
goto out;
}
}
if (fstat(fd, &fstab)) {
- LOGE(ERROR, "cannot fstat %s, fd=%d, errno=%d",
- lockfile, fd, errno);
+ LOGED(ERROR, domid, "cannot fstat %s, fd=%d, errno=%d",
+ lockfile, fd, errno);
goto out;
}
if (stat(lockfile, &stab)) {
if (errno != ENOENT) {
- LOGE(ERROR, "cannot stat %s, errno=%d", lockfile, errno);
+ LOGED(ERROR, domid, "cannot stat %s, errno=%d", lockfile, errno);
goto out;
}
} else {
rc = libxl__userdata_retrieve(gc, domid, "libxl-json", &data, &len);
if (rc) {
- LOGEV(ERROR, rc,
- "failed to retrieve domain configuration for domain %d", domid);
+ LOGEVD(ERROR, rc, domid,
+ "failed to retrieve domain configuration");
rc = ERROR_FAIL;
goto out;
}
d_config_json = libxl_domain_config_to_json(CTX, d_config);
if (!d_config_json) {
- LOGE(ERROR,
- "failed to convert domain configuration to JSON for domain %d",
- domid);
+ LOGED(ERROR, domid,
+ "failed to convert domain configuration to JSON");
rc = ERROR_FAIL;
goto out;
}
(const uint8_t *)d_config_json,
strlen(d_config_json) + 1 /* include '\0' */);
if (rc) {
- LOGEV(ERROR, rc, "failed to store domain configuration for domain %d",
- domid);
+ LOGEVD(ERROR, rc, domid, "failed to store domain configuration");
rc = ERROR_FAIL;
goto out;
}