exclude_file_name_regexp--sc_prohibit_getenv = \
^tests/.*\.[ch]$$
+
+exclude_file_name_regexp--sc_avoid_attribute_unused_in_header = \
+ ^src/util/virlog\.h$$
#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
#include "libvirt_internal.h"
#include "virerror.h"
#include "virfile.h"
+#include "virlog.h"
#include "virpidfile.h"
#include "virprocess.h"
#include "virdbus.h"
#include "cpu/cpu_map.h"
+VIR_LOG_INIT("daemon.libvirtd");
+
#if WITH_SASL
virNetSASLContextPtr saslCtxt = NULL;
#endif
# include "remote_protocol.h"
# include "lxc_protocol.h"
# include "qemu_protocol.h"
-# include "virlog.h"
# include "virthread.h"
# if WITH_SASL
# include "virnetsaslcontext.h"
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("daemon.remote");
+
#if SIZEOF_LONG < 8
# define HYPER_TO_TYPE(_type, _to, _from) \
do { \
#define VIR_FROM_THIS VIR_FROM_STREAMS
+VIR_LOG_INIT("daemon.stream");
+
struct daemonClientStream {
daemonClientPrivatePtr priv;
int refs;
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 }
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]
#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__)
#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__)
#define VIR_FROM_THIS VIR_FROM_BHYVE
+VIR_LOG_INIT("bhyve.bhyve_command");
+
static char*
virBhyveTapGetRealDeviceName(char *name)
{
#define VIR_FROM_THIS VIR_FROM_BHYVE
+VIR_LOG_INIT("bhyve.bhyve_driver");
+
bhyveConnPtr bhyve_driver = NULL;
void
#define VIR_FROM_THIS VIR_FROM_BHYVE
+VIR_LOG_INIT("bhyve.bhyve_process");
+
int
virBhyveProcessStart(virConnectPtr conn,
bhyveConnPtr driver,
#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
#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);
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.domain_event");
static virClassPtr virDomainEventClass;
static virClassPtr virDomainEventLifecycleClass;
#include "datatypes.h"
#include "virlog.h"
+VIR_LOG_INIT("conf.network_event");
+
struct _virNetworkEvent {
virObjectEvent parent;
#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);
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("conf.object_event");
+
struct _virObjectEventCallbackList {
unsigned int nextID;
size_t count;
#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")
#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",
#include "viralloc.h"
#include "virfile.h"
#include "virstring.h"
-#include "virlog.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
#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 {
#define NR_DRIVERS ARRAY_CARDINALITY(drivers)
#define VIR_FROM_THIS VIR_FROM_CPU
+VIR_LOG_INIT("cpu.cpu");
+
static struct cpuArchDriver *drivers[] = {
&cpuDriverX86,
&cpuDriverPowerPC,
#define VIR_FROM_THIS VIR_FROM_CPU
+VIR_LOG_INIT("cpu.cpu_map");
+
#define CPUMAPFILE PKGDATADIR "/cpu_map.xml"
static char *cpumap;
#define VIR_FROM_THIS VIR_FROM_CPU
+VIR_LOG_INIT("cpu.cpu_powerpc");
+
static const virArch archs[] = { VIR_ARCH_PPC64 };
struct ppc_vendor {
#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 };
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("datatypes");
+
virClassPtr virConnectClass;
virClassPtr virConnectCloseCallbackDataClass;
virClassPtr virDomainClass;
#include "configmake.h"
#include "virstring.h"
+VIR_LOG_INIT("driver");
+
#define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver"
#ifdef WITH_DRIVER_MODULES
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "esx_private.h"
#include "esx_device_monitor.h"
#define VIR_FROM_THIS VIR_FROM_ESX
+VIR_LOG_INIT("esx.esx_driver");
+
static int esxDomainGetMaxVcpus(virDomainPtr domain);
typedef struct _esxVMX_Data esxVMX_Data;
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "interface_conf.h"
#include "virsocketaddr.h"
#include "md5.h"
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "network_conf.h"
#include "esx_private.h"
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "esx_private.h"
#include "esx_nwfilter_driver.h"
#include "internal.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "esx_private.h"
#include "esx_secret_driver.h"
#include "internal.h"
#include "md5.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "storage_conf.h"
#include "virstoragefile.h"
#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.
#define VIR_FROM_THIS VIR_FROM_ESX
-
+VIR_LOG_INIT("esx.esx_util");
int
esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
#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/" \
#include "virbuffer.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "esx_vi_methods.h"
#include "esx_util.h"
#define VIR_FROM_THIS VIR_FROM_ESX
-
+VIR_LOG_INIT("esx.esx_vi_types");
#define ESX_VI__TEMPLATE__ALLOC(__type) \
int \
#define VIR_FROM_THIS VIR_FROM_STREAMS
+VIR_LOG_INIT("fdstream");
+
/* Tunnelled migration stream support */
struct virFDStreamData {
int fd;
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_device_monitor.h"
#define VIR_FROM_THIS VIR_FROM_HYPERV
-
+VIR_LOG_INIT("hyperv.hyperv_driver");
static void
hypervFreePrivate(hypervPrivate **priv)
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_interface_driver.h"
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_network_driver.h"
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_nwfilter_driver.h"
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_secret_driver.h"
#include "virerror.h"
#include "datatypes.h"
#include "viralloc.h"
-#include "virlog.h"
#include "viruuid.h"
#include "hyperv_storage_driver.h"
#define VIR_FROM_THIS VIR_FROM_HYPERV
-
+VIR_LOG_INIT("hyperv.hyperv_util");
int
hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri)
#include "internal.h"
#include "virerror.h"
#include "datatypes.h"
-#include "virlog.h"
#include "viralloc.h"
#include "viruuid.h"
#include "virbuffer.h"
#define VIR_FROM_THIS VIR_FROM_INTERFACE
+VIR_LOG_INIT("interface.interface_backend_netcf");
+
#define INTERFACE_DRIVER_NAME "netcf"
/* Main driver state */
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("libvirt-lxc");
+
/**
* virDomainLxcOpenNamespace:
* @domain: a domain object
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("libvirt-qemu");
+
/**
* virDomainQemuMonitorCommand:
* @domain: a domain object
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("libvirt");
+
/*
* TODO:
* - use lock to protect against concurrent accesses ?
virLogPriorityFromSyslog;
virLogProbablyLogMessage;
virLogReset;
-virLogSelf;
virLogSetBufferSize;
virLogSetDefaultPriority;
virLogSetFromEnv;
#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
#define VIR_FROM_THIS VIR_FROM_LIBXL
+VIR_LOG_INIT("libxl.libxl_domain");
VIR_ENUM_IMPL(libxlDomainJob, LIBXL_JOB_LAST,
"none",
#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
#define VIR_FROM_THIS VIR_FROM_LOCKING
+VIR_LOG_INIT("locking.domain_lock");
+
static int virDomainLockManagerAddLease(virLockManagerPtr lock,
virDomainLeaseDefPtr lease)
#define VIR_FROM_THIS VIR_FROM_LOCKING
+VIR_LOG_INIT("locking.lock_daemon");
+
#define VIR_LOCK_DAEMON_NUM_LOCKSPACES 3
struct _virLockDaemon {
#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
#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,
#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__)
#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,
#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"
#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, \
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_cgroup");
+
static int virLXCCgroupSetupCpuTune(virDomainDefPtr def,
virCgroupPtr cgroup)
{
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_conf");
+
static virClassPtr virLXCDriverConfigClass;
static void virLXCDriverConfigDispose(void *obj);
#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.
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_controller");
+
typedef struct _virLXCControllerConsole virLXCControllerConsole;
typedef virLXCControllerConsole *virLXCControllerConsolePtr;
struct _virLXCControllerConsole {
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_domain");
+
static void *virLXCDomainObjPrivateAlloc(void)
{
virLXCDomainObjPrivatePtr priv;
#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
#include "lxc_fuse.h"
#include "lxc_cgroup.h"
#include "virerror.h"
-#include "virlog.h"
#include "virfile.h"
#include "virbuffer.h"
#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_hostdev");
+
int
virLXCUpdateActiveUsbHostdevs(virLXCDriverPtr driver,
virDomainDefPtr def)
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_monitor");
+
struct _virLXCMonitor {
virObjectLockable parent;
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_native");
static virDomainFSDefPtr
lxcCreateFSDef(int type,
#define VIR_FROM_THIS VIR_FROM_LXC
+VIR_LOG_INIT("lxc.lxc_process");
+
#define START_POSTFIX ": starting up\n"
static virDomainObjPtr
#define VIR_FROM_THIS VIR_FROM_NETWORK
+VIR_LOG_INIT("network.bridge_driver");
+
static void networkDriverLock(virNetworkDriverStatePtr driver)
{
virMutexLock(&driver->lock);
#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
# define __VIR_BRIDGE_DRIVER_PLATFORM_H__
# include "internal.h"
-# include "virlog.h"
# include "virthread.h"
# include "virdnsmasq.h"
# include "network_conf.h"
#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"
#define VIR_FROM_THIS VIR_FROM_NODEDEV
-
static int update_caps(virNodeDeviceObjPtr dev)
{
virNodeDevCapsDefPtr cap = dev->def->caps;
#define VIR_FROM_THIS VIR_FROM_NODEDEV
+VIR_LOG_INIT("node_device.node_device_hal");
+
/*
* Host device enumeration (HAL implementation)
*/
#ifdef __linux__
+VIR_LOG_INIT("node_device.node_device_linux_sysfs");
+
int
detect_scsi_host_caps(union _virNodeDevCapData *d)
{
#define VIR_FROM_THIS VIR_FROM_NODEDEV
+VIR_LOG_INIT("node_device.node_device_udev");
+
#ifndef TYPE_RAID
# define TYPE_RAID 12
#endif
#include "viralloc.h"
#include "nodeinfopriv.h"
#include "physmem.h"
-#include "virlog.h"
#include "virerror.h"
#include "count-one-bits.h"
#include "intprops.h"
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("nwfilter.nwfilter_dhcpsnoop");
+
#ifdef HAVE_LIBPCAP
# define LEASEFILE_DIR LOCALSTATEDIR "/run/libvirt/network/"
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("nwfilter.nwfilter_driver");
+
#define DBUS_RULE_FWD_NAMEOWNERCHANGED \
"type='signal'" \
",interface='"DBUS_INTERFACE_DBUS"'" \
#define VIR_FROM_THIS VIR_FROM_NWFILTER
+VIR_LOG_INIT("nwfilter.nwfilter_ebiptables_driver");
+
#define EBTABLES_CHAIN_INCOMING "PREROUTING"
#define EBTABLES_CHAIN_OUTGOING "POSTROUTING"
#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
#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);
#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
#define VIR_FROM_THIS VIR_FROM_PARALLELS
+VIR_LOG_INIT("parallels.parallels_driver");
+
#define PRLCTL "prlctl"
#define PRLSRVCTL "prlsrvctl"
#define VIR_FROM_THIS VIR_FROM_PHYP
+VIR_LOG_INIT("phyp.phyp_driver");
+
+
/*
* URI: phyp://user@[hmc|ivm]/managed_system
* */
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_agent");
+
#define LINE_ENDING "\n"
#define DEBUG_IO 0
#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
#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",
#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
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_conf");
+
static virClassPtr virQEMUDriverConfigClass;
static void virQEMUDriverConfigDispose(void *obj);
#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,
#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
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_hostdev");
+
+
int
qemuUpdateActivePCIHostdevs(virQEMUDriverPtr driver,
virDomainDefPtr def)
#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. */
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_migration");
+
VIR_ENUM_IMPL(qemuMigrationJobPhase, QEMU_MIGRATION_PHASE_LAST,
"none",
"perform2",
#define VIR_FROM_THIS VIR_FROM_QEMU
+VIR_LOG_INIT("qemu.qemu_monitor");
+
#define DEBUG_IO 0
#define DEBUG_RAW_IO 0
#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"
#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: "
#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"
#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 { \
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.keepalive");
+
struct _virKeepAlive {
virObjectLockable parent;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netclient");
+
typedef struct _virNetClientCall virNetClientCall;
typedef virNetClientCall *virNetClientCallPtr;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netclientprogram");
+
struct _virNetClientProgram {
virObject object;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netclientstream");
+
struct _virNetClientStream {
virObjectLockable parent;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netmessage");
+
virNetMessagePtr virNetMessageNew(bool tracked)
{
virNetMessagePtr msg;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netsaslcontext");
+
struct _virNetSASLContext {
virObjectLockable parent;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netserver");
+
typedef struct _virNetServerSignal virNetServerSignal;
typedef virNetServerSignal *virNetServerSignalPtr;
#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
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netservermdns");
+
struct _virNetServerMDNSEntry {
char *type;
int port;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netserverprogram");
+
struct _virNetServerProgram {
virObject object;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.netsocket");
struct _virNetSocket {
virObjectLockable parent;
#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
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("rpc.nettlscontext");
+
struct _virNetTLSContext {
virObjectLockable parent;
#define VIR_FROM_THIS VIR_FROM_SECRET
+VIR_LOG_INIT("secret.secret_driver");
+
enum { SECRET_MAX_XML_FILE = 10*1024*1024 };
\f /* Internal driver state */
#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"
#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;
#define VIR_FROM_THIS VIR_FROM_SECURITY
+VIR_LOG_INIT("security.security_driver");
+
static virSecurityDriverPtr security_drivers[] = {
#ifdef WITH_SECDRIVER_SELINUX
&virSecurityDriverSELinux,
#define VIR_FROM_THIS VIR_FROM_SECURITY
+VIR_LOG_INIT("security.security_manager");
struct _virSecurityManager {
virObjectLockable parent;
#define VIR_FROM_THIS VIR_FROM_SECURITY
+VIR_LOG_INIT("security.security_selinux");
+
#define MAX_CONTEXT 1024
typedef struct _virSecuritySELinuxData virSecuritySELinuxData;
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend");
+
static virStorageBackendPtr backends[] = {
#if WITH_STORAGE_DIR
&virStorageBackendDirectory,
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_disk");
+
#define PARTHELPER LIBEXECDIR "/libvirt_parthelper"
#define SECTOR_SIZE 512
#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 &\
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_gluster");
+
struct _virStorageBackendGlusterState {
glfs_t *vol;
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_iscsi");
+
#define ISCSI_DEFAULT_TARGET_PORT 3260
static char *
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_logical");
+
#define PV_BLANK_SECTOR_SIZE 512
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_mpath");
+
static int
virStorageBackendMpathUpdateVolTargetInfo(virStorageVolTargetPtr target,
unsigned long long *allocation,
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_backend_rbd");
+
struct _virStorageBackendRBDState {
rados_t cluster;
rados_ioctx_t ioctx;
#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.
#include "storage_conf.h"
#include "vircommand.h"
#include "viralloc.h"
-#include "virlog.h"
#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("storage.storage_driver");
+
static virStorageDriverStatePtr driverState;
static int storageStateCleanup(void);
#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;
#define VIR_FROM_THIS VIR_FROM_UML
+VIR_LOG_INIT("uml.uml_conf");
virCapsPtr umlCapsInit(void) {
virCapsPtr caps;
#define VIR_FROM_THIS VIR_FROM_UML
+VIR_LOG_INIT("uml.uml_driver");
+
/* For storing short-lived temporary files. */
#define TEMPDIR LOCALSTATEDIR "/cache/libvirt"
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.alloc");
+
#if TEST_OOM
static int testMallocNext = 0;
static int testMallocFailFirst = 0;
#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;
#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
#define VIR_FROM_THIS VIR_FROM_AUTH
+VIR_LOG_INIT("util.auth");
+
int
virAuthGetConfigFilePathURI(virURIPtr uri,
char **path)
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.authconfig");
virAuthConfigPtr virAuthConfigNew(const char *path)
{
#include "nodeinfo.h"
+VIR_LOG_INIT("util.cgroup");
+
#define CGROUP_MAX_VAL 512
#define VIR_FROM_THIS VIR_FROM_CGROUP
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.closecallbacks");
+
typedef struct _virDriverCloseDef virDriverCloseDef;
typedef virDriverCloseDef *virDriverCloseDefPtr;
struct _virDriverCloseDef {
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.command");
+
/* Flags for virExec */
enum {
VIR_EXEC_NONE = 0,
#define VIR_FROM_THIS VIR_FROM_CONF
+VIR_LOG_INIT("util.conf");
+
/************************************************************************
* *
* Structures and macros used by the mini parser *
#define VIR_FROM_THIS VIR_FROM_DBUS
+VIR_LOG_INIT("util.dbus");
+
#ifdef WITH_DBUS
static bool sharedBus = true;
#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"
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.ebtables");
+
#if HAVE_FIREWALLD
static char *firewall_cmd_path = NULL;
#include "virutil.h"
#include "virstring.h"
+VIR_LOG_INIT("util.error");
+
virThreadLocal virLastErr;
virErrorFunc virErrorHandler = NULL; /* global error handler */
#include <stdlib.h>
+VIR_LOG_INIT("util.event");
+
static virEventAddHandleFunc addHandleImpl = NULL;
static virEventUpdateHandleFunc updateHandleImpl = NULL;
static virEventRemoveHandleFunc removeHandleImpl = NULL;
#define VIR_FROM_THIS VIR_FROM_EVENT
+VIR_LOG_INIT("util.eventpoll");
+
static int virEventPollInterruptLocked(void);
/* State for a single file handle being monitored */
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.file");
+
int virFileClose(int *fdptr, virFileCloseFlags flags)
{
int saved_errno = 0;
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.hash");
+
#define MAX_HASH_LEN 8
/* #define DEBUG_GROW */
#define VIR_FROM_THIS VIR_FROM_HOOK
+VIR_LOG_INIT("util.hook");
+
#define LIBVIRT_HOOK_DIR SYSCONFDIR "/libvirt/hooks"
VIR_ENUM_DECL(virHookDriver)
#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 */
#define VIR_FROM_THIS VIR_FROM_IDENTITY
+VIR_LOG_INIT("util.identity");
struct _virIdentity {
virObject parent;
#include "virstring.h"
#include "virutil.h"
+VIR_LOG_INIT("util.iptables");
+
bool iptables_supports_xlock = false;
#if HAVE_FIREWALLD
/* XXX fixme */
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.json");
typedef struct _virJSONParserState virJSONParserState;
typedef virJSONParserState *virJSONParserStatePtr;
#define VIR_FROM_THIS VIR_FROM_CONF
+VIR_LOG_INIT("util.keyfile");
+
typedef struct _virKeyFileGroup virKeyFileGroup;
typedef virKeyFileGroup *virKeyFileGroupPtr;
#define VIR_FROM_THIS VIR_FROM_LOCKSPACE
+VIR_LOG_INIT("util.lockspace");
+
#define VIR_LOCKSPACE_TABLE_SIZE 10
typedef struct _virLockSpaceResource virLockSpaceResource;
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.log");
+
/*
* A logging buffer to keep some history over logs
*/
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
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
#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,
# include "virnetdev.h"
# include "virpidfile.h"
+VIR_LOG_INIT("util.netdevmacvlan");
# define MACVTAP_NAME_PREFIX "macvtap"
# define MACVTAP_NAME_PATTERN "macvtap%d"
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.netdevtap");
+
/**
* virNetDevTapGetName:
* @tapfd: a tun/tap file descriptor
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.netdevveth");
+
/* Functions */
virMutex virNetDevVethCreateMutex;
# include "virlog.h"
# include "virnetdev.h"
+VIR_LOG_INIT("util.netdevvportprofile");
+
# define MICROSEC_PER_SEC (1000 * 1000)
# define NLMSGBUF_SIZE 256
#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)
#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 */
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.numa");
+
VIR_ENUM_IMPL(virDomainNumatuneMemMode,
VIR_DOMAIN_NUMATUNE_MEM_LAST,
"strict",
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.object");
+
static unsigned int magicCounter = 0xCAFE0000;
struct _virClass {
#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" */
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.pidfile");
+
char *virPidFileBuildPath(const char *dir, const char* name)
{
char *pidfile;
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.process");
+
/**
* virProcessTranslateStatus:
* @status: child exit status to translate
#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
#include <unistd.h>
#include "virscsi.h"
-#include "virlog.h"
#include "viralloc.h"
#include "virfile.h"
#include "virutil.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
+VIR_LOG_INIT("util.storagefile");
+
VIR_ENUM_IMPL(virStorageFileFormat,
VIR_STORAGE_FILE_LAST,
"none",
#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,
#include "virerror.h"
#include "virsysinfo.h"
-#include "virlog.h"
#include "viralloc.h"
#include "vircommand.h"
#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_SYSTEMD
+VIR_LOG_INIT("util.systemd");
static void virSystemdEscapeName(virBufferPtr buf,
const char *name)
/* For virReportOOMError() and virReportSystemError() */
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.usb");
+
struct _virUSBDevice {
unsigned int bus;
unsigned int dev;
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.util");
+
#ifndef WIN32
int virSetInherit(int fd, bool inherit) {
#include "virfile.h"
#include "virrandom.h"
+VIR_LOG_INIT("util.uuid");
+
#ifndef ENODATA
# define ENODATA EIO
#endif
#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"
#define VIR_FROM_THIS VIR_FROM_VBOX
+VIR_LOG_INIT("vbox.vbox_XPCOMCGlue");
/*******************************************************************************
* Defined Constants And Macros *
#define VIR_FROM_THIS VIR_FROM_VBOX
+VIR_LOG_INIT("vbox.vbox_driver");
extern virDriver vbox22Driver;
extern virNetworkDriver vbox22NetworkDriver;
#define VIR_FROM_THIS VIR_FROM_VBOX
+
+VIR_LOG_INIT("vbox.vbox_tmpl");
+
#define VBOX_UTF16_FREE(arg) \
do { \
if (arg) { \
#include "viruri.h"
#include "virstring.h"
+VIR_LOG_INIT("vmx.vmx");
+
/*
mapping:
#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
#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.
#define VIR_FROM_THIS VIR_FROM_XEN_INOTIFY
+VIR_LOG_INIT("xen.xen_inotify");
+
static int
xenInotifyXenCacheLookup(virConnectPtr conn,
const char *filename,
#define VIR_FROM_THIS VIR_FROM_XEND
+VIR_LOG_INIT("xen.xend_internal");
+
/*
* The number of Xen scheduler parameters
*/
#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
#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);
#include "xenapi_utils.h"
#include "virstring.h"
+VIR_LOG_INIT("xenapi.xenapi_utils");
+
void
xenSessionFree(xen_session *session)
{
#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)
{
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.domainconftest");
+
static virCapsPtr caps;
static virDomainXMLOptionPtr xmlopt;
#include "virutil.h"
#include "vireventpoll.h"
+VIR_LOG_INIT("tests.eventtest");
+
#define NUM_FDS 31
#define NUM_TIME 31
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.fdstreamtest");
+
#define PATTERN_LEN 256
static int testFDStreamReadCommon(const char *scratchdir, bool blocking)
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.libvirtdconftest");
+
struct testCorruptData {
size_t *params;
const char *filedata;
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.qemumonitortestutils");
+
struct _qemuMonitorTestItem {
qemuMonitorTestResponseCallback cb;
void *opaque;
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.securityselinuxlabeltest");
+
static virCapsPtr caps;
static virDomainXMLOptionPtr xmlopt;
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.securityselinuxtest");
+
struct testSELinuxGenLabelData {
virSecurityManagerPtr mgr;
#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;
#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 + \
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.authconfigtest");
+
struct ConfigLookupData {
virAuthConfigPtr config;
const char *hostname;
# define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.cgrouptest");
+
static int validateCgroup(virCgroupPtr cgroup,
const char *expectPath,
const char **expectMountPoint,
#include "virlog.h"
#include "testutils.h"
+VIR_LOG_INIT("tests.dbustest");
+
#define VERIFY(typname, valorig, valnew, fmt) \
do { \
VIR_DEBUG("Compare " typname " '" fmt "' to '" \
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.drivermoduletest");
+
struct testDriverData {
const char *name;
const char *dep1;
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.hashtest");
+
#define testError(...) \
do { \
char *str; \
# 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, \
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.identitytest");
static int testIdentityAttrs(const void *data ATTRIBUTE_UNUSED)
{
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.keycodetest");
static int testKeycodeMapping(const void *data ATTRIBUTE_UNUSED)
{
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.keyfiletest");
static int testParse(const void *args ATTRIBUTE_UNUSED)
{
#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)
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.netmessagetest");
+
static int testMessageHeaderEncode(const void *args ATTRIBUTE_UNUSED)
{
virNetMessagePtr msg = virNetMessageNew(true);
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.netsockettest");
+
#if HAVE_IFADDRS_H
# define BASE_PORT 5672
# define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.nettlscontexttest");
+
# define KEYFILE "key-ctx.pem"
struct testTLSContextData {
# 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
# define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.nettlssessiontest");
+
# define KEYFILE "key-sess.pem"
struct testTLSSessionData {
# define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.portallocatortest");
static int testAllocAll(const void *args ATTRIBUTE_UNUSED)
{
#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:
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("tests.stringtest");
+
struct testSplitData {
const char *string;
const char *delim;
# 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] = {
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.timetest");
+
struct testTimeFieldsData {
unsigned long long when;
struct tm fields;
#define VIR_FROM_THIS VIR_FROM_RPC
+VIR_LOG_INIT("tests.uritest");
+
struct URIParseData {
const char *uri;
const char *uri_out;
# 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.