On Fri, Jan 24, 2025 at 05:33:04PM +0100, Peter Krempa wrote:
The VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON event allows @reason to be
reported to the user, but currently we only report 'enospc'.
Extend the documentation so that we allow the passthrough of the
verbatim error, prefixed by 'other: ' in order to prevent collisions and
note that users must not attempt to parse them.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
include/libvirt/libvirt-domain.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 2a4b81f4df..e031b23547 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -4790,8 +4790,12 @@ typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr
conn,
* If the I/O error is known to be caused by an ENOSPC condition in
* the host (where resizing the disk to be larger will allow the guest
* to be resumed as if nothing happened), @reason will be "enospc".
- * Otherwise, @reason will be "", although future strings may be added
- * if determination of other error types becomes possible.
+ *
+ * Otherwise, if the hypervisor reported an error @reason will be the verbatim
+ * error message from hypervisor prefixed by "other: ". Note that this error
+ * may not be stable and thus is only really usable for human use. In case
+ * when the hypervisor doesn't report the error @reason will be an empty string
+ * "".
Hmmm, this makes me feel pretty uncomfortable.
When set, the 'reason' field has clear long term stable supported semantics,
which applications are permitted to match against.
Essentially it is an enum field as currently defined.
This is now being turned into a free-format human readable string
which applications are told not to interpret at all.
Effectively we've overloaded the field to have two completely
different sets of semantics.
I don't think we should do this.
If we want a human readable string, it should be distinct from the
the enum reason we support already.
With regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|