]> git.ipfire.org Git - thirdparty/libvirt.git/commit
include: libvirt-domain: Add 'message' @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
authorPeter Krempa <pkrempa@redhat.com>
Fri, 24 Jan 2025 15:26:54 +0000 (16:26 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 4 Feb 2025 13:40:55 +0000 (14:40 +0100)
commit97c47333cbdc2531260f7b11b1fa9ba828878343
treee3340329e8d20de0e78265c01e24cce930d45d90
parent3a3c5616eb2c50a58896f99f30d887937dab297a
include: libvirt-domain: Add 'message' @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON

In case when the hypervisor does report the reason for the I/O error as
an unstable string to display to users we can add a @reason possibility
for the I/O error event noting that the error is available.

Add 'message' as a reason enumeration value and document it
to instruct users to look at the logs or virDomainGetMessages().

The resulting event looks like:

 event 'io-error' for domain 'cd': /dev/mapper/errdev0 (virtio-disk0) report due to message

Users then can look at the virDomainGetMessages() API:

 I/O error: disk='vda', index='1', path='/dev/mapper/errdev0', timestamp='2025-01-28 15:47:52.776+0000', message='Input/output error'

Or in the VM log file:

 2025-01-28 15:47:52.776+0000: IO error device='virtio-disk0' node-name='libvirt-1-storage' reason='Input/output error'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
include/libvirt/libvirt-domain.h
src/qemu/qemu_process.c