Any source file which calls the logging APIs now needs
to have a VIR_LOG_INIT("source.name") declaration at
the start of the file. This provides a static variable
of the virLogSource type.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
cfg.mk | 3 +++
daemon/libvirtd-config.c | 2 ++
daemon/libvirtd.c | 3 +++
daemon/libvirtd.h | 1 -
daemon/remote.c | 2 ++
daemon/stream.c | 2 ++
docs/apibuild.py | 30 ++++++++++++++++++++++++++++++
src/access/viraccessdriverpolkit.c | 3 +++
src/access/viraccessmanager.c | 3 +++
src/bhyve/bhyve_command.c | 2 ++
src/bhyve/bhyve_driver.c | 2 ++
src/bhyve/bhyve_process.c | 2 ++
src/conf/domain_audit.c | 2 ++
src/conf/domain_conf.c | 2 ++
src/conf/domain_event.c | 1 +
src/conf/network_event.c | 2 ++
src/conf/nwfilter_params.c | 2 ++
src/conf/object_event.c | 2 ++
src/conf/secret_conf.c | 2 ++
src/conf/snapshot_conf.c | 2 ++
src/conf/storage_conf.c | 1 -
src/conf/virchrdev.c | 2 ++
src/cpu/cpu.c | 2 ++
src/cpu/cpu_powerpc.c | 2 ++
src/cpu/cpu_x86.c | 2 ++
src/datatypes.c | 2 ++
src/driver.c | 2 ++
src/esx/esx_device_monitor.c | 1 -
src/esx/esx_driver.c | 2 ++
src/esx/esx_interface_driver.c | 2 --
src/esx/esx_network_driver.c | 2 --
src/esx/esx_nwfilter_driver.c | 2 --
src/esx/esx_secret_driver.c | 2 --
src/esx/esx_storage_backend_iscsi.c | 2 --
src/esx/esx_storage_backend_vmfs.c | 2 ++
src/esx/esx_util.c | 2 +-
src/esx/esx_vi.c | 2 +-
src/esx/esx_vi_methods.c | 1 -
src/esx/esx_vi_types.c | 2 +-
src/fdstream.c | 2 ++
src/hyperv/hyperv_device_monitor.c | 2 --
src/hyperv/hyperv_driver.c | 3 +--
src/hyperv/hyperv_interface_driver.c | 2 --
src/hyperv/hyperv_network_driver.c | 2 --
src/hyperv/hyperv_nwfilter_driver.c | 2 --
src/hyperv/hyperv_secret_driver.c | 2 --
src/hyperv/hyperv_storage_driver.c | 2 --
src/hyperv/hyperv_util.c | 2 +-
src/hyperv/hyperv_wmi.c | 2 --
src/interface/interface_backend_netcf.c | 2 ++
src/libvirt-lxc.c | 2 ++
src/libvirt-qemu.c | 2 ++
src/libvirt.c | 2 ++
src/libvirt_private.syms | 1 -
src/libxl/libxl_conf.c | 2 ++
src/libxl/libxl_domain.c | 1 +
src/libxl/libxl_driver.c | 2 ++
src/locking/domain_lock.c | 2 ++
src/locking/lock_daemon.c | 2 ++
src/locking/lock_daemon_config.c | 2 ++
src/locking/lock_daemon_dispatch.c | 5 ++++-
src/locking/lock_driver_lockd.c | 2 ++
src/locking/lock_driver_nop.c | 2 ++
src/locking/lock_driver_sanlock.c | 2 ++
src/locking/lock_manager.c | 2 ++
src/lxc/lxc_cgroup.c | 2 ++
src/lxc/lxc_conf.c | 2 ++
src/lxc/lxc_container.c | 2 ++
src/lxc/lxc_controller.c | 2 ++
src/lxc/lxc_domain.c | 2 ++
src/lxc/lxc_driver.c | 1 +
src/lxc/lxc_fuse.c | 1 -
src/lxc/lxc_hostdev.c | 2 ++
src/lxc/lxc_monitor.c | 2 ++
src/lxc/lxc_native.c | 1 +
src/lxc/lxc_process.c | 2 ++
src/network/bridge_driver.c | 2 ++
src/network/bridge_driver_linux.c | 3 +++
src/network/bridge_driver_platform.h | 1 -
src/node_device/node_device_driver.c | 2 --
src/node_device/node_device_hal.c | 2 ++
src/node_device/node_device_linux_sysfs.c | 2 ++
src/node_device/node_device_udev.c | 2 ++
src/nodeinfo.c | 1 -
src/nwfilter/nwfilter_dhcpsnoop.c | 2 ++
src/nwfilter/nwfilter_driver.c | 2 ++
src/nwfilter/nwfilter_ebiptables_driver.c | 2 ++
src/nwfilter/nwfilter_gentech_driver.c | 1 +
src/nwfilter/nwfilter_learnipaddr.c | 2 ++
src/openvz/openvz_driver.c | 2 ++
src/parallels/parallels_driver.c | 2 ++
src/phyp/phyp_driver.c | 3 +++
src/qemu/qemu_agent.c | 2 ++
src/qemu/qemu_bridge_filter.c | 1 -
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_cgroup.c | 2 ++
src/qemu/qemu_command.c | 2 ++
src/qemu/qemu_conf.c | 2 ++
src/qemu/qemu_domain.c | 2 ++
src/qemu/qemu_driver.c | 2 ++
src/qemu/qemu_hostdev.c | 2 ++
src/qemu/qemu_hotplug.c | 3 +++
src/qemu/qemu_migration.c | 2 ++
src/qemu/qemu_monitor.c | 2 ++
src/qemu/qemu_monitor_json.c | 2 ++
src/qemu/qemu_monitor_text.c | 2 ++
src/qemu/qemu_process.c | 2 ++
src/remote/remote_driver.c | 2 ++
src/rpc/virkeepalive.c | 2 ++
src/rpc/virnetclient.c | 2 ++
src/rpc/virnetclientprogram.c | 2 ++
src/rpc/virnetclientstream.c | 2 ++
src/rpc/virnetmessage.c | 2 ++
src/rpc/virnetsaslcontext.c | 2 ++
src/rpc/virnetserver.c | 2 ++
src/rpc/virnetserverclient.c | 2 ++
src/rpc/virnetservermdns.c | 2 ++
src/rpc/virnetserverprogram.c | 2 ++
src/rpc/virnetsocket.c | 1 +
src/rpc/virnetsshsession.c | 2 ++
src/rpc/virnettlscontext.c | 2 ++
src/secret/secret_driver.c | 2 ++
src/security/security_apparmor.c | 3 +++
src/security/security_dac.c | 3 +++
src/security/security_driver.c | 2 ++
src/security/security_manager.c | 1 +
src/security/security_selinux.c | 2 ++
src/storage/storage_backend.c | 2 ++
src/storage/storage_backend_disk.c | 2 ++
src/storage/storage_backend_fs.c | 2 ++
src/storage/storage_backend_gluster.c | 2 ++
src/storage/storage_backend_iscsi.c | 2 ++
src/storage/storage_backend_logical.c | 2 ++
src/storage/storage_backend_mpath.c | 2 ++
src/storage/storage_backend_rbd.c | 2 ++
src/storage/storage_backend_scsi.c | 2 ++
src/storage/storage_backend_sheepdog.c | 1 -
src/storage/storage_driver.c | 2 ++
src/test/test_driver.c | 2 ++
src/uml/uml_conf.c | 1 +
src/uml/uml_driver.c | 2 ++
src/util/viralloc.c | 2 ++
src/util/virarch.c | 2 ++
src/util/viraudit.c | 2 ++
src/util/virauth.c | 2 ++
src/util/virauthconfig.c | 1 +
src/util/vircgroup.c | 2 ++
src/util/virclosecallbacks.c | 2 ++
src/util/vircommand.c | 2 ++
src/util/virconf.c | 2 ++
src/util/virdbus.c | 2 ++
src/util/virdnsmasq.c | 3 +++
src/util/virebtables.c | 2 ++
src/util/virerror.c | 2 ++
src/util/virevent.c | 2 ++
src/util/vireventpoll.c | 2 ++
src/util/virfile.c | 2 ++
src/util/virhash.c | 2 ++
src/util/virhook.c | 2 ++
src/util/viridentity.c | 1 +
src/util/viriptables.c | 2 ++
src/util/virjson.c | 1 +
src/util/virkeyfile.c | 2 ++
src/util/virlockspace.c | 2 ++
src/util/virlog.c | 4 ++--
src/util/virlog.h | 10 +++++++++-
src/util/virnetdev.c | 2 ++
src/util/virnetdevmacvlan.c | 1 +
src/util/virnetdevtap.c | 2 ++
src/util/virnetdevveth.c | 2 ++
src/util/virnetdevvportprofile.c | 2 ++
src/util/virnetlink.c | 2 ++
src/util/virnodesuspend.c | 2 ++
src/util/virnuma.c | 2 ++
src/util/virobject.c | 2 ++
src/util/virpci.c | 2 ++
src/util/virpidfile.c | 2 ++
src/util/virprocess.c | 2 ++
src/util/virrandom.c | 2 ++
src/util/virscsi.c | 1 -
src/util/virstoragefile.c | 2 ++
src/util/virstring.c | 2 ++
src/util/virsysinfo.c | 1 -
src/util/virsystemd.c | 1 +
src/util/virusb.c | 2 ++
src/util/virutil.c | 2 ++
src/util/viruuid.c | 2 ++
src/vbox/vbox_MSCOMGlue.c | 2 ++
src/vbox/vbox_XPCOMCGlue.c | 1 +
src/vbox/vbox_driver.c | 1 +
src/vbox/vbox_tmpl.c | 3 +++
src/vmx/vmx.c | 2 ++
src/xen/xen_driver.c | 3 +++
src/xen/xen_hypervisor.c | 2 ++
src/xen/xen_inotify.c | 2 ++
src/xen/xend_internal.c | 2 ++
src/xen/xm_internal.c | 2 ++
src/xen/xs_internal.c | 2 ++
src/xenapi/xenapi_utils.c | 2 ++
src/xenxs/xen_sxpr.c | 2 ++
tests/domainconftest.c | 2 ++
tests/eventtest.c | 2 ++
tests/fdstreamtest.c | 2 ++
tests/libvirtdconftest.c | 2 ++
tests/qemumonitortestutils.c | 2 ++
tests/securityselinuxlabeltest.c | 2 ++
tests/securityselinuxtest.c | 2 ++
tests/sockettest.c | 2 ++
tests/testutils.c | 2 ++
tests/virauthconfigtest.c | 2 ++
tests/vircgrouptest.c | 2 ++
tests/virdbustest.c | 2 ++
tests/virdrivermoduletest.c | 2 ++
tests/virhashtest.c | 2 ++
tests/viridentitytest.c | 1 +
tests/virkeycodetest.c | 1 +
tests/virkeyfiletest.c | 1 +
tests/virlockspacetest.c | 2 ++
tests/virnetmessagetest.c | 2 ++
tests/virnetsockettest.c | 2 ++
tests/virnettlscontexttest.c | 2 ++
tests/virnettlshelpers.c | 2 ++
tests/virnettlssessiontest.c | 2 ++
tests/virportallocatortest.c | 1 +
tests/virstoragetest.c | 2 ++
tests/virstringtest.c | 2 ++
tests/virsystemdtest.c | 2 ++
tests/virtimetest.c | 2 ++
tests/viruritest.c | 2 ++
tools/virsh-console.c | 2 ++
230 files changed, 435 insertions(+), 48 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 2a8957a..7d89515 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1033,3 +1033,6 @@ exclude_file_name_regexp--sc_prohibit_int_ijk = \
exclude_file_name_regexp--sc_prohibit_getenv = \
^tests/.*\.[ch]$$
+
+exclude_file_name_regexp--sc_avoid_attribute_unused_in_header = \
+ ^src/util/virlog\.h$$
diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c
index c816fda..c68c6f4 100644
--- a/daemon/libvirtd-config.c
+++ b/daemon/libvirtd-config.c
@@ -37,6 +37,8 @@
#define VIR_FROM_THIS VIR_FROM_CONF
+VIR_LOG_INIT("daemon.libvirtd-config");
+
/* Allocate an array of malloc'd strings from the config file, filename
* (used only in diagnostics), using handle "conf". Upon error, return -1
* and free any allocated memory. Otherwise, save the array in *list_arg
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 72f0e81..6bee3dd 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -35,6 +35,7 @@
#include "libvirt_internal.h"
#include "virerror.h"
#include "virfile.h"
+#include "virlog.h"
#include "virpidfile.h"
#include "virprocess.h"
@@ -104,6 +105,8 @@
#include "virdbus.h"
+VIR_LOG_INIT("daemon.libvirtd");
+
#if WITH_SASL
virNetSASLContextPtr saslCtxt = NULL;
#endif
diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h
index c4f1f27..650267e 100644
--- a/daemon/libvirtd.h
+++ b/daemon/libvirtd.h
@@ -32,7 +32,6 @@
# include "remote_protocol.h"
# include "lxc_protocol.h"
# include "qemu_protocol.h"
-# include "virlog.h"
# include "virthread.h"
# if WITH_SASL
# include "virnetsaslcontext.h"
diff --git a/daemon/remote.c b/daemon/remote.c
index 8bb4ed2..de75de1 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -57,6 +57,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("daemon.remote");
+
#if SIZEOF_LONG < 8
# define HYPER_TO_TYPE(_type, _to, _from) \
do { \
diff --git a/daemon/stream.c b/daemon/stream.c
index 9e36e8a..16cdf03 100644
--- a/daemon/stream.c
+++ b/daemon/stream.c
@@ -32,6 +32,8 @@
#define VIR_FROM_THIS VIR_FROM_STREAMS
+VIR_LOG_INIT("daemon.stream");
+
struct daemonClientStream {
daemonClientPrivatePtr priv;
int refs;
diff --git a/docs/apibuild.py b/docs/apibuild.py
index ab6b0b4..71494d5 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -1446,6 +1446,24 @@ class CParser:
return token
+ def parseVirLogInit(self, token):
+ if token[0] != "string":
+ self.error("parsing VIR_LOG_INIT: expecting string", token)
+
+ token = self.token()
+
+ if token[0] != "sep":
+ self.error("parsing VIR_LOG_INIT: expecting ')'", token)
+
+ if token[1] != ')':
+ self.error("parsing VIR_LOG_INIT: expecting ')'", token)
+
+ token = self.token()
+ if token[0] == "sep" and token[1] == ';':
+ token = self.token()
+
+ return token
+
#
# Parse a C definition block, used for structs or unions it parse till
# the balancing }
@@ -1617,6 +1635,18 @@ class CParser:
token = ("name", "virenumimpl")
return token
+ elif token[0] == "name" and token[1] == "VIR_LOG_INIT":
+ token = self.token()
+ if token is not None and token[0] == "sep" and token[1] ==
"(":
+ token = self.token()
+ token = self.parseVirLogInit(token)
+ else:
+ self.error("parsing VIR_LOG_INIT: expecting '('",
token)
+ if token is not None:
+ self.lexer.push(token)
+ token = ("name", "virloginit")
+ return token
+
elif token[0] == "name":
if self.type == "":
self.type = token[1]
diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdriverpolkit.c
index d9ebc49..70db860 100644
--- a/src/access/viraccessdriverpolkit.c
+++ b/src/access/viraccessdriverpolkit.c
@@ -29,6 +29,9 @@
#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_ACCESS
+
+VIR_LOG_INIT("access.accessdriverpolkit");
+
#define virAccessError(code, ...) \
virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c
index 16e3853..c042ccf 100644
--- a/src/access/viraccessmanager.c
+++ b/src/access/viraccessmanager.c
@@ -33,6 +33,9 @@
#include "virlog.h"
#define VIR_FROM_THIS VIR_FROM_ACCESS
+
+VIR_LOG_INIT("access.accessmanager");
+
#define virAccessError(code, ...) \
virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 1fcc0f2..c4d67c1 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -39,6 +39,8 @@
#define VIR_FROM_THIS VIR_FROM_BHYVE
+VIR_LOG_INIT("bhyve.bhyve_command");
+
static char*
virBhyveTapGetRealDeviceName(char *name)
{
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 9dbb299..bf5ade3 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -56,6 +56,8 @@
#define VIR_FROM_THIS VIR_FROM_BHYVE
+VIR_LOG_INIT("bhyve.bhyve_driver");
+
bhyveConnPtr bhyve_driver = NULL;
void
diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index ee85680..f5433f3 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -44,6 +44,8 @@
#define VIR_FROM_THIS VIR_FROM_BHYVE
+VIR_LOG_INIT("bhyve.bhyve_process");
+
int
virBhyveProcessStart(virConnectPtr conn,
bhyveConnPtr driver,
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index b6564c2..69632b0 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -33,6 +33,8 @@
#include "viralloc.h"
#include "virstring.h"
+VIR_LOG_INIT("conf.domain_audit");
+
/* Return nn:mm in hex for block and character devices, and NULL
* for other file types, stat failure, or allocation failure. */
#if defined major && defined minor
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e1b0115..85ee716 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -56,6 +56,8 @@
#define VIR_FROM_THIS VIR_FROM_DOMAIN
+VIR_LOG_INIT("conf.domain_conf");
+
/* virDomainVirtType is used to set bits in the expectedVirtTypes bitmask,
* verify that it doesn't overflow an unsigned int when shifting */
verify(VIR_DOMAIN_VIRT_LAST <= 32);
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index 9c18922..ee49e82 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
@@ -35,6 +35,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.domain_event");
static virClassPtr virDomainEventClass;
static virClassPtr virDomainEventLifecycleClass;
diff --git a/src/conf/network_event.c b/src/conf/network_event.c
index f2cfefe..298cfcb 100644
--- a/src/conf/network_event.c
+++ b/src/conf/network_event.c
@@ -29,6 +29,8 @@
#include "datatypes.h"
#include "virlog.h"
+VIR_LOG_INIT("conf.network_event");
+
struct _virNetworkEvent {
virObjectEvent parent;
diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c
index 2379aa7..fa37ede 100644
--- a/src/conf/nwfilter_params.c
+++ b/src/conf/nwfilter_params.c
@@ -35,6 +35,8 @@
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("conf.nwfilter_params");
+
static bool isValidVarValue(const char *value);
static void virNWFilterVarAccessSetIntIterId(virNWFilterVarAccessPtr,
unsigned int);
diff --git a/src/conf/object_event.c b/src/conf/object_event.c
index 5ceca8a..697c85f 100644
--- a/src/conf/object_event.c
+++ b/src/conf/object_event.c
@@ -36,6 +36,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("conf.object_event");
+
struct _virObjectEventCallbackList {
unsigned int nextID;
size_t count;
diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index c3252d1..0f4ea97 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -34,6 +34,8 @@
#define VIR_FROM_THIS VIR_FROM_SECRET
+VIR_LOG_INIT("conf.secret_conf");
+
VIR_ENUM_IMPL(virSecretUsageType, VIR_SECRET_USAGE_TYPE_LAST,
"none", "volume", "ceph", "iscsi")
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 12b0930..b1f01f1 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -50,6 +50,8 @@
#define VIR_FROM_THIS VIR_FROM_DOMAIN_SNAPSHOT
+VIR_LOG_INIT("conf.snapshot_conf");
+
VIR_ENUM_IMPL(virDomainSnapshotLocation, VIR_DOMAIN_SNAPSHOT_LOCATION_LAST,
"default",
"no",
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index ac323d0..cd2aaea 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -44,7 +44,6 @@
#include "viralloc.h"
#include "virfile.h"
#include "virstring.h"
-#include "virlog.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c
index 3e6beaa..d23254b 100644
--- a/src/conf/virchrdev.c
+++ b/src/conf/virchrdev.c
@@ -41,6 +41,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("conf.chrdev");
+
/* structure holding information about character devices
* open in a given domain */
struct _virChrdevs {
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index 677bb08..1994383 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -40,6 +40,8 @@
#define NR_DRIVERS ARRAY_CARDINALITY(drivers)
#define VIR_FROM_THIS VIR_FROM_CPU
+VIR_LOG_INIT("cpu.cpu");
+
static struct cpuArchDriver *drivers[] = {
&cpuDriverX86,
&cpuDriverPowerPC,
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 77ffa52..36f4f25 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -36,6 +36,8 @@
#define VIR_FROM_THIS VIR_FROM_CPU
+VIR_LOG_INIT("cpu.cpu_powerpc");
+
static const virArch archs[] = { VIR_ARCH_PPC64 };
struct ppc_vendor {
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 56080ef..423bcc1 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -36,6 +36,8 @@
#define VIR_FROM_THIS VIR_FROM_CPU
+VIR_LOG_INIT("cpu.cpu_x86");
+
#define VENDOR_STRING_LENGTH 12
static const virCPUx86CPUID cpuidNull = { 0, 0, 0, 0, 0 };
diff --git a/src/datatypes.c b/src/datatypes.c
index 33d941d..4867b4a 100644
--- a/src/datatypes.c
+++ b/src/datatypes.c
@@ -31,6 +31,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("datatypes");
+
virClassPtr virConnectClass;
virClassPtr virConnectCloseCallbackDataClass;
virClassPtr virDomainClass;
diff --git a/src/driver.c b/src/driver.c
index ab2a253..91ed250 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -31,6 +31,8 @@
#include "configmake.h"
#include "virstring.h"
+VIR_LOG_INIT("driver");
+
#define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver"
#ifdef WITH_DRIVER_MODULES
diff --git a/src/esx/esx_device_monitor.c b/src/esx/esx_device_monitor.c
index 7dc0618..c0d5047 100644
--- a/src/esx/esx_device_monitor.c
+++ b/src/esx/esx_device_monitor.c
@@ -26,7 +26,6 @@
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "esx_private.h"
#include "esx_device_monitor.h"
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 886d984..e205ace 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -50,6 +50,8 @@
#define VIR_FROM_THIS VIR_FROM_ESX
+VIR_LOG_INIT("esx.esx_driver");
+
static int esxDomainGetMaxVcpus(virDomainPtr domain);
typedef struct _esxVMX_Data esxVMX_Data;
diff --git a/src/esx/esx_interface_driver.c b/src/esx/esx_interface_driver.c
index dcb9f03..656ac8b 100644
--- a/src/esx/esx_interface_driver.c
+++ b/src/esx/esx_interface_driver.c
@@ -1,4 +1,3 @@
-
/*
* esx_interface_driver.c: interface driver functions for managing VMware ESX
* host interfaces
@@ -26,7 +25,6 @@
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "interface_conf.h"
#include "virsocketaddr.h"
diff --git a/src/esx/esx_network_driver.c b/src/esx/esx_network_driver.c
index c8b53b1..877a3c1 100644
--- a/src/esx/esx_network_driver.c
+++ b/src/esx/esx_network_driver.c
@@ -1,4 +1,3 @@
-
/*
* esx_network_driver.c: network driver functions for managing VMware ESX
* host networks
@@ -27,7 +26,6 @@
#include "md5.h"
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "network_conf.h"
#include "esx_private.h"
diff --git a/src/esx/esx_nwfilter_driver.c b/src/esx/esx_nwfilter_driver.c
index 3b932de..3cf70d0 100644
--- a/src/esx/esx_nwfilter_driver.c
+++ b/src/esx/esx_nwfilter_driver.c
@@ -1,4 +1,3 @@
-
/*
* esx_nwfilter_driver.c: nwfilter driver functions for managing VMware ESX
* firewall rules
@@ -26,7 +25,6 @@
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "esx_private.h"
#include "esx_nwfilter_driver.h"
diff --git a/src/esx/esx_secret_driver.c b/src/esx/esx_secret_driver.c
index 5607a2e..558cf07 100644
--- a/src/esx/esx_secret_driver.c
+++ b/src/esx/esx_secret_driver.c
@@ -1,4 +1,3 @@
-
/*
* esx_secret_driver.c: secret driver functions for VMware ESX secret manipulation
*
@@ -25,7 +24,6 @@
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "esx_private.h"
#include "esx_secret_driver.h"
diff --git a/src/esx/esx_storage_backend_iscsi.c b/src/esx/esx_storage_backend_iscsi.c
index 66b91d1..e8f88ba 100644
--- a/src/esx/esx_storage_backend_iscsi.c
+++ b/src/esx/esx_storage_backend_iscsi.c
@@ -1,4 +1,3 @@
-
/*
* esx_storage_backend_iscsi.c: ESX storage backend for iSCSI handling
*
@@ -29,7 +28,6 @@
#include "internal.h"
#include "md5.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "storage_conf.h"
#include "virstoragefile.h"
diff --git a/src/esx/esx_storage_backend_vmfs.c b/src/esx/esx_storage_backend_vmfs.c
index f4a5d50..c199159 100644
--- a/src/esx/esx_storage_backend_vmfs.c
+++ b/src/esx/esx_storage_backend_vmfs.c
@@ -46,6 +46,8 @@
#define VIR_FROM_THIS VIR_FROM_ESX
+VIR_LOG_INIT("esx.esx_storage_backend_vmfs");
+
/*
* The UUID of a storage pool is the MD5 sum of it's mount path. Therefore,
* verify that UUID and MD5 sum match in size, because we rely on that.
diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c
index 39b7c0e..2a65130 100644
--- a/src/esx/esx_util.c
+++ b/src/esx/esx_util.c
@@ -38,7 +38,7 @@
#define VIR_FROM_THIS VIR_FROM_ESX
-
+VIR_LOG_INIT("esx.esx_util");
int
esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 777ce30..0bd073b 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -39,7 +39,7 @@
#define VIR_FROM_THIS VIR_FROM_ESX
-
+VIR_LOG_INIT("esx.esx_vi");
#define ESX_VI__SOAP__RESPONSE_XPATH(_type) \
((char *)"/soapenv:Envelope/soapenv:Body/"
\
diff --git a/src/esx/esx_vi_methods.c b/src/esx/esx_vi_methods.c
index 519daf6..bb2aa01 100644
--- a/src/esx/esx_vi_methods.c
+++ b/src/esx/esx_vi_methods.c
@@ -25,7 +25,6 @@
#include "virbuffer.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "esx_vi_methods.h"
#include "esx_util.h"
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index 2d6f8db..a385115 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -37,7 +37,7 @@
#define VIR_FROM_THIS VIR_FROM_ESX
-
+VIR_LOG_INIT("esx.esx_vi_types");
#define ESX_VI__TEMPLATE__ALLOC(__type) \
int \
diff --git a/src/fdstream.c b/src/fdstream.c
index 04d62b8..8813f6f 100644
--- a/src/fdstream.c
+++ b/src/fdstream.c
@@ -44,6 +44,8 @@
#define VIR_FROM_THIS VIR_FROM_STREAMS
+VIR_LOG_INIT("fdstream");
+
/* Tunnelled migration stream support */
struct virFDStreamData {
int fd;
diff --git a/src/hyperv/hyperv_device_monitor.c b/src/hyperv/hyperv_device_monitor.c
index 83ea72a..5332eb2 100644
--- a/src/hyperv/hyperv_device_monitor.c
+++ b/src/hyperv/hyperv_device_monitor.c
@@ -1,4 +1,3 @@
-
/*
* hyperv_device_monitor.c: device monitor functions for managing
* Microsoft Hyper-V host devices
@@ -27,7 +26,6 @@
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_device_monitor.h"
diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 6680e66..7a80885 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -1,4 +1,3 @@
-
/*
* hyperv_driver.c: core driver functions for managing Microsoft Hyper-V hosts
*
@@ -45,7 +44,7 @@
#define VIR_FROM_THIS VIR_FROM_HYPERV
-
+VIR_LOG_INIT("hyperv.hyperv_driver");
static void
hypervFreePrivate(hypervPrivate **priv)
diff --git a/src/hyperv/hyperv_interface_driver.c b/src/hyperv/hyperv_interface_driver.c
index 62123a4..b93cf30 100644
--- a/src/hyperv/hyperv_interface_driver.c
+++ b/src/hyperv/hyperv_interface_driver.c
@@ -1,4 +1,3 @@
-
/*
* hyperv_interface_driver.c: interface driver functions for managing
* Microsoft Hyper-V host interfaces
@@ -27,7 +26,6 @@
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_interface_driver.h"
diff --git a/src/hyperv/hyperv_network_driver.c b/src/hyperv/hyperv_network_driver.c
index e23f53a..6f54f44 100644
--- a/src/hyperv/hyperv_network_driver.c
+++ b/src/hyperv/hyperv_network_driver.c
@@ -1,4 +1,3 @@
-
/*
* hyperv_network_driver.c: network driver functions for managing
* Microsoft Hyper-V host networks
@@ -27,7 +26,6 @@
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_network_driver.h"
diff --git a/src/hyperv/hyperv_nwfilter_driver.c b/src/hyperv/hyperv_nwfilter_driver.c
index 0343238..a82db92 100644
--- a/src/hyperv/hyperv_nwfilter_driver.c
+++ b/src/hyperv/hyperv_nwfilter_driver.c
@@ -1,4 +1,3 @@
-
/*
* hyperv_nwfilter_driver.c: nwfilter driver functions for managing
* Microsoft Hyper-V firewall rules
@@ -27,7 +26,6 @@
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_nwfilter_driver.h"
diff --git a/src/hyperv/hyperv_secret_driver.c b/src/hyperv/hyperv_secret_driver.c
index 3f9f8f5..8176484 100644
--- a/src/hyperv/hyperv_secret_driver.c
+++ b/src/hyperv/hyperv_secret_driver.c
@@ -1,4 +1,3 @@
-
/*
* hyperv_secret_driver.c: secret driver functions for Microsoft Hyper-V
* secret manipulation
@@ -27,7 +26,6 @@
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_secret_driver.h"
diff --git a/src/hyperv/hyperv_storage_driver.c b/src/hyperv/hyperv_storage_driver.c
index 5acc4d8..af3cca4 100644
--- a/src/hyperv/hyperv_storage_driver.c
+++ b/src/hyperv/hyperv_storage_driver.c
@@ -1,4 +1,3 @@
-
/*
* hyperv_storage_driver.c: storage driver functions for managing
* Microsoft Hyper-V host storage
@@ -27,7 +26,6 @@
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_storage_driver.h"
diff --git a/src/hyperv/hyperv_util.c b/src/hyperv/hyperv_util.c
index e14c634..002aabb 100644
--- a/src/hyperv/hyperv_util.c
+++ b/src/hyperv/hyperv_util.c
@@ -33,7 +33,7 @@
#define VIR_FROM_THIS VIR_FROM_HYPERV
-
+VIR_LOG_INIT("hyperv.hyperv_util");
int
hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri)
diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index 39eed0c..09139f3 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -1,4 +1,3 @@
-
/*
* hyperv_wmi.h: general WMI over WSMAN related functions and structures for
* managing Microsoft Hyper-V hosts
@@ -27,7 +26,6 @@
#include "internal.h"
#include "virerror.h"
#include "datatypes.h"
-#include "virlog.h"
#include "viralloc.h"
#include "viruuid.h"
#include "virbuffer.h"
diff --git a/src/interface/interface_backend_netcf.c
b/src/interface/interface_backend_netcf.c
index c525ca9..910592b 100644
--- a/src/interface/interface_backend_netcf.c
+++ b/src/interface/interface_backend_netcf.c
@@ -36,6 +36,8 @@
#define VIR_FROM_THIS VIR_FROM_INTERFACE
+VIR_LOG_INIT("interface.interface_backend_netcf");
+
#define INTERFACE_DRIVER_NAME "netcf"
/* Main driver state */
diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c
index abfb93f..f31b556 100644
--- a/src/libvirt-lxc.c
+++ b/src/libvirt-lxc.c
@@ -39,6 +39,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("libvirt-lxc");
+
/**
* virDomainLxcOpenNamespace:
* @domain: a domain object
diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c
index 617ad05..2f66e2d 100644
--- a/src/libvirt-qemu.c
+++ b/src/libvirt-qemu.c
@@ -30,6 +30,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("libvirt-qemu");
+
/**
* virDomainQemuMonitorCommand:
* @domain: a domain object
diff --git a/src/libvirt.c b/src/libvirt.c
index a385935..cb41921 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -102,6 +102,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("libvirt");
+
/*
* TODO:
* - use lock to protect against concurrent accesses ?
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 993f76a..80070c5 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1442,7 +1442,6 @@ virLogParseOutputs;
virLogPriorityFromSyslog;
virLogProbablyLogMessage;
virLogReset;
-virLogSelf;
virLogSetBufferSize;
virLogSetDefaultPriority;
virLogSetFromEnv;
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index ade0a08..8e478d2 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -48,6 +48,8 @@
#define VIR_FROM_THIS VIR_FROM_LIBXL
+VIR_LOG_INIT("libxl.libxl_conf");
+
/* see xen-unstable.hg/xen/include/asm-x86/cpufeature.h */
#define LIBXL_X86_FEATURE_PAE_MASK 0x40
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index fdc4661..4544d91 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -34,6 +34,7 @@
#define VIR_FROM_THIS VIR_FROM_LIBXL
+VIR_LOG_INIT("libxl.libxl_domain");
VIR_ENUM_IMPL(libxlDomainJob, LIBXL_JOB_LAST,
"none",
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index a79efcb..aa840dc 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -55,6 +55,8 @@
#define VIR_FROM_THIS VIR_FROM_LIBXL
+VIR_LOG_INIT("libxl.libxl_driver");
+
#define LIBXL_DOM_REQ_POWEROFF 0
#define LIBXL_DOM_REQ_REBOOT 1
#define LIBXL_DOM_REQ_SUSPEND 2
diff --git a/src/locking/domain_lock.c b/src/locking/domain_lock.c
index 5e02400..643a875 100644
--- a/src/locking/domain_lock.c
+++ b/src/locking/domain_lock.c
@@ -29,6 +29,8 @@
#define VIR_FROM_THIS VIR_FROM_LOCKING
+VIR_LOG_INIT("locking.domain_lock");
+
static int virDomainLockManagerAddLease(virLockManagerPtr lock,
virDomainLeaseDefPtr lease)
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index e047751..46b2dd3 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -54,6 +54,8 @@
#define VIR_FROM_THIS VIR_FROM_LOCKING
+VIR_LOG_INIT("locking.lock_daemon");
+
#define VIR_LOCK_DAEMON_NUM_LOCKSPACES 3
struct _virLockDaemon {
diff --git a/src/locking/lock_daemon_config.c b/src/locking/lock_daemon_config.c
index 8e632f5..f27bdf9 100644
--- a/src/locking/lock_daemon_config.c
+++ b/src/locking/lock_daemon_config.c
@@ -35,6 +35,8 @@
#define VIR_FROM_THIS VIR_FROM_CONF
+VIR_LOG_INIT("locking.lock_daemon_config");
+
/* A helper function used by each of the following macros. */
static int
diff --git a/src/locking/lock_daemon_dispatch.c b/src/locking/lock_daemon_dispatch.c
index c2e1000..a26e2cc 100644
--- a/src/locking/lock_daemon_dispatch.c
+++ b/src/locking/lock_daemon_dispatch.c
@@ -28,11 +28,14 @@
#include "virstring.h"
#include "lock_daemon.h"
#include "lock_protocol.h"
-#include "lock_daemon_dispatch_stubs.h"
#include "virerror.h"
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("locking.lock_daemon_dispatch");
+
+#include "lock_daemon_dispatch_stubs.h"
+
static int
virLockSpaceProtocolDispatchAcquireResource(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,
diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c
index f3b9467..1f99275 100644
--- a/src/locking/lock_driver_lockd.c
+++ b/src/locking/lock_driver_lockd.c
@@ -36,6 +36,8 @@
#define VIR_FROM_THIS VIR_FROM_LOCKING
+VIR_LOG_INIT("locking.lock_driver_lockd");
+
#define virLockError(code, ...) \
virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
diff --git a/src/locking/lock_driver_nop.c b/src/locking/lock_driver_nop.c
index e8e9917..93a988e 100644
--- a/src/locking/lock_driver_nop.c
+++ b/src/locking/lock_driver_nop.c
@@ -26,6 +26,8 @@
#include "virlog.h"
#include "viruuid.h"
+VIR_LOG_INIT("locking.lock_driver_nop");
+
static int virLockManagerNopInit(unsigned int version ATTRIBUTE_UNUSED,
const char *configFile ATTRIBUTE_UNUSED,
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index f11f3c6..dba855f 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -49,6 +49,8 @@
#define VIR_FROM_THIS VIR_FROM_LOCKING
+VIR_LOG_INIT("locking.lock_driver_sanlock");
+
#define VIR_LOCK_MANAGER_SANLOCK_AUTO_DISK_LOCKSPACE "__LIBVIRT__DISKS__"
#define VIR_LOCK_MANAGER_SANLOCK_KILLPATH LIBEXECDIR "/libvirt_sanlock_helper"
diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c
index f09c168..54552b8 100644
--- a/src/locking/lock_manager.c
+++ b/src/locking/lock_manager.c
@@ -39,6 +39,8 @@
#define VIR_FROM_THIS VIR_FROM_LOCKING
+VIR_LOG_INIT("locking.lock_manager");
+
#define CHECK_DRIVER(field, errret) \
if (!driver->field) { \
virReportError(VIR_ERR_INTERNAL_ERROR, \
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index 39d955c..5a1718d 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -32,6 +32,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_cgroup");
+
static int virLXCCgroupSetupCpuTune(virDomainDefPtr def,
virCgroupPtr cgroup)
{
diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
index 557191a..d4432cf 100644
--- a/src/lxc/lxc_conf.c
+++ b/src/lxc/lxc_conf.c
@@ -41,6 +41,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_conf");
+
static virClassPtr virLXCDriverConfigClass;
static void virLXCDriverConfigDispose(void *obj);
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index e034051..b6c788a 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -71,6 +71,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_container");
+
/*
* GLibc headers are behind the kernel, so we define these
* constants if they're not present already.
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 5ca960f..bc83db1 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -70,6 +70,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_controller");
+
typedef struct _virLXCControllerConsole virLXCControllerConsole;
typedef virLXCControllerConsole *virLXCControllerConsolePtr;
struct _virLXCControllerConsole {
diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c
index 83c5a4e..74b7df6 100644
--- a/src/lxc/lxc_domain.c
+++ b/src/lxc/lxc_domain.c
@@ -29,6 +29,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_domain");
+
static void *virLXCDomainObjPrivateAlloc(void)
{
virLXCDomainObjPrivatePtr priv;
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 10e0fbb..902cdbf 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -74,6 +74,7 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_driver");
#define LXC_NB_MEM_PARAM 3
#define LXC_NB_DOMAIN_BLOCK_STAT_PARAM 4
diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
index d3d8f85..81706c8 100644
--- a/src/lxc/lxc_fuse.c
+++ b/src/lxc/lxc_fuse.c
@@ -32,7 +32,6 @@
#include "lxc_fuse.h"
#include "lxc_cgroup.h"
#include "virerror.h"
-#include "virlog.h"
#include "virfile.h"
#include "virbuffer.h"
#include "virstring.h"
diff --git a/src/lxc/lxc_hostdev.c b/src/lxc/lxc_hostdev.c
index b7248df..bc319d0 100644
--- a/src/lxc/lxc_hostdev.c
+++ b/src/lxc/lxc_hostdev.c
@@ -30,6 +30,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_hostdev");
+
int
virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver,
virDomainDefPtr def)
diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c
index 07e9301..e9447ce 100644
--- a/src/lxc/lxc_monitor.c
+++ b/src/lxc/lxc_monitor.c
@@ -34,6 +34,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_monitor");
+
struct _virLXCMonitor {
virObjectLockable parent;
diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 663e29c..fa0e62e 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -34,6 +34,7 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_native");
static virDomainFSDefPtr
lxcCreateFSDef(int type,
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index fcdcb2d..2f4121c 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -54,6 +54,8 @@
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_process");
+
#define START_POSTFIX ": starting up\n"
static virDomainObjPtr
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index c797f8f..a1af7d9 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -75,6 +75,8 @@
#define VIR_FROM_THIS VIR_FROM_NETWORK
+VIR_LOG_INIT("network.bridge_driver");
+
static void networkDriverLock(virNetworkDriverStatePtr driver)
{
virMutexLock(&driver->lock);
diff --git a/src/network/bridge_driver_linux.c b/src/network/bridge_driver_linux.c
index a2f0248..9305bca 100644
--- a/src/network/bridge_driver_linux.c
+++ b/src/network/bridge_driver_linux.c
@@ -27,9 +27,12 @@
#include "virfile.h"
#include "viriptables.h"
#include "virstring.h"
+#include "virlog.h"
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("network.bridge_driver_linux");
+
#define PROC_NET_ROUTE "/proc/net/route"
/* XXX: This function can be a lot more exhaustive, there are certainly
diff --git a/src/network/bridge_driver_platform.h b/src/network/bridge_driver_platform.h
index 82d96f6..b44d8b6 100644
--- a/src/network/bridge_driver_platform.h
+++ b/src/network/bridge_driver_platform.h
@@ -25,7 +25,6 @@
# define __VIR_BRIDGE_DRIVER_PLATFORM_H__
# include "internal.h"
-# include "virlog.h"
# include "virthread.h"
# include "virdnsmasq.h"
# include "network_conf.h"
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index d5a92cd..4fe97a8 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -33,7 +33,6 @@
#include "datatypes.h"
#include "viralloc.h"
#include "virfile.h"
-#include "virlog.h"
#include "virstring.h"
#include "node_device_conf.h"
#include "node_device_hal.h"
@@ -43,7 +42,6 @@
#define VIR_FROM_THIS VIR_FROM_NODEDEV
-
static int update_caps(virNodeDeviceObjPtr dev)
{
virNodeDevCapsDefPtr cap = dev->def->caps;
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index fafd520..1ca315b 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -43,6 +43,8 @@
#define VIR_FROM_THIS VIR_FROM_NODEDEV
+VIR_LOG_INIT("node_device.node_device_hal");
+
/*
* Host device enumeration (HAL implementation)
*/
diff --git a/src/node_device/node_device_linux_sysfs.c
b/src/node_device/node_device_linux_sysfs.c
index d68c3bd..9233be5 100644
--- a/src/node_device/node_device_linux_sysfs.c
+++ b/src/node_device/node_device_linux_sysfs.c
@@ -38,6 +38,8 @@
#ifdef __linux__
+VIR_LOG_INIT("node_device.node_device_linux_sysfs");
+
int
detect_scsi_host_caps(union _virNodeDevCapData *d)
{
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 5c48fe8..ddd54e0 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -43,6 +43,8 @@
#define VIR_FROM_THIS VIR_FROM_NODEDEV
+VIR_LOG_INIT("node_device.node_device_udev");
+
#ifndef TYPE_RAID
# define TYPE_RAID 12
#endif
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 916cb47..6d33f64 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -44,7 +44,6 @@
#include "viralloc.h"
#include "nodeinfopriv.h"
#include "physmem.h"
-#include "virlog.h"
#include "virerror.h"
#include "count-one-bits.h"
#include "intprops.h"
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 9e31afb..d2a8062 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -72,6 +72,8 @@
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("nwfilter.nwfilter_dhcpsnoop");
+
#ifdef HAVE_LIBPCAP
# define LEASEFILE_DIR LOCALSTATEDIR "/run/libvirt/network/"
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index 2e89d07..3925dcd 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -50,6 +50,8 @@
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("nwfilter.nwfilter_driver");
+
#define DBUS_RULE_FWD_NAMEOWNERCHANGED \
"type='signal'" \
",interface='"DBUS_INTERFACE_DBUS"'" \
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c
b/src/nwfilter/nwfilter_ebiptables_driver.c
index 9d6cc90..6ed20ef 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -48,6 +48,8 @@
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("nwfilter.nwfilter_ebiptables_driver");
+
#define EBTABLES_CHAIN_INCOMING "PREROUTING"
#define EBTABLES_CHAIN_OUTGOING "POSTROUTING"
diff --git a/src/nwfilter/nwfilter_gentech_driver.c
b/src/nwfilter/nwfilter_gentech_driver.c
index e576dc4..bf96d6b 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -41,6 +41,7 @@
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("nwfilter.nwfilter_gentech_driver");
#define NWFILTER_STD_VAR_MAC NWFILTER_VARNAME_MAC
#define NWFILTER_STD_VAR_IP NWFILTER_VARNAME_IP
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index e071ff4..e156a93 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -58,6 +58,8 @@
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("nwfilter.nwfilter_learnipaddr");
+
#define IFINDEX2STR(VARNAME, ifindex) \
char VARNAME[INT_BUFSIZE_BOUND(ifindex)]; \
snprintf(VARNAME, sizeof(VARNAME), "%d", ifindex);
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 393f397..7efaa30 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -61,6 +61,8 @@
#define VIR_FROM_THIS VIR_FROM_OPENVZ
+VIR_LOG_INIT("openvz.openvz_driver");
+
#define OPENVZ_MAX_ARG 28
#define CMDBUF_LEN 1488
#define CMDOP_LEN 288
diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index 2cba3ca..626a1e2 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -56,6 +56,8 @@
#define VIR_FROM_THIS VIR_FROM_PARALLELS
+VIR_LOG_INIT("parallels.parallels_driver");
+
#define PRLCTL "prlctl"
#define PRLSRVCTL "prlsrvctl"
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index e819256..d97b39f 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -61,6 +61,9 @@
#define VIR_FROM_THIS VIR_FROM_PHYP
+VIR_LOG_INIT("phyp.phyp_driver");
+
+
/*
* URI: phyp://user@[hmc|ivm]/managed_system
* */
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 4a3820c..018566b 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -45,6 +45,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_agent");
+
#define LINE_ENDING "\n"
#define DEBUG_IO 0
diff --git a/src/qemu/qemu_bridge_filter.c b/src/qemu/qemu_bridge_filter.c
index 49954c6..e8c6d9a 100644
--- a/src/qemu/qemu_bridge_filter.c
+++ b/src/qemu/qemu_bridge_filter.c
@@ -26,7 +26,6 @@
#include "qemu_conf.h"
#include "qemu_driver.h"
#include "virerror.h"
-#include "virlog.h"
#include "qemu_bridge_filter.h"
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 6811d2e..6009dc7 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -47,6 +47,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_capabilities");
+
/* While not public, these strings must not change. They
* are used in domain status files which are read on
* daemon restarts
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index a97f184..da8cdbf 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -37,6 +37,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_cgroup");
+
static const char *const defaultDeviceACL[] = {
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 775e139..6bb9ee7 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -60,6 +60,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_command");
+
#define VIO_ADDR_NET 0x1000ul
#define VIO_ADDR_SCSI 0x2000ul
#define VIO_ADDR_SERIAL 0x30000000ul
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 20fd62d..8c68db2 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -57,6 +57,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_conf");
+
static virClassPtr virQEMUDriverConfigClass;
static void virQEMUDriverConfigDispose(void *obj);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bad63c5..80be1a0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -46,6 +46,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_domain");
+
#define QEMU_NAMESPACE_HREF "http://libvirt.org/schemas/domain/qemu/1.0"
VIR_ENUM_IMPL(qemuDomainJob, QEMU_JOB_LAST,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8a54b8a..24af61d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -98,6 +98,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_driver");
+
#define QEMU_NB_MEM_PARAM 3
#define QEMU_NB_BLOCK_IO_TUNE_PARAM 6
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index e4f6b1b..094e599 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -40,6 +40,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_hostdev");
+
static virPCIDeviceListPtr
qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
{
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 6703c92..52620fd 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -52,6 +52,9 @@
#include "virtime.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
+
+VIR_LOG_INIT("qemu.qemu_hotplug");
+
#define CHANGE_MEDIA_RETRIES 10
/* Wait up to 5 seconds for device removal to finish. */
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 54c6fec..5468db0 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -60,6 +60,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_migration");
+
VIR_ENUM_IMPL(qemuMigrationJobPhase, QEMU_MIGRATION_PHASE_LAST,
"none",
"perform2",
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 8f8f5c3..72bacc3 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -49,6 +49,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_monitor");
+
#define DEBUG_IO 0
#define DEBUG_RAW_IO 0
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 4da2011..94e6365 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -51,6 +51,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_monitor_json");
+
#define QOM_CPU_PATH "/machine/unattached/device[0]"
#define LINE_ENDING "\r\n"
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 6610ba4..efb3654 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -49,6 +49,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_monitor_text");
+
#define QEMU_CMD_PROMPT "\n(qemu) "
#define QEMU_PASSWD_PROMPT "Password: "
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ffa939a..92f4ce4 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -69,6 +69,8 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_process");
+
#define START_POSTFIX ": starting up\n"
#define ATTACH_POSTFIX ": attaching\n"
#define SHUTDOWN_POSTFIX ": shutting down\n"
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 955465a..92c649b 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -52,6 +52,8 @@
#define VIR_FROM_THIS VIR_FROM_REMOTE
+VIR_LOG_INIT("remote.remote_driver");
+
#if SIZEOF_LONG < 8
# define HYPER_TO_TYPE(_type, _to, _from) \
do { \
diff --git a/src/rpc/virkeepalive.c b/src/rpc/virkeepalive.c
index fcc43ad..f5c48b7 100644
--- a/src/rpc/virkeepalive.c
+++ b/src/rpc/virkeepalive.c
@@ -34,6 +34,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.keepalive");
+
struct _virKeepAlive {
virObjectLockable parent;
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 6caae61..f95a101 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -41,6 +41,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netclient");
+
typedef struct _virNetClientCall virNetClientCall;
typedef virNetClientCall *virNetClientCallPtr;
diff --git a/src/rpc/virnetclientprogram.c b/src/rpc/virnetclientprogram.c
index cbd628a..3ff27d3 100644
--- a/src/rpc/virnetclientprogram.c
+++ b/src/rpc/virnetclientprogram.c
@@ -37,6 +37,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netclientprogram");
+
struct _virNetClientProgram {
virObject object;
diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c
index b785392..521bdda 100644
--- a/src/rpc/virnetclientstream.c
+++ b/src/rpc/virnetclientstream.c
@@ -31,6 +31,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netclientstream");
+
struct _virNetClientStream {
virObjectLockable parent;
diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c
index af07404..4e8e17d 100644
--- a/src/rpc/virnetmessage.c
+++ b/src/rpc/virnetmessage.c
@@ -33,6 +33,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netmessage");
+
virNetMessagePtr virNetMessageNew(bool tracked)
{
virNetMessagePtr msg;
diff --git a/src/rpc/virnetsaslcontext.c b/src/rpc/virnetsaslcontext.c
index dbb9a25..abf3334 100644
--- a/src/rpc/virnetsaslcontext.c
+++ b/src/rpc/virnetsaslcontext.c
@@ -33,6 +33,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netsaslcontext");
+
struct _virNetSASLContext {
virObjectLockable parent;
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index bcabfcd..198d6a2 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -46,6 +46,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netserver");
+
typedef struct _virNetServerSignal virNetServerSignal;
typedef virNetServerSignal *virNetServerSignalPtr;
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 7b6d82d..495b0b3 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -41,6 +41,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netserverclient");
+
/* Allow for filtering of incoming messages to a custom
* dispatch processing queue, instead of the workers.
* This allows for certain types of messages to be handled
diff --git a/src/rpc/virnetservermdns.c b/src/rpc/virnetservermdns.c
index 85ae100..1319680 100644
--- a/src/rpc/virnetservermdns.c
+++ b/src/rpc/virnetservermdns.c
@@ -49,6 +49,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netservermdns");
+
struct _virNetServerMDNSEntry {
char *type;
int port;
diff --git a/src/rpc/virnetserverprogram.c b/src/rpc/virnetserverprogram.c
index 93a3fb1..8aea9f0 100644
--- a/src/rpc/virnetserverprogram.c
+++ b/src/rpc/virnetserverprogram.c
@@ -34,6 +34,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netserverprogram");
+
struct _virNetServerProgram {
virObject object;
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index be1df6c..16a2521 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -62,6 +62,7 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netsocket");
struct _virNetSocket {
virObjectLockable parent;
diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
index f544d69..789ba2e 100644
--- a/src/rpc/virnetsshsession.c
+++ b/src/rpc/virnetsshsession.c
@@ -40,6 +40,8 @@
#define VIR_FROM_THIS VIR_FROM_SSH
+VIR_LOG_INIT("rpc.netsshsession");
+
static const char
vir_libssh2_key_comment[] = "added by libvirt ssh transport";
#define VIR_NET_SSH_BUFFER_SIZE 1024
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index 27a00d0..7bf2a2e 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -55,6 +55,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.nettlscontext");
+
struct _virNetTLSContext {
virObjectLockable parent;
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 9f7f946..45aeb5e 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -46,6 +46,8 @@
#define VIR_FROM_THIS VIR_FROM_SECRET
+VIR_LOG_INIT("secret.secret_driver");
+
enum { SECRET_MAX_XML_FILE = 10*1024*1024 };
/* Internal driver state */
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index a74a91c..f7b67ba 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -52,6 +52,9 @@
#include "virscsi.h"
#define VIR_FROM_THIS VIR_FROM_SECURITY
+
+VIR_LOG_INIT("security.security_apparmor");
+
#define SECURITY_APPARMOR_VOID_DOI "0"
#define SECURITY_APPARMOR_NAME "apparmor"
#define VIRT_AA_HELPER LIBEXECDIR "/virt-aa-helper"
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 09b5e57..bf3828e 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -36,6 +36,9 @@
#include "virutil.h"
#define VIR_FROM_THIS VIR_FROM_SECURITY
+
+VIR_LOG_INIT("security.security_dac");
+
#define SECURITY_DAC_NAME "dac"
typedef struct _virSecurityDACData virSecurityDACData;
diff --git a/src/security/security_driver.c b/src/security/security_driver.c
index d8a8283..4800d52 100644
--- a/src/security/security_driver.c
+++ b/src/security/security_driver.c
@@ -39,6 +39,8 @@
#define VIR_FROM_THIS VIR_FROM_SECURITY
+VIR_LOG_INIT("security.security_driver");
+
static virSecurityDriverPtr security_drivers[] = {
#ifdef WITH_SECDRIVER_SELINUX
&virSecurityDriverSELinux,
diff --git a/src/security/security_manager.c b/src/security/security_manager.c
index 5ecf72f..795807a 100644
--- a/src/security/security_manager.c
+++ b/src/security/security_manager.c
@@ -33,6 +33,7 @@
#define VIR_FROM_THIS VIR_FROM_SECURITY
+VIR_LOG_INIT("security.security_manager");
struct _virSecurityManager {
virObjectLockable parent;
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 448f686..02c7496 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -49,6 +49,8 @@
#define VIR_FROM_THIS VIR_FROM_SECURITY
+VIR_LOG_INIT("security.security_selinux");
+
#define MAX_CONTEXT 1024
typedef struct _virSecuritySELinuxData virSecuritySELinuxData;
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index f7b91ac..d14e633 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -86,6 +86,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend");
+
static virStorageBackendPtr backends[] = {
#if WITH_STORAGE_DIR
&virStorageBackendDirectory,
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index b261773..48e4a6c 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -38,6 +38,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_disk");
+
#define PARTHELPER LIBEXECDIR "/libvirt_parthelper"
#define SECTOR_SIZE 512
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index bab02dd..edb7cd0 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -54,6 +54,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_fs");
+
#define VIR_STORAGE_VOL_FS_OPEN_FLAGS (VIR_STORAGE_VOL_OPEN_DEFAULT |\
VIR_STORAGE_VOL_OPEN_DIR)
#define VIR_STORAGE_VOL_FS_REFRESH_FLAGS (VIR_STORAGE_VOL_FS_OPEN_FLAGS &\
diff --git a/src/storage/storage_backend_gluster.c
b/src/storage/storage_backend_gluster.c
index 202a441..a22b23a 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -34,6 +34,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_gluster");
+
struct _virStorageBackendGlusterState {
glfs_t *vol;
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index ada6c48..2628005 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -48,6 +48,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_iscsi");
+
#define ISCSI_DEFAULT_TARGET_PORT 3260
static char *
diff --git a/src/storage/storage_backend_logical.c
b/src/storage/storage_backend_logical.c
index 1ac48e6..667fb06 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -42,6 +42,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_logical");
+
#define PV_BLANK_SECTOR_SIZE 512
diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c
index 5d0ed32..897911e 100644
--- a/src/storage/storage_backend_mpath.c
+++ b/src/storage/storage_backend_mpath.c
@@ -39,6 +39,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_mpath");
+
static int
virStorageBackendMpathUpdateVolTargetInfo(virStorageVolTargetPtr target,
unsigned long long *allocation,
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index bc52474..51d5a9f 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -37,6 +37,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_rbd");
+
struct _virStorageBackendRBDState {
rados_t cluster;
rados_ioctx_t ioctx;
diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index 4397257..572d855 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -38,6 +38,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_scsi");
+
/* Function to check if the type file in the given sysfs_path is a
* Direct-Access device (i.e. type 0). Return -1 on failure, type of
* the device otherwise.
diff --git a/src/storage/storage_backend_sheepdog.c
b/src/storage/storage_backend_sheepdog.c
index 82df274..1673b5e 100644
--- a/src/storage/storage_backend_sheepdog.c
+++ b/src/storage/storage_backend_sheepdog.c
@@ -32,7 +32,6 @@
#include "storage_conf.h"
#include "vircommand.h"
#include "viralloc.h"
-#include "virlog.h"
#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 7dbff6c..f3e18ba 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -52,6 +52,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_driver");
+
static virStorageDriverStatePtr driverState;
static int storageStateCleanup(void);
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 986f215..22a0d54 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -62,6 +62,8 @@
#define VIR_FROM_THIS VIR_FROM_TEST
+VIR_LOG_INIT("test.test_driver");
+
/* Driver specific info to carry with a domain */
struct _testDomainObjPrivate {
virVcpuInfoPtr vcpu_infos;
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 0f2f38e..3567b03 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -50,6 +50,7 @@
#define VIR_FROM_THIS VIR_FROM_UML
+VIR_LOG_INIT("uml.uml_conf");
virCapsPtr umlCapsInit(void) {
virCapsPtr caps;
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 3496e52..eb76fc3 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -69,6 +69,8 @@
#define VIR_FROM_THIS VIR_FROM_UML
+VIR_LOG_INIT("uml.uml_driver");
+
/* For storing short-lived temporary files. */
#define TEMPDIR LOCALSTATEDIR "/cache/libvirt"
diff --git a/src/util/viralloc.c b/src/util/viralloc.c
index 27ed74a..be9f0fe 100644
--- a/src/util/viralloc.c
+++ b/src/util/viralloc.c
@@ -29,6 +29,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.alloc");
+
#if TEST_OOM
static int testMallocNext = 0;
static int testMallocFailFirst = 0;
diff --git a/src/util/virarch.c b/src/util/virarch.c
index c71c7eb..be48bcf 100644
--- a/src/util/virarch.c
+++ b/src/util/virarch.c
@@ -27,6 +27,8 @@
#include "virarch.h"
#include "verify.h"
+VIR_LOG_INIT("util.arch");
+
/* The canonical names are used in XML documents. ie ABI sensitive */
static const struct virArchData {
const char *name;
diff --git a/src/util/viraudit.c b/src/util/viraudit.c
index ac787f8..33ed2f6 100644
--- a/src/util/viraudit.c
+++ b/src/util/viraudit.c
@@ -34,6 +34,8 @@
#include "viralloc.h"
#include "virstring.h"
+VIR_LOG_INIT("util.audit");
+
/* Provide the macros in case the header file is old.
FIXME: should be removed. */
#ifndef AUDIT_VIRT_CONTROL
diff --git a/src/util/virauth.c b/src/util/virauth.c
index e66cbf5..7f94eb6 100644
--- a/src/util/virauth.c
+++ b/src/util/virauth.c
@@ -36,6 +36,8 @@
#define VIR_FROM_THIS VIR_FROM_AUTH
+VIR_LOG_INIT("util.auth");
+
int
virAuthGetConfigFilePathURI(virURIPtr uri,
char **path)
diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c
index 808d1cb..d7fd04a 100644
--- a/src/util/virauthconfig.c
+++ b/src/util/virauthconfig.c
@@ -37,6 +37,7 @@ struct _virAuthConfig {
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.authconfig");
virAuthConfigPtr virAuthConfigNew(const char *path)
{
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 0f04b4d..33619af 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -55,6 +55,8 @@
#include "nodeinfo.h"
+VIR_LOG_INIT("util.cgroup");
+
#define CGROUP_MAX_VAL 512
#define VIR_FROM_THIS VIR_FROM_CGROUP
diff --git a/src/util/virclosecallbacks.c b/src/util/virclosecallbacks.c
index a39be60..ff971c8 100644
--- a/src/util/virclosecallbacks.c
+++ b/src/util/virclosecallbacks.c
@@ -31,6 +31,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.closecallbacks");
+
typedef struct _virDriverCloseDef virDriverCloseDef;
typedef virDriverCloseDef *virDriverCloseDefPtr;
struct _virDriverCloseDef {
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index db4166f..a3bbc78 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -54,6 +54,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.command");
+
/* Flags for virExec */
enum {
VIR_EXEC_NONE = 0,
diff --git a/src/util/virconf.c b/src/util/virconf.c
index 63aa569..b965df7 100644
--- a/src/util/virconf.c
+++ b/src/util/virconf.c
@@ -41,6 +41,8 @@
#define VIR_FROM_THIS VIR_FROM_CONF
+VIR_LOG_INIT("util.conf");
+
/************************************************************************
* *
* Structures and macros used by the mini parser *
diff --git a/src/util/virdbus.c b/src/util/virdbus.c
index 9bddbfc..e3236d8 100644
--- a/src/util/virdbus.c
+++ b/src/util/virdbus.c
@@ -30,6 +30,8 @@
#define VIR_FROM_THIS VIR_FROM_DBUS
+VIR_LOG_INIT("util.dbus");
+
#ifdef WITH_DBUS
static bool sharedBus = true;
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index fa31d69..20dca0f 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -52,6 +52,9 @@
#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_NETWORK
+
+VIR_LOG_INIT("util.dnsmasq");
+
#define DNSMASQ_HOSTSFILE_SUFFIX "hostsfile"
#define DNSMASQ_ADDNHOSTSFILE_SUFFIX "addnhosts"
diff --git a/src/util/virebtables.c b/src/util/virebtables.c
index ce5e813..df94658 100644
--- a/src/util/virebtables.c
+++ b/src/util/virebtables.c
@@ -54,6 +54,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.ebtables");
+
#if HAVE_FIREWALLD
static char *firewall_cmd_path = NULL;
diff --git a/src/util/virerror.c b/src/util/virerror.c
index 4da8bcf..9e05adc 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -35,6 +35,8 @@
#include "virutil.h"
#include "virstring.h"
+VIR_LOG_INIT("util.error");
+
virThreadLocal virLastErr;
virErrorFunc virErrorHandler = NULL; /* global error handler */
diff --git a/src/util/virevent.c b/src/util/virevent.c
index c6dcb26..84d28a4 100644
--- a/src/util/virevent.c
+++ b/src/util/virevent.c
@@ -30,6 +30,8 @@
#include <stdlib.h>
+VIR_LOG_INIT("util.event");
+
static virEventAddHandleFunc addHandleImpl = NULL;
static virEventUpdateHandleFunc updateHandleImpl = NULL;
static virEventRemoveHandleFunc removeHandleImpl = NULL;
diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c
index 6f1e184..ea890de 100644
--- a/src/util/vireventpoll.c
+++ b/src/util/vireventpoll.c
@@ -45,6 +45,8 @@
#define VIR_FROM_THIS VIR_FROM_EVENT
+VIR_LOG_INIT("util.eventpoll");
+
static int virEventPollInterruptLocked(void);
/* State for a single file handle being monitored */
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 6da564b..5fe21d7 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -63,6 +63,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.file");
+
int virFileClose(int *fdptr, virFileCloseFlags flags)
{
int saved_errno = 0;
diff --git a/src/util/virhash.c b/src/util/virhash.c
index 0857805..9ef3554 100644
--- a/src/util/virhash.c
+++ b/src/util/virhash.c
@@ -34,6 +34,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.hash");
+
#define MAX_HASH_LEN 8
/* #define DEBUG_GROW */
diff --git a/src/util/virhook.c b/src/util/virhook.c
index 0f5d0c5..e3ac4d2 100644
--- a/src/util/virhook.c
+++ b/src/util/virhook.c
@@ -41,6 +41,8 @@
#define VIR_FROM_THIS VIR_FROM_HOOK
+VIR_LOG_INIT("util.hook");
+
#define LIBVIRT_HOOK_DIR SYSCONFDIR "/libvirt/hooks"
VIR_ENUM_DECL(virHookDriver)
diff --git a/src/util/viridentity.c b/src/util/viridentity.c
index bd6adcf..351fdd7 100644
--- a/src/util/viridentity.c
+++ b/src/util/viridentity.c
@@ -39,6 +39,7 @@
#define VIR_FROM_THIS VIR_FROM_IDENTITY
+VIR_LOG_INIT("util.identity");
struct _virIdentity {
virObject parent;
diff --git a/src/util/viriptables.c b/src/util/viriptables.c
index 9e03cc4..83793fa 100644
--- a/src/util/viriptables.c
+++ b/src/util/viriptables.c
@@ -50,6 +50,8 @@
#include "virstring.h"
#include "virutil.h"
+VIR_LOG_INIT("util.iptables");
+
bool iptables_supports_xlock = false;
#if HAVE_FIREWALLD
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 02b5f3f..5125ad0 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -45,6 +45,7 @@
/* XXX fixme */
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.json");
typedef struct _virJSONParserState virJSONParserState;
typedef virJSONParserState *virJSONParserStatePtr;
diff --git a/src/util/virkeyfile.c b/src/util/virkeyfile.c
index 0596d4b..acb77b9 100644
--- a/src/util/virkeyfile.c
+++ b/src/util/virkeyfile.c
@@ -37,6 +37,8 @@
#define VIR_FROM_THIS VIR_FROM_CONF
+VIR_LOG_INIT("util.keyfile");
+
typedef struct _virKeyFileGroup virKeyFileGroup;
typedef virKeyFileGroup *virKeyFileGroupPtr;
diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 90a39bb..6e8ba27 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -37,6 +37,8 @@
#define VIR_FROM_THIS VIR_FROM_LOCKSPACE
+VIR_LOG_INIT("util.lockspace");
+
#define VIR_LOCKSPACE_TABLE_SIZE 10
typedef struct _virLockSpaceResource virLockSpaceResource;
diff --git a/src/util/virlog.c b/src/util/virlog.c
index b535623..6a20b89 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -60,6 +60,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.log");
+
/*
* A logging buffer to keep some history over logs
*/
@@ -96,8 +98,6 @@ typedef virLogFilter *virLogFilterPtr;
static virLogFilterPtr virLogFilters = NULL;
static int virLogNbFilters = 0;
-virLogSource virLogSelf = { .name = "util.log" };
-
/*
* Outputs are used to emit the messages retained
* after filtering, multiple output can be used simultaneously
diff --git a/src/util/virlog.h b/src/util/virlog.h
index 4ac4c47..3a4abd1 100644
--- a/src/util/virlog.h
+++ b/src/util/virlog.h
@@ -51,7 +51,15 @@ struct _virLogSource {
const char *name;
};
-extern virLogSource virLogSelf;
+/*
+ * ATTRIBUTE_UNUSED is to make gcc keep quiet if all the
+ * log statements in a file are conditionally disabled
+ * at compile time due to configure options.
+ */
+# define VIR_LOG_INIT(n) \
+ static ATTRIBUTE_UNUSED virLogSource virLogSelf = { \
+ .name = "" n "", \
+ };
/*
* If configured with --enable-debug=yes then library calls
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 6a1ee1e..48f1569 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -54,6 +54,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.netdev");
+
#if defined(HAVE_STRUCT_IFREQ)
static int virNetDevSetupControlFull(const char *ifname,
struct ifreq *ifr,
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index e984bf2..1a1c1e2 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -65,6 +65,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, VIR_NETDEV_MACVLAN_MODE_LAST,
# include "virnetdev.h"
# include "virpidfile.h"
+VIR_LOG_INIT("util.netdevmacvlan");
# define MACVTAP_NAME_PREFIX "macvtap"
# define MACVTAP_NAME_PATTERN "macvtap%d"
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index ebfc4d4..a36af76 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -42,6 +42,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.netdevtap");
+
/**
* virNetDevTapGetName:
* @tapfd: a tun/tap file descriptor
diff --git a/src/util/virnetdevveth.c b/src/util/virnetdevveth.c
index 62d4774..834bee3 100644
--- a/src/util/virnetdevveth.c
+++ b/src/util/virnetdevveth.c
@@ -37,6 +37,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.netdevveth");
+
/* Functions */
virMutex virNetDevVethCreateMutex;
diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index c87837c..9a294d9 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -63,6 +63,8 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp,
VIR_NETDEV_VPORT_PROFILE_OP_LAST,
# include "virlog.h"
# include "virnetdev.h"
+VIR_LOG_INIT("util.netdevvportprofile");
+
# define MICROSEC_PER_SEC (1000 * 1000)
# define NLMSGBUF_SIZE 256
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index ba6c4b5..b163ffb 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -48,6 +48,8 @@
#define VIR_FROM_THIS VIR_FROM_NET
+VIR_LOG_INIT("util.netlink");
+
#define NETLINK_ACK_TIMEOUT_S (2*1000)
#if defined(__linux__) && defined(HAVE_LIBNL)
diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c
index 72a17cd..6d2f50d 100644
--- a/src/util/virnodesuspend.c
+++ b/src/util/virnodesuspend.c
@@ -32,6 +32,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.nodesuspend");
+
#define SUSPEND_DELAY 10 /* in seconds */
/* Give sufficient time for performing the suspend operation on the host */
diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index 162872c..6ed1cb9 100644
--- a/src/util/virnuma.c
+++ b/src/util/virnuma.c
@@ -43,6 +43,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.numa");
+
VIR_ENUM_IMPL(virDomainNumatuneMemMode,
VIR_DOMAIN_NUMATUNE_MEM_LAST,
"strict",
diff --git a/src/util/virobject.c b/src/util/virobject.c
index 5e3ee71..d1612be 100644
--- a/src/util/virobject.c
+++ b/src/util/virobject.c
@@ -33,6 +33,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.object");
+
static unsigned int magicCounter = 0xCAFE0000;
struct _virClass {
diff --git a/src/util/virpci.c b/src/util/virpci.c
index e6133a9..0874456 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -46,6 +46,8 @@
#include "virstring.h"
#include "virutil.h"
+VIR_LOG_INIT("util.pci");
+
#define PCI_SYSFS "/sys/bus/pci/"
#define PCI_ID_LEN 10 /* "XXXX XXXX" */
#define PCI_ADDR_LEN 13 /* "XXXX:XX:XX.X" */
diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c
index 298d57c..9309c75 100644
--- a/src/util/virpidfile.c
+++ b/src/util/virpidfile.c
@@ -40,6 +40,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.pidfile");
+
char *virPidFileBuildPath(const char *dir, const char* name)
{
char *pidfile;
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 3620041..5032886 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -55,6 +55,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.process");
+
/**
* virProcessTranslateStatus:
* @status: child exit status to translate
diff --git a/src/util/virrandom.c b/src/util/virrandom.c
index 491a3af..49181ad 100644
--- a/src/util/virrandom.c
+++ b/src/util/virrandom.c
@@ -36,6 +36,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.random");
+
/* The algorithm of virRandomBits relies on gnulib's guarantee that
* 'random_r' matches the POSIX requirements on 'random' of being
* evenly distributed among exactly [0, 2**31) (that is, we always get
diff --git a/src/util/virscsi.c b/src/util/virscsi.c
index 802f515..81a294d 100644
--- a/src/util/virscsi.c
+++ b/src/util/virscsi.c
@@ -36,7 +36,6 @@
#include <unistd.h>
#include "virscsi.h"
-#include "virlog.h"
#include "viralloc.h"
#include "virfile.h"
#include "virutil.h"
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index e45236f..92a9366 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -51,6 +51,8 @@
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("util.storagefile");
+
VIR_ENUM_IMPL(virStorageFileFormat,
VIR_STORAGE_FILE_LAST,
"none",
diff --git a/src/util/virstring.c b/src/util/virstring.c
index b3912f3..9256de7 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -34,6 +34,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.string");
+
/*
* The following virStringSplit & virStringJoin methods
* are derived from g_strsplit / g_strjoin in glib2,
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index f58122f9..7c79aa3 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -32,7 +32,6 @@
#include "virerror.h"
#include "virsysinfo.h"
-#include "virlog.h"
#include "viralloc.h"
#include "vircommand.h"
#include "virfile.h"
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index d263c58..f2eeb8c 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -35,6 +35,7 @@
#define VIR_FROM_THIS VIR_FROM_SYSTEMD
+VIR_LOG_INIT("util.systemd");
static void virSystemdEscapeName(virBufferPtr buf,
const char *name)
diff --git a/src/util/virusb.c b/src/util/virusb.c
index 90a0061..1b6d76f 100644
--- a/src/util/virusb.c
+++ b/src/util/virusb.c
@@ -48,6 +48,8 @@
/* For virReportOOMError() and virReportSystemError() */
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.usb");
+
struct _virUSBDevice {
unsigned int bus;
unsigned int dev;
diff --git a/src/util/virutil.c b/src/util/virutil.c
index 7a2fbb0..ac4c312 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -90,6 +90,8 @@ verify(sizeof(gid_t) <= sizeof(unsigned int) &&
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.util");
+
#ifndef WIN32
int virSetInherit(int fd, bool inherit) {
diff --git a/src/util/viruuid.c b/src/util/viruuid.c
index c5fa9a8..0bf6f61 100644
--- a/src/util/viruuid.c
+++ b/src/util/viruuid.c
@@ -44,6 +44,8 @@
#include "virfile.h"
#include "virrandom.h"
+VIR_LOG_INIT("util.uuid");
+
#ifndef ENODATA
# define ENODATA EIO
#endif
diff --git a/src/vbox/vbox_MSCOMGlue.c b/src/vbox/vbox_MSCOMGlue.c
index c87004a..2421763 100644
--- a/src/vbox/vbox_MSCOMGlue.c
+++ b/src/vbox/vbox_MSCOMGlue.c
@@ -40,6 +40,8 @@
#define VIR_FROM_THIS VIR_FROM_VBOX
+VIR_LOG_INIT("vbox.vbox_MSCOMGlue");
+
#define VBOX_REGKEY_ORACLE "Software\\Oracle\\VirtualBox"
#define VBOX_REGKEY_SUN "Software\\Sun\\xVM VirtualBox"
diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c
index 8652e3a..7775079 100644
--- a/src/vbox/vbox_XPCOMCGlue.c
+++ b/src/vbox/vbox_XPCOMCGlue.c
@@ -46,6 +46,7 @@
#define VIR_FROM_THIS VIR_FROM_VBOX
+VIR_LOG_INIT("vbox.vbox_XPCOMCGlue");
/*******************************************************************************
* Defined Constants And Macros *
diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c
index c22b6ce..e26b10a 100644
--- a/src/vbox/vbox_driver.c
+++ b/src/vbox/vbox_driver.c
@@ -42,6 +42,7 @@
#define VIR_FROM_THIS VIR_FROM_VBOX
+VIR_LOG_INIT("vbox.vbox_driver");
extern virDriver vbox22Driver;
extern virNetworkDriver vbox22NetworkDriver;
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 382d7b4..51a5d86 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -89,6 +89,9 @@
#define VIR_FROM_THIS VIR_FROM_VBOX
+
+VIR_LOG_INIT("vbox.vbox_tmpl");
+
#define VBOX_UTF16_FREE(arg) \
do { \
if (arg) { \
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 8fb2a93..1ebb0f9 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -35,6 +35,8 @@
#include "viruri.h"
#include "virstring.h"
+VIR_LOG_INIT("vmx.vmx");
+
/*
mapping:
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 1880b22..54ad1a2 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -69,6 +69,9 @@
#include "viraccessapicheck.h"
#define VIR_FROM_THIS VIR_FROM_XEN
+
+VIR_LOG_INIT("xen.xen_driver");
+
#define XEN_SAVE_DIR LOCALSTATEDIR "/lib/libvirt/xen/save"
static int
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index f9c7b40..dbbec01 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -83,6 +83,8 @@
#define VIR_FROM_THIS VIR_FROM_XEN
+VIR_LOG_INIT("xen.xen_hypervisor");
+
/*
* so far there is 2 versions of the structures usable for doing
* hypervisor calls.
diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c
index a58509b..75ba510 100644
--- a/src/xen/xen_inotify.c
+++ b/src/xen/xen_inotify.c
@@ -44,6 +44,8 @@
#define VIR_FROM_THIS VIR_FROM_XEN_INOTIFY
+VIR_LOG_INIT("xen.xen_inotify");
+
static int
xenInotifyXenCacheLookup(virConnectPtr conn,
const char *filename,
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 25137b8..4b10f42 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -63,6 +63,8 @@
#define VIR_FROM_THIS VIR_FROM_XEND
+VIR_LOG_INIT("xen.xend_internal");
+
/*
* The number of Xen scheduler parameters
*/
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 8037b2e..9b2d0e8 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -53,6 +53,8 @@
#define VIR_FROM_THIS VIR_FROM_XENXM
+VIR_LOG_INIT("xen.xm_internal");
+
#ifdef WITH_RHEL5_API
# define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 0
# define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 2
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index 2d02e6e..8040bc3 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -54,6 +54,8 @@
#define VIR_FROM_THIS VIR_FROM_XEN
+VIR_LOG_INIT("xen.xs_internal");
+
static void xenStoreWatchEvent(int watch, int fd, int events, void *data);
static void xenStoreWatchListFree(xenStoreWatchListPtr list);
diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index 427fc21..610e0f0 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -38,6 +38,8 @@
#include "xenapi_utils.h"
#include "virstring.h"
+VIR_LOG_INIT("xenapi.xenapi_utils");
+
void
xenSessionFree(xen_session *session)
{
diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c
index 1319c74..01d1ca1 100644
--- a/src/xenxs/xen_sxpr.c
+++ b/src/xenxs/xen_sxpr.c
@@ -39,6 +39,8 @@
#include "virstoragefile.h"
#include "virstring.h"
+VIR_LOG_INIT("xenxs.xen_sxpr");
+
/* Get a domain id from a S-expression string */
int xenGetDomIdFromSxprString(const char *sexpr, int xendConfigVersion, int *id)
{
diff --git a/tests/domainconftest.c b/tests/domainconftest.c
index d38ef5c..c87da5d 100644
--- a/tests/domainconftest.c
+++ b/tests/domainconftest.c
@@ -29,6 +29,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.domainconftest");
+
static virCapsPtr caps;
static virDomainXMLOptionPtr xmlopt;
diff --git a/tests/eventtest.c b/tests/eventtest.c
index 821745f..2cfa0c6 100644
--- a/tests/eventtest.c
+++ b/tests/eventtest.c
@@ -34,6 +34,8 @@
#include "virutil.h"
#include "vireventpoll.h"
+VIR_LOG_INIT("tests.eventtest");
+
#define NUM_FDS 31
#define NUM_TIME 31
diff --git a/tests/fdstreamtest.c b/tests/fdstreamtest.c
index 0eeb8a5..92e7add 100644
--- a/tests/fdstreamtest.c
+++ b/tests/fdstreamtest.c
@@ -36,6 +36,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.fdstreamtest");
+
#define PATTERN_LEN 256
static int testFDStreamReadCommon(const char *scratchdir, bool blocking)
diff --git a/tests/libvirtdconftest.c b/tests/libvirtdconftest.c
index fbc0f3f..3dee6f1 100644
--- a/tests/libvirtdconftest.c
+++ b/tests/libvirtdconftest.c
@@ -34,6 +34,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.libvirtdconftest");
+
struct testCorruptData {
size_t *params;
const char *filedata;
diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index 60ffe90..9dae9a5 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -38,6 +38,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.qemumonitortestutils");
+
struct _qemuMonitorTestItem {
qemuMonitorTestResponseCallback cb;
void *opaque;
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index 3505f8c..d52f9f9 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -42,6 +42,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.securityselinuxlabeltest");
+
static virCapsPtr caps;
static virDomainXMLOptionPtr xmlopt;
diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c
index feb5366..4ea2b72 100644
--- a/tests/securityselinuxtest.c
+++ b/tests/securityselinuxtest.c
@@ -39,6 +39,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.securityselinuxtest");
+
struct testSELinuxGenLabelData {
virSecurityManagerPtr mgr;
diff --git a/tests/sockettest.c b/tests/sockettest.c
index f98955d..1945b44 100644
--- a/tests/sockettest.c
+++ b/tests/sockettest.c
@@ -30,6 +30,8 @@
#include "virlog.h"
#include "viralloc.h"
+VIR_LOG_INIT("tests.sockettest");
+
static int testParse(virSocketAddr *addr, const char *addrstr, int family, bool pass)
{
int rc;
diff --git a/tests/testutils.c b/tests/testutils.c
index f5c815f..e21e2f4 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -60,6 +60,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.testutils");
+
#define GETTIMEOFDAY(T) gettimeofday(T, NULL)
#define DIFF_MSEC(T, U) \
((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \
diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c
index 0bed997..840a3bd 100644
--- a/tests/virauthconfigtest.c
+++ b/tests/virauthconfigtest.c
@@ -32,6 +32,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.authconfigtest");
+
struct ConfigLookupData {
virAuthConfigPtr config;
const char *hostname;
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
index 5d5eccc..f7dda28 100644
--- a/tests/vircgrouptest.c
+++ b/tests/vircgrouptest.c
@@ -37,6 +37,8 @@
# define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.cgrouptest");
+
static int validateCgroup(virCgroupPtr cgroup,
const char *expectPath,
const char **expectMountPoint,
diff --git a/tests/virdbustest.c b/tests/virdbustest.c
index cd4edc7..0234911 100644
--- a/tests/virdbustest.c
+++ b/tests/virdbustest.c
@@ -26,6 +26,8 @@
#include "virlog.h"
#include "testutils.h"
+VIR_LOG_INIT("tests.dbustest");
+
#define VERIFY(typname, valorig, valnew, fmt) \
do { \
VIR_DEBUG("Compare " typname " '" fmt "' to
'" \
diff --git a/tests/virdrivermoduletest.c b/tests/virdrivermoduletest.c
index ba6e39d..d527dc4 100644
--- a/tests/virdrivermoduletest.c
+++ b/tests/virdrivermoduletest.c
@@ -28,6 +28,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.drivermoduletest");
+
struct testDriverData {
const char *name;
const char *dep1;
diff --git a/tests/virhashtest.c b/tests/virhashtest.c
index dbc0dba..eead479 100644
--- a/tests/virhashtest.c
+++ b/tests/virhashtest.c
@@ -15,6 +15,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.hashtest");
+
#define testError(...) \
do { \
char *str; \
diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c
index 9fcdcd3..edfe181 100644
--- a/tests/viridentitytest.c
+++ b/tests/viridentitytest.c
@@ -37,6 +37,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.identitytest");
static int testIdentityAttrs(const void *data ATTRIBUTE_UNUSED)
{
diff --git a/tests/virkeycodetest.c b/tests/virkeycodetest.c
index 5d1a87b..77378ec 100644
--- a/tests/virkeycodetest.c
+++ b/tests/virkeycodetest.c
@@ -34,6 +34,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.keycodetest");
static int testKeycodeMapping(const void *data ATTRIBUTE_UNUSED)
{
diff --git a/tests/virkeyfiletest.c b/tests/virkeyfiletest.c
index 1570ad6..5448298 100644
--- a/tests/virkeyfiletest.c
+++ b/tests/virkeyfiletest.c
@@ -32,6 +32,7 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.keyfiletest");
static int testParse(const void *args ATTRIBUTE_UNUSED)
{
diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c
index 78094ef..e3123db 100644
--- a/tests/virlockspacetest.c
+++ b/tests/virlockspacetest.c
@@ -35,6 +35,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.lockspacetest");
+
#define LOCKSPACE_DIR abs_builddir "/virlockspacedata"
static int testLockSpaceCreate(const void *args ATTRIBUTE_UNUSED)
diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c
index ad619de..096a464 100644
--- a/tests/virnetmessagetest.c
+++ b/tests/virnetmessagetest.c
@@ -32,6 +32,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.netmessagetest");
+
static int testMessageHeaderEncode(const void *args ATTRIBUTE_UNUSED)
{
virNetMessagePtr msg = virNetMessageNew(true);
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index a14371a..980466e 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -39,6 +39,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.netsockettest");
+
#if HAVE_IFADDRS_H
# define BASE_PORT 5672
diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
index 1cc9946..1742981 100644
--- a/tests/virnettlscontexttest.c
+++ b/tests/virnettlscontexttest.c
@@ -40,6 +40,8 @@
# define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.nettlscontexttest");
+
# define KEYFILE "key-ctx.pem"
struct testTLSContextData {
diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c
index 8a10340..47a1b12 100644
--- a/tests/virnettlshelpers.c
+++ b/tests/virnettlshelpers.c
@@ -34,6 +34,8 @@
# define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.nettlshelpers");
+
/*
* These store some static data that is needed when
* encoding extensions in the x509 certs
diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c
index 6d77d35..fe5b945 100644
--- a/tests/virnettlssessiontest.c
+++ b/tests/virnettlssessiontest.c
@@ -38,6 +38,8 @@
# define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.nettlssessiontest");
+
# define KEYFILE "key-sess.pem"
struct testTLSSessionData {
diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c
index fd48c11..a6a5d6d 100644
--- a/tests/virportallocatortest.c
+++ b/tests/virportallocatortest.c
@@ -118,6 +118,7 @@ int bind(int sockfd ATTRIBUTE_UNUSED,
# define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.portallocatortest");
static int testAllocAll(const void *args ATTRIBUTE_UNUSED)
{
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index db0cf1c..38581db 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -32,6 +32,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.storagetest");
+
#define datadir abs_builddir "/virstoragedata"
/* This test creates the following files, all in datadir:
diff --git a/tests/virstringtest.c b/tests/virstringtest.c
index 8d45e71..92970b2 100644
--- a/tests/virstringtest.c
+++ b/tests/virstringtest.c
@@ -31,6 +31,8 @@
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.stringtest");
+
struct testSplitData {
const char *string;
const char *delim;
diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c
index 9752d12..82411ff 100644
--- a/tests/virsystemdtest.c
+++ b/tests/virsystemdtest.c
@@ -31,6 +31,8 @@
# define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.systemdtest");
+
static int testCreateContainer(const void *opaque ATTRIBUTE_UNUSED)
{
unsigned char uuid[VIR_UUID_BUFLEN] = {
diff --git a/tests/virtimetest.c b/tests/virtimetest.c
index c1f8f4b..9014b71 100644
--- a/tests/virtimetest.c
+++ b/tests/virtimetest.c
@@ -32,6 +32,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.timetest");
+
struct testTimeFieldsData {
unsigned long long when;
struct tm fields;
diff --git a/tests/viruritest.c b/tests/viruritest.c
index 41a8ca7..b5b884e 100644
--- a/tests/viruritest.c
+++ b/tests/viruritest.c
@@ -32,6 +32,8 @@
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.uritest");
+
struct URIParseData {
const char *uri;
const char *uri_out;
diff --git a/tools/virsh-console.c b/tools/virsh-console.c
index c664a3a..34a0578 100644
--- a/tools/virsh-console.c
+++ b/tools/virsh-console.c
@@ -46,6 +46,8 @@
# include "virthread.h"
# include "virerror.h"
+VIR_LOG_INIT("tools.virsh-console");
+
/*
* Convert given character to control character.
* Basically, we assume ASCII, and take lower 6 bits.
--
1.8.5.3