if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_LOCALITY, &loc,
sizeof(loc), sizeof(loc.u.resp.tpm_result),
sizeof(loc)) < 0) {
- error_setg_errno(errp, errno, "tpm-emulator: could not set locality");
+ error_setg(errp, "tpm-emulator: could not set locality");
return -1;
}
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_CAPABILITY, &cap_n, 0,
sizeof(cap_n.u.resp.tpm_result),
sizeof(cap_n)) < 0) {
- error_report("tpm-emulator: probing failed : %s", strerror(errno));
+ error_report("tpm-emulator: probing failed");
return -1;
}
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_STOP, &res, 0,
sizeof(ptm_res), sizeof(res)) < 0) {
- error_setg_errno(errp, errno, "tpm-emulator: Could not stop TPM");
+ error_setg(errp, "tpm-emulator: Could not stop TPM");
return -1;
}
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_LOCK_STORAGE, &pls, sizeof(pls.u.req),
sizeof(pls.u.resp.tpm_result),
sizeof(pls.u.resp)) < 0) {
- error_report("tpm-emulator: Could not lock storage within 3 seconds: "
- "%s", strerror(errno));
+ error_report("tpm-emulator: Could not lock storage within 3 seconds");
return -1;
}
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_BUFFERSIZE, &psbs,
sizeof(psbs.u.req), sizeof(psbs.u.resp.tpm_result),
sizeof(psbs.u.resp)) < 0) {
- error_setg_errno(errp, errno,
- "tpm-emulator: Could not set buffer size");
+ error_setg(errp, "tpm-emulator: Could not set buffer size");
return -1;
}
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_INIT, &init, sizeof(init),
sizeof(init.u.resp.tpm_result),
sizeof(init)) < 0) {
- error_setg_errno(errp, errno, "tpm-emulator: could not send INIT");
+ error_setg(errp, "tpm-emulator: could not send INIT");
goto err_exit;
}
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_TPMESTABLISHED, &est, 0,
sizeof(est) /* always returns resp.bit */,
sizeof(est)) < 0) {
- error_report("tpm-emulator: Could not get the TPM established flag: %s",
- strerror(errno));
+ error_report("tpm-emulator: Could not get the TPM established flag");
return false;
}
trace_tpm_emulator_get_tpm_established_flag(est.u.resp.bit);
&reset_est, sizeof(reset_est),
sizeof(reset_est.u.resp.tpm_result),
sizeof(reset_est)) < 0) {
- error_report("tpm-emulator: Could not reset the establishment bit: %s",
- strerror(errno));
+ error_report("tpm-emulator: Could not reset the establishment bit");
return -1;
}
/* FIXME: make the function non-blocking, or it may block a VCPU */
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_CANCEL_TPM_CMD, &res, 0,
sizeof(ptm_res), sizeof(res)) < 0) {
- error_report("tpm-emulator: Could not cancel command: %s",
- strerror(errno));
+ error_report("tpm-emulator: Could not cancel command");
} else if (res != 0) {
error_report("tpm-emulator: Failed to cancel TPM: 0x%x",
be32_to_cpu(res));
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_DATAFD, &res, 0,
sizeof(ptm_res), sizeof(res)) < 0 || res != 0) {
- error_report("tpm-emulator: Failed to send CMD_SET_DATAFD: %s",
- strerror(errno));
+ error_report("tpm-emulator: Failed to send CMD_SET_DATAFD");
goto err_exit;
}
*/
if (tpm_util_test_tpmdev(QIO_CHANNEL_SOCKET(tpm_emu->data_ioc)->fd,
&tpm_emu->tpm_version)) {
- error_report("'%s' is not emulating TPM device. Error: %s",
- tpm_emu->options->chardev, strerror(errno));
+ error_report("'%s' is not emulating TPM device.",
+ tpm_emu->options->chardev);
goto err;
}
/* always returns up to resp.data */
offsetof(ptm_getstate, u.resp.data),
offsetof(ptm_getstate, u.resp.data)) < 0) {
- error_report("tpm-emulator: could not get state blob type %d : %s",
- type, strerror(errno));
+ error_report("tpm-emulator: could not get state blob type %d", type);
return -1;
}
/* write the header only */
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_STATEBLOB, &pss,
offsetof(ptm_setstate, u.req.data), 0, 0) < 0) {
- error_setg_errno(errp, errno,
- "tpm-emulator: could not set state blob type %d",
- type);
+ error_setg(errp, "tpm-emulator: could not set state blob type %d",
+ type);
return -1;
}
if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SHUTDOWN, &res, 0,
sizeof(ptm_res), sizeof(res)) < 0) {
- error_report("tpm-emulator: Could not cleanly shutdown the TPM: %s",
- strerror(errno));
+ error_report("tpm-emulator: Could not cleanly shutdown the TPM");
} else if (res != 0) {
error_report("tpm-emulator: TPM result for shutdown: 0x%x %s",
be32_to_cpu(res), tpm_emulator_strerror(be32_to_cpu(res)));