File s390-tools-sles15sp4-01-libutil-add-util_exit_code.patch of Package s390-tools.29120
Subject: [PATCH] [FEAT VS1822] libutil: add util_exit_code
From: Matthew Rosato <mjrosato@linux.ibm.com>
Summary: ap_tools: add ap-check and the ap device type to zdev
Description: This feature adds multiple components in support of persistent
configuration of vfio-ap mediated devices.
The ap-check utility is added as a callout function for the
mdevctl utility. This allows for meaningful error messages to be
presented to end-users when vfio-ap configuration errors are
detected while using mdevctl to create/modify vfio-ap mediated
devices.
Additionally, the 'ap' device type is added to zdev, providing a
command-line interface for managing the apmask and aqmask, which
determine what AP resources are available for vfio-ap usage.
'chzdev' is updated to allow for modifying the active masks as
well as to specify persistent mask values via a udev rule.
'lszdev' is updated to allow for querying of the active and
persistent mask values.
Upstream-ID: a739584d6fd749082e0b5ea4cb60955bddafef8c
Problem-ID: VS1822
Upstream-Description:
libutil: add util_exit_code
zdev uses a particular set of exit codes -- In preparation for sharing
some zdev udev code with other libraries, let's also create a libutil
include to specify reusable exit codes. For now, let's just initialize
it with the codes from zdev we care about.
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Reviewed-by: Jason J. Herne <jjherne@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
---
include/lib/util_exit_code.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
--- /dev/null
+++ b/include/lib/util_exit_code.h
@@ -0,0 +1,21 @@
+/**
+ * @defgroup util_exit_code_h util_exit_code: General purpose exit codes
+ * @{
+ * @brief General purpose exit codes
+ *
+ * Copyright IBM Corp. 2022
+ *
+ * s390-tools is free software; you can redistribute it and/or modify
+ * it under the terms of the MIT license. See LICENSE for details.
+ */
+
+#ifndef LIB_UTIL_EXIT_CODE_H
+#define LIB_UTIL_EXIT_CODE_H
+
+typedef enum {
+ UTIL_EXIT_OK = 0, /* Program finished successfully */
+ UTIL_EXIT_RUNTIME_ERROR = 15, /* A run-time error occurred */
+ UTIL_EXIT_OUT_OF_MEMORY = 22, /* Not enough available memory */
+} util_exit_code_t;
+
+#endif /** LIB_UTIL_EXIT_CODE_H @} */