nbdkit/0013-vddk-Demote-another-ph...

79 lines
2.5 KiB
Diff

From 16fdeab315c865c2aeae1ebf896dc69d5ebdeffc Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 7 Jul 2022 08:57:36 +0100
Subject: [PATCH] vddk: Demote another "phone home" error message to debug
Reported-by: Ming Xie
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2104720
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit afa8cc84392af26641b340c58b836ca879698a53)
---
plugins/vddk/vddk.c | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
index dbd3fdbe..35697bc1 100644
--- a/plugins/vddk/vddk.c
+++ b/plugins/vddk/vddk.c
@@ -49,6 +49,7 @@
#define NBDKIT_API_VERSION 2
#include <nbdkit-plugin.h>
+#include "array-size.h"
#include "cleanup.h"
#include "minmax.h"
#include "vector.h"
@@ -495,11 +496,25 @@ debug_function (const char *fs, va_list args)
nbdkit_debug ("%s", str);
}
+/* VDDK 7 added some useless error messages about their "phone home"
+ * system called CEIP which only panics users. Demote these to debug
+ * statements below.
+ *
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1834267
+ * https://bugzilla.redhat.com/show_bug.cgi?id=2083617
+ * https://bugzilla.redhat.com/show_bug.cgi?id=2104720
+ */
+static const char * const demoted_errors[] = {
+ "Get CEIP status failed",
+ "VDDK_PhoneHome:",
+};
+
/* Turn error messages from the library into nbdkit_error. */
static void
error_function (const char *fs, va_list args)
{
CLEANUP_FREE char *str = NULL;
+ size_t i;
/* If the thread-local error_suppression flag is non-zero then we
* will suppress error messages from VDDK in this thread.
@@ -513,17 +528,12 @@ error_function (const char *fs, va_list args)
trim (str);
- /* VDDK 7 added some useless error messages about their "phone home"
- * system called CEIP which only panics users. Demote to a debug
- * statement.
- * https://bugzilla.redhat.com/show_bug.cgi?id=1834267
- * https://bugzilla.redhat.com/show_bug.cgi?id=2083617
- */
- if (strstr (str, "Get CEIP status failed") != NULL ||
- strstr (str, "VDDK_PhoneHome: Unable to load configuration "
- "options from ") != NULL) {
- nbdkit_debug ("%s", str);
- return;
+ /* See comment above about demoted errors. */
+ for (i = 0; i < ARRAY_SIZE (demoted_errors); ++i) {
+ if (strstr (str, demoted_errors[i]) != NULL) {
+ nbdkit_debug ("%s", str);
+ return;
+ }
}
nbdkit_error ("%s", str);
--
2.31.1