tpm: Remove superfluous '\n' around error_report()
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
ebbb419aa2
commit
27215a22dd
@ -143,7 +143,7 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
|
|||||||
if (!tpm_pt->tpm_op_canceled ||
|
if (!tpm_pt->tpm_op_canceled ||
|
||||||
(tpm_pt->tpm_op_canceled && errno != ECANCELED)) {
|
(tpm_pt->tpm_op_canceled && errno != ECANCELED)) {
|
||||||
error_report("tpm_passthrough: error while transmitting data "
|
error_report("tpm_passthrough: error while transmitting data "
|
||||||
"to TPM: %s (%i)\n",
|
"to TPM: %s (%i)",
|
||||||
strerror(errno), errno);
|
strerror(errno), errno);
|
||||||
}
|
}
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
@ -156,14 +156,14 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
|
|||||||
if (!tpm_pt->tpm_op_canceled ||
|
if (!tpm_pt->tpm_op_canceled ||
|
||||||
(tpm_pt->tpm_op_canceled && errno != ECANCELED)) {
|
(tpm_pt->tpm_op_canceled && errno != ECANCELED)) {
|
||||||
error_report("tpm_passthrough: error while reading data from "
|
error_report("tpm_passthrough: error while reading data from "
|
||||||
"TPM: %s (%i)\n",
|
"TPM: %s (%i)",
|
||||||
strerror(errno), errno);
|
strerror(errno), errno);
|
||||||
}
|
}
|
||||||
} else if (ret < sizeof(struct tpm_resp_hdr) ||
|
} else if (ret < sizeof(struct tpm_resp_hdr) ||
|
||||||
tpm_passthrough_get_size_from_buffer(out) != ret) {
|
tpm_passthrough_get_size_from_buffer(out) != ret) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
error_report("tpm_passthrough: received invalid response "
|
error_report("tpm_passthrough: received invalid response "
|
||||||
"packet from TPM\n");
|
"packet from TPM");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_selftest && (ret >= sizeof(struct tpm_resp_hdr))) {
|
if (is_selftest && (ret >= sizeof(struct tpm_resp_hdr))) {
|
||||||
@ -309,7 +309,7 @@ static void tpm_passthrough_cancel_cmd(TPMBackend *tb)
|
|||||||
if (tpm_pt->cancel_fd >= 0) {
|
if (tpm_pt->cancel_fd >= 0) {
|
||||||
n = write(tpm_pt->cancel_fd, "-", 1);
|
n = write(tpm_pt->cancel_fd, "-", 1);
|
||||||
if (n != 1) {
|
if (n != 1) {
|
||||||
error_report("Canceling TPM command failed: %s\n",
|
error_report("Canceling TPM command failed: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
tpm_pt->tpm_op_canceled = true;
|
tpm_pt->tpm_op_canceled = true;
|
||||||
@ -440,13 +440,13 @@ static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
|
|||||||
|
|
||||||
tpm_pt->tpm_fd = qemu_open(tpm_pt->tpm_dev, O_RDWR);
|
tpm_pt->tpm_fd = qemu_open(tpm_pt->tpm_dev, O_RDWR);
|
||||||
if (tpm_pt->tpm_fd < 0) {
|
if (tpm_pt->tpm_fd < 0) {
|
||||||
error_report("Cannot access TPM device using '%s': %s\n",
|
error_report("Cannot access TPM device using '%s': %s",
|
||||||
tpm_pt->tpm_dev, strerror(errno));
|
tpm_pt->tpm_dev, strerror(errno));
|
||||||
goto err_free_parameters;
|
goto err_free_parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tpm_passthrough_test_tpmdev(tpm_pt->tpm_fd)) {
|
if (tpm_passthrough_test_tpmdev(tpm_pt->tpm_fd)) {
|
||||||
error_report("'%s' is not a TPM device.\n",
|
error_report("'%s' is not a TPM device.",
|
||||||
tpm_pt->tpm_dev);
|
tpm_pt->tpm_dev);
|
||||||
goto err_close_tpmdev;
|
goto err_close_tpmdev;
|
||||||
}
|
}
|
||||||
|
2
tpm.c
2
tpm.c
@ -134,7 +134,7 @@ static int configure_tpm(QemuOpts *opts)
|
|||||||
Error *local_err = NULL;
|
Error *local_err = NULL;
|
||||||
|
|
||||||
if (!QLIST_EMPTY(&tpm_backends)) {
|
if (!QLIST_EMPTY(&tpm_backends)) {
|
||||||
error_report("Only one TPM is allowed.\n");
|
error_report("Only one TPM is allowed.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user