blob: 31cb2ffabeb48c157f1dc521f2c6a94653c99730 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/*
* CPER payload parser for error injection
*
* Copyright(C) 2024-2025 Huawei LTD.
*
* This code is licensed under the GPL version 2 or later. See the
* COPYING file in the top-level directory.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "qemu/osdep.h"
#include "qemu/base64.h"
#include "qemu/error-report.h"
#include "qemu/uuid.h"
#include "qapi/qapi-commands-acpi-hest.h"
#include "hw/acpi/ghes.h"
void qmp_inject_ghes_v2_error(const char *qmp_cper, Error **errp)
{
AcpiGhesState *ags;
uint8_t *cper;
size_t len;
ags = acpi_ghes_get_state();
if (!ags) {
return;
}
cper = qbase64_decode(qmp_cper, -1, &len, errp);
if (!cper) {
error_setg(errp, "missing GHES CPER payload");
return;
}
ghes_record_cper_errors(ags, cper, len, ACPI_HEST_SRC_ID_QMP, errp);
g_free(cper);
}
|