summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 30bea35)
raw | patch | inline | side by side (parent: 30bea35)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 11 Oct 2009 17:20:22 +0000 (19:20 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 11 Oct 2009 17:20:22 +0000 (19:20 +0200) |
This patch has been included upstream.
debian/changelog | patch | blob | history | |
debian/patches/00list | patch | blob | history | |
debian/patches/libvirt-reconnect.dpatch | [deleted file] | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index 378e5fd32760fa9e5b97c7a8f82a5ebca0d19dd7..d0c307a8f1d198b5c153b2bac0ccb4786b123c3f 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
- Removed bts541953-curl-followlocation.dpatch - included upstream.
- Removed bts542859-df-fix-ignorelist.dpatch - included upstream.
- Removed java-fix-jvm-start.dpatch - included upstream.
+ - Removed libvirt-reconnect.dpatch - included upstream.
- -- Sebastian Harl <tokkee@debian.org> Sun, 11 Oct 2009 19:18:29 +0200
+ -- Sebastian Harl <tokkee@debian.org> Sun, 11 Oct 2009 19:20:07 +0200
collectd (4.7.2-1) unstable; urgency=low
diff --git a/debian/patches/00list b/debian/patches/00list
index 680577af72672f31d87a1d7941321ca211713c54..1788169ccd3cb5446986ff342c18090f373cd49e 100644 (file)
--- a/debian/patches/00list
+++ b/debian/patches/00list
rrd_filter_path.dpatch
collection_conf_path.dpatch
network-fix-cacheflush.dpatch
-libvirt-reconnect.dpatch
plugin-fix-unregister.dpatch
diff --git a/debian/patches/libvirt-reconnect.dpatch b/debian/patches/libvirt-reconnect.dpatch
+++ /dev/null
@@ -1,86 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## libvirt-reconnect.dpatch by Alan Pevec <apevec@redhat.com> and
-## Florian Forster <octo@verplant.org>
-##
-## DP: libvirt plugin: Re-connect to libvirtd if connecting fails.
-## DP:
-## DP: https://bugzilla.redhat.com/show_bug.cgi?id=480997
-
-@DPATCH@
-
-diff a/src/libvirt.c b/src/libvirt.c
---- a/src/libvirt.c
-+++ b/src/libvirt.c
-@@ -24,6 +24,7 @@
- #include "plugin.h"
- #include "configfile.h"
- #include "utils_ignorelist.h"
-+#include "utils_complain.h"
-
- #include <libvirt/libvirt.h>
- #include <libvirt/virterror.h>
-@@ -49,6 +50,8 @@ static const char *config_keys[] = {
-
- /* Connection. */
- static virConnectPtr conn = 0;
-+static char *conn_string = NULL;
-+static c_complain_t conn_complain = C_COMPLAIN_INIT_STATIC;
-
- /* Seconds between list refreshes, 0 disables completely. */
- static int interval = 60;
-@@ -153,15 +156,13 @@ lv_config (const char *key, const char *value)
- il_interface_devices = ignorelist_create (1);
-
- if (strcasecmp (key, "Connection") == 0) {
-- if (conn != 0) {
-- ERROR ("Connection may only be given once in config file");
-- return 1;
-- }
-- conn = virConnectOpenReadOnly (value);
-- if (!conn) {
-- VIRT_ERROR (NULL, "connection failed");
-+ char *tmp = strdup (value);
-+ if (tmp == NULL) {
-+ ERROR ("libvirt plugin: Connection strdup failed.");
- return 1;
- }
-+ sfree (conn_string);
-+ conn_string = tmp;
- return 0;
- }
-
-@@ -253,19 +254,29 @@ lv_read (void)
- int i;
-
- if (conn == NULL) {
-- ERROR ("libvirt plugin: Not connected. Use Connection in "
-- "config file to supply connection URI. For more information "
-- "see <http://libvirt.org/uri.html>");
-- return -1;
-+ /* `conn_string == NULL' is acceptable. */
-+ conn = virConnectOpenReadOnly (conn_string);
-+ if (conn == NULL) {
-+ c_complain (LOG_ERR, &conn_complain,
-+ "libvirt plugin: Unable to connect: "
-+ "virConnectOpenReadOnly failed.");
-+ return -1;
-+ }
- }
-+ c_release (LOG_NOTICE, &conn_complain,
-+ "libvirt plugin: Connection established.");
-
- time (&t);
-
- /* Need to refresh domain or device lists? */
- if ((last_refresh == (time_t) 0) ||
- ((interval > 0) && ((last_refresh + interval) <= t))) {
-- if (refresh_lists () != 0)
-+ if (refresh_lists () != 0) {
-+ if (conn != NULL)
-+ virConnectClose (conn);
-+ conn = NULL;
- return -1;
-+ }
- last_refresh = t;
- }
-