2018-10-25  Michal Privoznik  <mprivozn@redhat.com>

	Release of libvirt-snmp-0.0.4

	libvirtSnmp: Return @ret from libvirtSnmpDestroy
	In f9648989009 I've reworked libvirtSnmpDestroy() to follow the
	usual code pattern (initializing @ret to -1 and setting it to 0
	only as the last step). However, I forgot to actually return @ret
	instead of 'return 0'.

	libvirtGuestTable_data_access: Fix format in libvirtGuestTable_container_load
	Because this file uses TABs to indent it might be not visible at
	the first glance but the formatting of
	libvirtGuestTable_container_load() is a bit misleading. Spotted
	when building with -Werror=format-security.

	configure: Fix MIB_DIR's prefix
	So far we are taking whatever is `net-snmp-config
	--default-mibdirs` returns and using that as MIB_DIR to install
	our MIB. This has a drawback that it ignores whatever prefix user
	specifies to configure script (which is used by `make distcheck`
	too). The fix consists of querying for net-snmp-config --prefix
	and replacing that in MIB_DIR var.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

2018-10-19  Michal Privoznik  <mprivozn@redhat.com>

	libvirtSnmpInit: Don't report errors from libvirtRegisterEvents()
	The libvirtRegisterEvents() function now reports errors on its
	own. No need to duplicate the effort.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp: Report libvirt errors if no domain is found
	Instead of plain printf(), report proper libvirt error.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp: Fix type of libvirtUnregisterEvents()
	This function returns only a single value. It makes no sense to
	have it return that. Make it return void.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmpError: Introduce and use printSystemError
	This function formats passed string and prints stringified system
	error.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp: s/showError/printLibvirtError/
	We have two function that do merely the same. Merge them into
	one.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp: Drop 'extern' from function headers
	These functions are not extern. Drop the keyword.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmpError: Drop 'extern' for printLibvirtError()
	This function is not extern. Drop the keyword.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp: turn showError() into printf-like function
	Currently, the following pattern is used with showError:

	  printf("Some error message\n");
	  showError(conn);

	Not only showError does not need connection pointer, those two
	lines can be merged into a single one:

	  showError("Some error message");

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtRegisterEvents: Drop pthread_attr_init
	The threads are JOINABLE by default. No need to go through
	pthread_attr_* circus to set what is default anyway.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	src: Fix includes in header files
	A header file should include another header file if and only if
	an there exists a symbol that requires the inclusion. For
	instance, if a header file declares the following function:

	  int function(virDomainPtr dom);

	then it is okay to have the header file include libvirt.h.
	Unfortunately, some of our header files have needless includes.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	src: Fix header file defines
	To avoid multiple includes, header files start with:

	  #ifndef __SOMETHING__
	  # define __SOMETHING__

	Well, SOMETHING should be the file name, and there should be a
	space after hash and before 'define'.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp: Rewrite some functions
	Some function initialize retval to 0 and then for every error
	path they reset it to -1.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp: Modernize insertGuest
	Firstly, this style of comparison makes my eyes bleed:

	  if (-1 == some_int)

	Secondly, the retval is initialized to zero and then in every
	error path it is set to -1. Le sigh.
	Thirdly, virDomainGetName() can't fail at the point we are
	calling it (it can fail iff passed virDomainPtr is invalid, but
	that can't be the case).

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp: Modernize libvirtSnmpLoadGuests
	Since libvirt-0.9.13 we have this atomic API for listing domains.
	Use that instead of the old ones.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	showError: Switch to less ancient error reporting
	So far, the function calls virConnCopyLastError() which is
	suboptimal since we have virGetLastErrorMessage(). Switch to
	that.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	configure.ac: Drop useless "-lvirt" in LIBVIRT_LIBS
	We are using PKG_CHECK_MODULES() which sets LIBVIRT_LIBS and
	LIBVIRT_CFLAGS. There is no need to modify the former and put
	"-lvirt" into it.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	configure: Drop support for libvirt older than 0.9.0
	Historically, we wanted libvirt-snmp to build on RHEL-6.0 which
	contained ancient libvirt. It's not the case anymore - after six
	years it is safe to assume everybody upgraded to something newer.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtSnmp.c: Retab and realign
	This file contains tabs, is misaligned and ugly. Fix this.

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

	libvirtGuestTable.c: Free duplicated domain name
	The domain name is duplicated in insertGuest() but it's never
	freed leading to the following memleak:

	 46 bytes in 6 blocks are definitely lost in loss record 795 of 944
	    at 0x4C2CF0F: malloc (vg_replace_malloc.c:299)
	    by 0x6E6FE79: strdup (in /lib64/libc-2.26.so)
	    by 0x10E665: insertGuest (libvirtSnmp.c:160)
	    by 0x10EA7D: libvirtSnmpLoadGuests (libvirtSnmp.c:285)
	    by 0x10DB01: libvirtGuestTable_container_load (libvirtGuestTable_data_access.c:230)
	    by 0x1133E3: _cache_load (libvirtGuestTable_interface.c:1557)
	    by 0x5F2955B: _cache_load (in /usr/lib64/libnetsnmpagent.so.30.0.3)
	    by 0x5F2A7FF: netsnmp_cache_helper_handler (in /usr/lib64/libnetsnmpagent.so.30.0.3)
	    by 0x5F3CE2C: netsnmp_call_next_handler (in /usr/lib64/libnetsnmpagent.so.30.0.3)
	    by 0x5F316B6: table_helper_handler (in /usr/lib64/libnetsnmpagent.so.30.0.3)
	    by 0x5F3C8E6: netsnmp_call_handlers (in /usr/lib64/libnetsnmpagent.so.30.0.3)
	    by 0x5F4A65E: handle_var_requests (in /usr/lib64/libnetsnmpagent.so.30.0.3)

	Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

2018-09-10  Michal Privoznik  <mprivozn@redhat.com>

	Send sysUpTime in traps
	https://bugzilla.redhat.com/show_bug.cgi?id=1624879

	According to RFC 1905:

	  The first two variable bindings in the variable binding list of
	  an SNMPv2-Trap-PDU are sysUpTime.0 and snmpTrapOID.0
	  respectively.

	We are setting the snmpTrapOID.0 variable but not sysUpTime.0.

	Based on work of: Miguel Martin <mmartinv@redhat.com>

	Use HTTPS instead of HTTP
	libvirt.org supports HTTPS for a while now. Prefer that.

	configure: Prevent autoreconf from installing `compile' file
	When running autoreconf, it installs this `compile' file which
	triggers my OCD. It appears that our configure script can be
	modernized a bit which makes it stop.

	Makefile: Introduce srpm target
	Just like we have 'rpm' we might have 'srpm'.

	Generate AUTHORS from git log
	Adding new contributor to the list is something I keep forgetting
	about. Therefore switch to autogenerated list of contributors,
	just like every other libvirt project is doing so.

2018-09-05  Michal Privoznik  <mprivozn@redhat.com>

	spec: Modernize the spec file
	There are two macros ("BuildRoot" and "defattr") that were
	required in RHEL-5 world. Things are different now and we do not
	need to specify those anymore.

	spec: Require git and gcc for the build
	In previous patch 46cae089f12 I've switched the spec file to
	apply patches with git. However, I forgot to add that as a build
	dependency so on systems with minimal install this may fail if
	they don't have git installed.

2018-09-04  Michal Privoznik  <mprivozn@redhat.com>

	rpm: simplify applying of patches
	The distros we support for RPM builds all have %autosetup
	support. Use that instead of what we currently have (nothing).

2018-09-04  Miguel Martin  <mmartinv@redhat.com>

	Fix wrong object OIDs sent by libvirtMib_subagent
	https://bugzilla.redhat.com/show_bug.cgi?id=1624839

	The objects OIDs sent by the guest agent are:
	libvirtGuestName.0
	libvirtGuestUUID.1
	libvirtGuestState.2
	libvirtGuestRowStatus.3

	The expected libvirtGuestNotif objects OID would be:
	libvirtGuestName.0
	libvirtGuestUUID.0
	libvirtGuestState.0
	libvirtGuestRowStatus.0

2018-04-24  Daniel P. Berrangé  <berrange@redhat.com>

	git: add config file telling git-publish how to send patches
	The "git-publish" tool is a useful git extension for sending patch
	series for code review. It automatically creates versioned tags
	each time code on a branch is sent, so that there is a record of
	each version. It also remembers the cover letter so it does not
	need re-entering each time the series is reposted.

	With this config file present it is now sufficient[1] to run

	  $ git publish

	to send all patches in a branch to the list for review, with the
	correct subject prefix added for this non-core libvirt module.

	[1] Assuming your $HOME/.gitconfig has an SMTP server listed
	at least e.g.

	   [sendemail]
	        smtpserver = smtp.example.com

2018-03-21  Michael Corcoran  <tracer@outlook.co.nz>

	Replace placeholder org OID with libvirt OID
	An OID of 36957 was assigned to libvirt by IANA, but the placeholder OID
	of 12345 was never replaced.

	IANA lists the libvirt registration as:
	36957
	  libvirt
	    Daniel Veillard
	      daniel&veillard.com

	https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers

	Replace U64 with struct counter64 to fix build
	Upstream net-snmp removed the U64 typedef in 2016 as it clashed with a
	name in Perl, thus all usages of U64 must be replaced by struct counter64 to
	compile against recent versions of net-snmp.

	The replacements were made by hand, while referencing diff with new
	source generated by the mib2c tool. net-snmp have a mib2c-update tool
	which supposedly assists with updating existing (modified) source code
	but I was unable to get it to work.

2015-12-04  Michal Privoznik  <mprivozn@redhat.com>

	libvirt-snmp.spec.in: Fix changelog
	The initial version was released on Wednesday, not Thursday. I
	would not care, but rpmlint is kind of sad:

	libvirt-snmp.src: E: specfile-error warning: bogus date in %changelog: Thu Feb  2 2011 Michal Privoznik <mprivozn@redhat.com> 0.0.1-1
	13 packages and 0 specfiles checked; 1 errors, 0 warnings.

2015-07-10  Michal Privoznik  <mprivozn@redhat.com>

	LIBVIRT-MIB: Comply with formatting rules
	So, I've came along this web site [1] which tries to validate a MIB
	file. So I fed it with LIBVIRT-MIB and found some errors. This commit
	fixes them so that the test passes again. This should be no functional
	change, rather than some formatting change.

	1: http://www.simpleweb.org/ietf/mibs/validate/

2012-10-16  Jorge Boncompte [DTI2]  <jorge@dti2.net>

	List inactive domains
	Monitoring app can't otherwise differentiate between a stopped domain
	or a nonexistent one.

2012-09-07  Michal Privoznik  <mprivozn@redhat.com>

	Release of libvirt-snmp-0.0.3

2012-08-13  Doug Goldstein  <cardoe@cardoe.com>

	Fix build rules to use LDADD to add libraries
	Fix build rules to use LDADD to add libraries to support --as-needed.
	Also refactored some of the other automake variables in the same fashion
	of the libvirt's automake rules.

2012-05-30  Martin Kletzander  <mkletzan@redhat.com>

	Stop event thread on server stop
	When C-c is sent to the process, the main thread (server) receives it
	and sets keep_running to 0, but the second thread is still
	running. Also, the second thread is not cleaned up after
	pthread_join() or pthread_destroy().
	This patch adds the cleanup function before all exit points of the
	program and fixes the cleansing of the second thread.

	cleanup: whitespaces removed from ends of lines

2012-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Don't overwrite original LIBVIRT_LIBS value

	Fix configure.ac to use PKG_CONFIG to detect libvirt

2011-10-19  Michal Privoznik  <mprivozn@redhat.com>

	Fix off-by-one error
	as libvirtGuestName_val_ptr_len_ptr should contain the data
	size in bytes. However, without trailing zero. But on the other
	hand, coverity will complain if we don't alocate memory for
	trailing '\0' even if we are not memcpy()-ing it. It's false
	positive then, obviously.

2011-10-18  Laine Stump  <laine@laine.org>

	fix startup logic for selecting stderr vs syslog
	This bug was uncovered by coverity during the run that resulted in the
	filing of the following bug:

	   https://bugzilla.redhat.com/show_bug.cgi?id=732015

	use_syslog was initialized to 0, and then if the "Use stderr" option
	was selected, it was set to ... "0"!

	Rather than simply initializing to 1, I decided to reduce confusion by
	renaming the variable to "use_stderr", leave it initialized to 0, then
	set to 1 when the user asks for stderr.

	eliminate bogus check for "NULL" array
	This is another bug found by coverity in:

	   https://bugzilla.redhat.com/show_bug.cgi?id=732015

	Apparently libvirtGuestUUID was originally a pointer, and the code was
	making sure that it had memory allocated, but now it is an array that
	is contained in the structure, so checking for NULL makes no sense.

	allocate enough space for trailing NULL in string
	This bug was found by coverity. See:

	  https://bugzilla.redhat.com/show_bug.cgi?id=732015

2011-04-21  Michal Privoznik  <mprivozn@redhat.com>

	Add SNMP trap/notification support.
	This patch adds support for domain lifecycle notification support
	over SNMP traps. SNMP subagent monitors any domain events and when
	something interesting happens, it sends a trap.

	Monitoring is done in a joinable thread using polling (used
	domain-events example from libvirt) so we won't block the agent itself.

	Some debug info can be printed out by setting LIBVIRT_SNMP_VERBOSE
	environment variable.

2011-04-14  Michal Privoznik  <mprivozn@redhat.com>

	Create functions to fill in and send notification packets.
	Before sending snmp notification we need to fill in useful data,
	like domain status, UUID, etc.

	Add libvirt error handling function

	Add notification-type object to libvirt MIB

2011-03-11  Michal Privoznik  <mprivozn@redhat.com>

	Update libvirt-snmp.spec.in

	remove LIBVIRT-MIB.txt from %doc
	and leave it in %{_datadir}/snmp/mibs/ only.

2011-03-10  Michal Privoznik  <mprivozn@redhat.com>

	resolve licensing conflicts
	and add unified header to source files.

2011-03-08  Michal Privoznik  <mprivozn@redhat.com>

	configure.ac: lower required minimal version of autoconf
	so we can build even on rhel 5.6 where the original version is not  yet.

2011-03-03  Michal Privoznik  <mprivozn@redhat.com>

	Another cleanup

2011-03-02  Michal Privoznik  <mprivozn@redhat.com>

	Cleanup autotools files to produce rpmlint compliant rpms.
	Added manpage for libvirtMib_subagent and ChangeLog generation.

2011-02-16  Daniel P. Berrange  <berrange@redhat.com>

	Add automated build control script
	* .gitignore: Ignore build directory
	* autobuild.sh: Add automated build script
	* autogen.sh: Helper for re-generating autotools files
	* libvirt-snmp.spec.in: Add extra_release and remove
	  substitution of mibdir since RPM path shouldn't change
	  regardless of current configure args

2011-02-10  Michal Privoznik  <mprivozn@redhat.com>

	Remove the hard coded connection URI.
	So now we rely on libvirt LIBVIRT_DEFAULT_URI environment variable.

2011-02-09  Michal Privoznik  <mprivozn@redhat.com>

	Created .gitignore to ignore generated/compiled files.

2011-02-03  Michal Privoznik  <mprivozn@redhat.com>

	Initial revision

2011-02-03  Daniel Veillard  <veillard@redhat.com>

	Adding a first README file
