Commit bed4269a authored by Michal Privoznik's avatar Michal Privoznik

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.
Signed-off-by: 's avatarMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: 's avatarMartin Kletzander <mkletzan@redhat.com>
parent 1762194e
......@@ -23,7 +23,7 @@
#ifndef __LIBVIRT_NOTIFICATIONS_H__
# define __LIBVIRT_NOTIFICATIONS_H__
#include "libvirtSnmp.h"
# include <libvirt/libvirt.h>
/*
* function declarations
......
......@@ -26,6 +26,8 @@
#include <stdlib.h>
#include <pthread.h>
#include <signal.h>
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
#include "libvirtSnmp.h"
#include "libvirtGuestTable.h" /* include our MIB structures*/
......
......@@ -23,14 +23,10 @@
#ifndef __LIBVIRT_SNMP_H__
# define __LIBVIRT_SNMP_H__
/* standard libvirt includes */
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
/* standard Net-SNMP includes */
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
# include <net-snmp/net-snmp-config.h>
# include <net-snmp/net-snmp-includes.h>
# include <net-snmp/agent/net-snmp-agent-includes.h>
/*
* Populate libvirtGuestTable into given container.
......
......@@ -20,8 +20,13 @@
* Author: Michal Privoznik <mprivozn@redhat.com>
*/
#include "libvirtSnmpError.h"
#include <config.h>
#include <stdio.h>
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
#include "libvirtSnmpError.h"
/**
* Print libvirt error
......
......@@ -23,9 +23,6 @@
#ifndef __LIBVIRT_SNMP_ERROR_H__
# define __LIBVIRT_SNMP_ERROR_H__
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
extern void printLibvirtError(const char *msg);
#endif /* __LIBVIRT_SNMP_ERROR_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment