mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-06 20:00:05 +00:00
qemuProcessHandleIOError: Log IO errors in the VM log file
Add a log entry to the VM log file for every time we receive an IO error event from qemu. The log entry is as follows: 2025-01-24 16:03:28.928+0000: IO error device='virtio-disk0' node-name='libvirt-1-storage' reason='other: Input/output error' Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
300f7e9bd4
commit
18f8d572be
@ -829,7 +829,7 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
const char *nodename,
|
const char *nodename,
|
||||||
int action,
|
int action,
|
||||||
bool nospace,
|
bool nospace,
|
||||||
const char *reason G_GNUC_UNUSED)
|
const char *reason)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv;
|
qemuDomainObjPrivate *priv;
|
||||||
virObjectEvent *ioErrorEvent = NULL;
|
virObjectEvent *ioErrorEvent = NULL;
|
||||||
@ -867,6 +867,9 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
ioErrorEvent2 = virDomainEventIOErrorReasonNewFromObj(vm, eventPath, eventAlias, action, eventReason);
|
ioErrorEvent2 = virDomainEventIOErrorReasonNewFromObj(vm, eventPath, eventAlias, action, eventReason);
|
||||||
|
|
||||||
if ((timestamp = virTimeStringNow()) != NULL) {
|
if ((timestamp = virTimeStringNow()) != NULL) {
|
||||||
|
qemuDomainLogAppendMessage(priv->driver, vm, "%s: IO error device='%s' node-name='%s' reason='%s'\n",
|
||||||
|
timestamp, NULLSTR(eventAlias), NULLSTR(nodename), NULLSTR(reason));
|
||||||
|
|
||||||
if (src) {
|
if (src) {
|
||||||
g_free(src->ioerror_timestamp);
|
g_free(src->ioerror_timestamp);
|
||||||
g_free(src->ioerror_message);
|
g_free(src->ioerror_message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user