Blob Blame History Raw
From b30af11ddd465a299cf1bd66cc3c42a1ce741368 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 4 Apr 2017 16:22:03 -0500
Subject: [PATCH 1/4] Log: libcrmcommon: more useful message if can't open dump
 file

also avoids a static analysis false positive
---
 lib/common/schemas.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/common/schemas.c b/lib/common/schemas.c
index f1a0238..055d141 100644
--- a/lib/common/schemas.c
+++ b/lib/common/schemas.c
@@ -553,7 +553,10 @@ dump_file(const char *filename)
     CRM_CHECK(filename != NULL, return);
 
     fp = fopen(filename, "r");
-    CRM_CHECK(fp != NULL, return);
+    if (fp == NULL) {
+        crm_perror(LOG_ERR, "Could not open %s for reading", filename);
+        return;
+    }
 
     fprintf(stderr, "%4d ", ++line);
     do {
-- 
1.8.3.1


From 9d912a09ca730b9fa9612de850839a2340aeb6d0 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 4 Apr 2017 16:27:47 -0500
Subject: [PATCH 2/4] Low: libpe_status: only set container hostname if have IP

---
 lib/pengine/container.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/pengine/container.c b/lib/pengine/container.c
index b93d98f..127b144 100644
--- a/lib/pengine/container.c
+++ b/lib/pengine/container.c
@@ -214,8 +214,17 @@ create_docker_resource(
         create_nvp(xml_obj, "force_kill", "false");
         create_nvp(xml_obj, "reuse", "false");
 
-        offset += snprintf(buffer+offset, max-offset, "-h %s-%d --restart=no ",
-                           data->prefix, tuple->offset);
+        offset += snprintf(buffer+offset, max-offset, " --restart=no");
+
+        /* Set a container hostname only if we have an IP to map it to.
+         * The user can set -h or --uts=host themselves if they want a nicer
+         * name for logs, but this makes applications happy who need their
+         * hostname to match the IP they bind to.
+         */
+        if (data->ip_range_start != NULL) {
+            offset += snprintf(buffer+offset, max-offset, " -h %s-%d",
+                               data->prefix, tuple->offset);
+        }
 
         if(data->docker_network) {
 //        offset += snprintf(buffer+offset, max-offset, " --link-local-ip=%s", tuple->ipaddr);
-- 
1.8.3.1


From ff8813761d1024de2bba3d813e3e8aacc698bb54 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 4 Apr 2017 16:44:20 -0500
Subject: [PATCH 3/4] Fix: crmd: don't abandon fencing after one "no devices"
 failure

---
 crmd/te_callbacks.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/crmd/te_callbacks.c b/crmd/te_callbacks.c
index ff0a664..6c0670c 100644
--- a/crmd/te_callbacks.c
+++ b/crmd/te_callbacks.c
@@ -633,7 +633,6 @@ process_te_message(xmlNode * msg, xmlNode * xml_data)
 GHashTable *stonith_failures = NULL;
 struct st_fail_rec {
     int count;
-    int last_rc;
 };
 
 gboolean
@@ -639,9 +638,6 @@ too_many_st_failures(void)
         if (value->count > 10) {
             crm_notice("Too many failures to fence %s (%d), giving up", key, value->count);
             return TRUE;
-        } else if (value->last_rc == -ENODEV) {
-            crm_notice("No devices found in cluster to fence %s, giving up", key);
-            return TRUE;
         }
     }
     return FALSE;
@@ -671,7 +667,6 @@ st_fail_count_reset(const char *target)
 
     if (rec) {
         rec->count = 0;
-        rec->last_rc = 0;
     }
 }
 
@@ -697,8 +692,6 @@ st_fail_count_increment(const char *target, int rc)
         rec->count = 1;
         g_hash_table_insert(stonith_failures, strdup(target), rec);
     }
-    rec->last_rc = rc;
-
 }
 
 void
-- 
1.8.3.1


From bf4eda2d233f40795ff4141aad8985f0da5a7b0b Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 4 Apr 2017 17:55:59 -0500
Subject: [PATCH 4/4] Test: make new valgrind suppression compatible with older
 versions

---
 valgrind-pcmk.suppressions | 1 -
 1 file changed, 1 deletion(-)

diff --git a/valgrind-pcmk.suppressions b/valgrind-pcmk.suppressions
index 48eec9e..33d3b06 100644
--- a/valgrind-pcmk.suppressions
+++ b/valgrind-pcmk.suppressions
@@ -31,7 +31,6 @@
 {
    Bash leak in cli regression testing
    Memcheck:Leak
-   match-leak-kinds: definite
    fun:malloc
    fun:xmalloc
    obj:/usr/bin/bash
-- 
1.8.3.1