From 2835c1e730c01f52c41027e5241fa0ad465fce56 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 28 Feb 2014 12:16:17 +0000 Subject: [PATCH] Add virLogSource variables to all source files 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 --- 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_map.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 | 1 - src/esx/esx_network_driver.c | 1 - src/esx/esx_nwfilter_driver.c | 1 - src/esx/esx_secret_driver.c | 1 - src/esx/esx_storage_backend_iscsi.c | 1 - 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 | 1 - src/hyperv/hyperv_driver.c | 2 +- src/hyperv/hyperv_interface_driver.c | 1 - src/hyperv/hyperv_network_driver.c | 1 - src/hyperv/hyperv_nwfilter_driver.c | 1 - src/hyperv/hyperv_secret_driver.c | 1 - src/hyperv/hyperv_storage_driver.c | 1 - src/hyperv/hyperv_util.c | 2 +- src/hyperv/hyperv_wmi.c | 1 - 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_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 | 3 +++ 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/virhostdev.c | 3 +++ 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/virhostdevtest.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 ++ 232 files changed, 443 insertions(+), 34 deletions(-) diff --git a/cfg.mk b/cfg.mk index 319210b913..7a65d1eac2 100644 --- a/cfg.mk +++ b/cfg.mk @@ -1068,3 +1068,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 21e19e0dce..e8d1b4d50d 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 83d45c69fd..4ee4316fb4 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" @@ -105,6 +106,8 @@ #include "virdbus.h" #include "cpu/cpu_map.h" +VIR_LOG_INIT("daemon.libvirtd"); + #if WITH_SASL virNetSASLContextPtr saslCtxt = NULL; #endif diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h index c4f1f27130..650267ea4a 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 48ca3d0b51..85ad16685a 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 9e36e8a9fe..16cdf03545 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 ab6b0b4f39..71494d5edd 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 d9ebc49ee6..70db86028b 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 16e3853712..c042ccf420 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 3437646d60..15029cdf6d 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 ff9ac0d205..baa3340206 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 ee856800e1..f5433f392f 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 b6564c2eaf..69632b06cf 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 c9c8b6936d..89aa52c3b1 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 9c18922b72..ee49e82984 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 f2cfefed34..298cfcb8c1 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 539313431d..fef8b613dd 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 5ceca8aa7b..697c85f67b 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 6fdefd0326..58e12c01b4 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 546e5b3f5d..6fa14ed263 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 230dc65be5..03938f16a8 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 3e6beaaef0..d23254bf7c 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 677bb088fb..199438324b 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_map.c b/src/cpu/cpu_map.c index f6c63d49c2..5a01d7b420 100644 --- a/src/cpu/cpu_map.c +++ b/src/cpu/cpu_map.c @@ -32,6 +32,8 @@ #define VIR_FROM_THIS VIR_FROM_CPU +VIR_LOG_INIT("cpu.cpu_map"); + #define CPUMAPFILE PKGDATADIR "/cpu_map.xml" static char *cpumap; diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c index 77ffa52ddc..36f4f25407 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 56080ef1f4..423bcc13cf 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 6f98aed2b1..cdc8c6cb3f 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 721cbeb9f5..fdba2dc742 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 11b61c91e9..c02b00f9e2 100644 --- a/src/esx/esx_device_monitor.c +++ b/src/esx/esx_device_monitor.c @@ -25,7 +25,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 2512a6e8ef..a0591f3de0 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -49,6 +49,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 193565ea3f..656ac8b31a 100644 --- a/src/esx/esx_interface_driver.c +++ b/src/esx/esx_interface_driver.c @@ -25,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 4449ced13a..877a3c1c5e 100644 --- a/src/esx/esx_network_driver.c +++ b/src/esx/esx_network_driver.c @@ -26,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 b764e2dcf8..3cf70d0807 100644 --- a/src/esx/esx_nwfilter_driver.c +++ b/src/esx/esx_nwfilter_driver.c @@ -25,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 327536911b..558cf07e32 100644 --- a/src/esx/esx_secret_driver.c +++ b/src/esx/esx_secret_driver.c @@ -24,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 b7287fbf23..e8f88ba2f6 100644 --- a/src/esx/esx_storage_backend_iscsi.c +++ b/src/esx/esx_storage_backend_iscsi.c @@ -28,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 64b93f7954..2fa2a00031 100644 --- a/src/esx/esx_storage_backend_vmfs.c +++ b/src/esx/esx_storage_backend_vmfs.c @@ -45,6 +45,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 f4d1f941d5..47d30aa9a3 100644 --- a/src/esx/esx_util.c +++ b/src/esx/esx_util.c @@ -37,7 +37,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 e554b6347f..afbfdb92fc 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -38,7 +38,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 0a3b3dd93c..9b9701d455 100644 --- a/src/esx/esx_vi_methods.c +++ b/src/esx/esx_vi_methods.c @@ -24,7 +24,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 8eff66e1c8..4289608fa5 100644 --- a/src/esx/esx_vi_types.c +++ b/src/esx/esx_vi_types.c @@ -36,7 +36,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 04d62b8e3c..8813f6f260 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 413fa10b48..5332eb2b75 100644 --- a/src/hyperv/hyperv_device_monitor.c +++ b/src/hyperv/hyperv_device_monitor.c @@ -26,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 b2c367525a..7a8088554d 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -44,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 fbdd1a685a..b93cf30ef4 100644 --- a/src/hyperv/hyperv_interface_driver.c +++ b/src/hyperv/hyperv_interface_driver.c @@ -26,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 32f3d83058..6f54f44976 100644 --- a/src/hyperv/hyperv_network_driver.c +++ b/src/hyperv/hyperv_network_driver.c @@ -26,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 b71c66c624..a82db9259b 100644 --- a/src/hyperv/hyperv_nwfilter_driver.c +++ b/src/hyperv/hyperv_nwfilter_driver.c @@ -26,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 1c4aae6476..81764842a4 100644 --- a/src/hyperv/hyperv_secret_driver.c +++ b/src/hyperv/hyperv_secret_driver.c @@ -26,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 81fa74a75b..af3cca4d53 100644 --- a/src/hyperv/hyperv_storage_driver.c +++ b/src/hyperv/hyperv_storage_driver.c @@ -26,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 95d0b79590..3b8f491cfe 100644 --- a/src/hyperv/hyperv_util.c +++ b/src/hyperv/hyperv_util.c @@ -32,7 +32,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 6fbe54d5a1..bf472b6e66 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -26,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 98ce83b78e..0948418792 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 abfb93f511..f31b55668b 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 617ad05b7f..2f66e2d0b3 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 6715fc65d4..2201b07336 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 3a7ae6ef7d..aaaac2f73b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1462,7 +1462,6 @@ virLogParseOutputs; virLogPriorityFromSyslog; virLogProbablyLogMessage; virLogReset; -virLogSelf; virLogSetBufferSize; virLogSetDefaultPriority; virLogSetFromEnv; diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 8ba3ce3237..aa5d958db3 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 274fb6c884..e1ba6a68bd 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 2dd0d1aae6..a6ba10aea1 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -57,6 +57,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 5e024000ac..643a875226 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 89fa93963c..35d3090eab 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 68cd9e9b44..e90d87908b 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 c2e1000489..a26e2cc483 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 1b92d680cc..6f52198f74 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 e8e9917ed6..93a988ef73 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 c54d75550d..3e12c4fdb8 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 f09c168f5e..54552b800f 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 39d955cd8c..5a1718d160 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 557191aec0..d4432cf0ad 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 e03405174f..b6c788a9ef 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 ab140f1dd3..874e19606b 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 fe64a361d3..55f5b49bb6 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 27c27d8485..1ae04c54f6 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -75,6 +75,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 d3d8f85ac4..81706c88fb 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 d12013c48a..fb9c306292 100644 --- a/src/lxc/lxc_hostdev.c +++ b/src/lxc/lxc_hostdev.c @@ -31,6 +31,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 07e93010ac..e9447cee7a 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 663e29c1ec..fa0e62eddb 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 fcdcb2d734..2f4121c596 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 181541e5c2..59b6c09895 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 ff62cb3ccd..a5f6b4e7e1 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 ebf34f6c0d..6a571daa62 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 55b3eb3e96..999f9ab7f3 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 fafd520a4d..1ca315bed0 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 d68c3bd611..9233be503d 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 5c48fe88d3..ddd54e0e35 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 916cb47d1a..6d33f640b0 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 9e31afb1a9..d2a806211c 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 8ce2b7df83..0876901dcb 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 74a1f9dfab..6ab1dcb84c 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 1e9b3d2dfe..4f02f159b0 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 e071ff4d3e..e156a9356d 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 c10fa05d49..2a28ed2d6e 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 2cba3ca255..626a1e25f5 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 e819256699..d97b39f9ad 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 553bff919a..83f077f5b1 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_capabilities.c b/src/qemu/qemu_capabilities.c index c6224bd305..29142002c8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -48,6 +48,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 a97f184c7a..da8cdbf013 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 7cb4e7a3b1..5ca3f74058 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -59,6 +59,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 6c73dfabbd..91c5e3ad7a 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -56,6 +56,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 4465befd25..7d375e5fb6 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 6b96c1673a..2707bec855 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 e1ec4e61b7..cdd4137e00 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -41,6 +41,9 @@ #define VIR_FROM_THIS VIR_FROM_QEMU +VIR_LOG_INIT("qemu.qemu_hostdev"); + + int qemuUpdateActivePCIHostdevs(virQEMUDriverPtr driver, virDomainDefPtr def) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 0226e5d5f2..bf4f1605b1 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -51,6 +51,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 5d5473edc9..26ac99b8e9 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -59,6 +59,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 4c7e7f63b0..56e82fd8bb 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 05df42ac93..bd26eb13b2 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 6610ba4ae0..efb36541b5 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 400625a965..6c4543f0ef 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 e85f34df44..92aff636ca 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 fcc43ad4a1..f5c48b74e9 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 9e5ea7af00..b288b74e46 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 cbd628a66b..3ff27d3d7a 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 b785392f09..521bdda1fd 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 af074047ff..4e8e17de50 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 dbb9a25f0d..abf3334794 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 33a0346cb5..e672755c12 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 7b6d82d521..495b0b39c6 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 85ae100743..131968061c 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 93a3fb1a82..8aea9f0afa 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 be1df6cde6..16a25213ed 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 f544d69c4e..789ba2e07a 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 27a00d06d8..7bf2a2ee97 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 5cb6391039..a7c8010280 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 a74a91c21c..f7b67bae09 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 85e6eecc0e..9f4506308a 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 d8a8283871..4800d5255a 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 5ecf72f1ff..795807a0a4 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 448f686ea2..02c74966f5 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 f7b91acb7a..d14e633e70 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 2b6011ba3c..05799a3d85 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 bab02dd1ee..edb7cd0d69 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 202a441ba8..a22b23a431 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 531d04430c..2a4e66917c 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 1ac48e6110..667fb063f5 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 5d0ed320b2..897911ef9e 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 d78dbe4d30..e6b3363e36 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 43972578ee..572d855ceb 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 82df274bea..1673b5ee67 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 466ceba127..6a2840c81c 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 181a15a404..571644918a 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 0f2f38e5c8..3567b0356d 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 8ddf181be4..28e65f42e8 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 27ed74a26e..be9f0fea60 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 c71c7ebc85..be48bcfb89 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 ac787f8849..33ed2f6554 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 e66cbf5a38..7f94eb6fdd 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 808d1cb849..d7fd04a23f 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 7e1dc57ade..c5925b1df7 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 a39be60473..ff971c8db7 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 fd7b713807..ff135bfb4b 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -55,6 +55,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 63aa56918d..b965df7bc6 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 9bddbfc66a..e3236d8026 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 fa31d697b6..20dca0fef4 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 01fb15e581..2e5c025504 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 009d894d69..1d7fa7797e 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 c6dcb26b82..84d28a40d4 100644 --- a/src/util/virevent.c +++ b/src/util/virevent.c @@ -30,6 +30,8 @@ #include +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 6f1e184163..ea890de4b5 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 a4a4827776..fefc3fb283 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 0857805e5c..9ef355444f 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 0f5d0c56fb..e3ac4d2d5d 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/virhostdev.c b/src/util/virhostdev.c index 9fe1062cbb..5d5f72fbe5 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -43,6 +43,9 @@ #include "configmake.h" #define VIR_FROM_THIS VIR_FROM_NONE + +VIR_LOG_INIT("util.hostdev"); + #define HOSTDEV_STATE_DIR LOCALSTATEDIR "/run/libvirt/hostdevmgr" static virHostdevManagerPtr manager; /* global hostdev manager, never freed */ diff --git a/src/util/viridentity.c b/src/util/viridentity.c index bd6adcf365..351fdd745b 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 45f7789ace..d0dc081a80 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 02b5f3fa1b..5125ad078b 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 0596d4b8a4..acb77b9a61 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 a187e1e3e6..e41a4b0696 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 b535623130..6a20b89a84 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 4ac4c47f5e..3a4abd141d 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 55781b20bc..6bcd73c247 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 e984bf2800..1a1c1e2e8d 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 ebfc4d4194..a36af7653f 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 62d4774fa2..834bee3b5e 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 c87837c6e0..9a294d9639 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 ba6c4b5121..b163ffb75b 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 72a17cd353..6d2f50dc40 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 162872c290..6ed1cb9c5c 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 5e3ee719e1..d1612beb4e 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 e6133a99d1..08744564dd 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 28db24c949..0d08f1f614 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 3620041ed3..50328864ba 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 491a3afc0e..49181ad768 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 802f515c1e..81a294d902 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -36,7 +36,6 @@ #include #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 e45236f280..92a9366107 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 b3912f3331..9256de7c20 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 1fa9bef98a..609d8152d0 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 d263c58e04..f2eeb8cee3 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 90a0061dff..1b6d76fe99 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 b6106fce2a..121722d531 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 48f5e2e44b..eacac4456d 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 fbf42d8f1d..0a0b4d18d2 100644 --- a/src/vbox/vbox_MSCOMGlue.c +++ b/src/vbox/vbox_MSCOMGlue.c @@ -39,6 +39,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 8652e3a090..77750795be 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 c22b6ce903..e26b10a11d 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 c9cdd72ca6..7162a25354 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 8fb2a9308e..1ebb0f9bd8 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 9204f888a3..8ceb8b660e 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 d24db06588..5ccd5fa098 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 6190a9d6f7..af8915f6b5 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 25137b87c8..4b10f42d72 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 603b71af38..fbdd89eb6b 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 2d02e6ee4f..8040bc3c0e 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 427fc210ee..610e0f086d 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 1319c740a4..01d1ca125f 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 d38ef5c42c..c87da5d7c3 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 821745faf4..2cfa0c61e0 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 0eeb8a57ec..92e7addb21 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 d069bb7cad..41c3e37419 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 60ffe9047f..9dae9a5fee 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 3505f8c832..d52f9f93bb 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 feb53665fa..4ea2b720c4 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 648b05e081..e613546b9a 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 f5c815fb3a..e21e2f48db 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 7678f2455e..594becc92b 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 8d79821c53..caddc6a3cd 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 b3ae2f4c0b..9a6c4c60ef 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 6849febb57..4203f5bab6 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 dbc0dbaaac..eead479892 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/virhostdevtest.c b/tests/virhostdevtest.c index 7d2ce4f2a4..56f2f7a950 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -35,6 +35,8 @@ # define VIR_FROM_THIS VIR_FROM_NONE +VIR_LOG_INIT("tests.hostdevtest"); + # define CHECK_LIST_COUNT(list, cnt) \ if ((count = virPCIDeviceListCount(list)) != cnt) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c index 8b1e22dd74..3e79ad83f8 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 5d1a87b4ff..77378ec6a8 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 6bb6ab085b..b149ce19c5 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 7e417f45d0..650b5980dc 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 af2a4c8321..60f960284a 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 51b7a6a153..a04e576c67 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 f5df03b2ed..c66ae58986 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 8a10340d55..47a1b1234a 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 83a086290a..3397865f56 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 7cf6498ce0..fa701baf74 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 db0cf1c3a1..38581db11a 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 8f7a539251..97cf75fb78 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 80d3659eb6..4fc5137423 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 034db4af1c..73a3c3ed5c 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 7bca80ce3d..709061aa94 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 c664a3a6cd..34a0578ca5 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.