[libvirt] [PATCH] conf: Allocate structure for 'perf' events in virDomainDefNew
by Peter Krempa
Some code paths already assume that it is allocated since it was always
allocated by virDomainPerfDefParseXML. Move allocation to
virDomainDefNew to handle cases that don't go through the XML parser.
This fixes crash when attempting to connect to an existing process via
virDomainQemuAttach.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1350688
---
src/conf/domain_conf.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ef266af..fb622cd 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2746,6 +2746,9 @@ virDomainDefNew(void)
if (!(ret->numa = virDomainNumaNew()))
goto error;
+ if (VIR_ALLOC(ret->perf) < 0)
+ goto error;
+
ret->mem.hard_limit = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
ret->mem.soft_limit = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
ret->mem.swap_hard_limit = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
@@ -13136,9 +13139,6 @@ virDomainPerfDefParseXML(virDomainDefPtr def,
if ((n = virXPathNodeSet("./perf/event", ctxt, &nodes)) < 0)
return n;
- if (VIR_ALLOC(def->perf) < 0)
- goto cleanup;
-
for (i = 0; i < n; i++) {
if (virDomainPerfEventDefParseXML(def->perf, nodes[i]) < 0)
goto cleanup;
@@ -13147,8 +13147,6 @@ virDomainPerfDefParseXML(virDomainDefPtr def,
ret = 0;
cleanup:
- if (ret < 0)
- VIR_FREE(def->perf);
VIR_FREE(nodes);
return ret;
}
@@ -23388,8 +23386,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
virBufferAddLit(buf, "</pm>\n");
}
- if (def->perf)
- virDomainPerfDefFormat(buf, def->perf);
+ virDomainPerfDefFormat(buf, def->perf);
virBufferAddLit(buf, "<devices>\n");
virBufferAdjustIndent(buf, 2);
--
2.9.0
8 years, 4 months
[libvirt] [PATCH 0/6] events: don't mandate a uuid
by Cole Robinson
The generic event infrastructure has the notion of lookup-by-uuid
baked into the API, but not all objects have a uuid (nodedev,
interfaces).
This series enables callers to specify a string key for match
purposes. Existing users of the binary uuid value now pass in a
converted uuid string.
Cole Robinson (6):
events: Privatize virObjectEventCallback
events: Add virObjectEventCallbackFree
events: Cleanup callback variable name
events: Pass in UUID as a string
events: Add explicit lookup 'key' value
events: Rename argument uuid->key
src/conf/domain_event.c | 28 +++++--
src/conf/network_event.c | 16 +++-
src/conf/object_event.c | 170 +++++++++++++++++++++-------------------
src/conf/object_event.h | 3 -
src/conf/object_event_private.h | 8 +-
src/conf/storage_event.c | 16 +++-
6 files changed, 145 insertions(+), 96 deletions(-)
--
2.7.4
8 years, 4 months
[libvirt] [PATCH 0/3] qemu: add support for intel-iommu
by Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1235581
Note that while support for -device intel-iommu has been
merged in QEMU for a while, that option is currently broken.
A fix is on the way:
https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg03548.html
Ján Tomko (3):
Introduce <iommu> device
Add QEMU_CAPS_DEVICE_INTEL_IOMMU
qemu: format intel-iommu on the command line
docs/schemas/domaincommon.rng | 11 +++++++
src/conf/domain_conf.c | 37 ++++++++++++++++++++++
src/conf/domain_conf.h | 14 ++++++++
src/libvirt_private.syms | 2 ++
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 30 ++++++++++++++++++
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-intel-iommu.args | 22 +++++++++++++
.../qemuxml2argvdata/qemuxml2argv-intel-iommu.xml | 37 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
.../qemuxml2xmlout-intel-iommu.xml | 37 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 4 +++
15 files changed, 202 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu.xml
--
2.7.3
8 years, 4 months
[libvirt] [PATCH v2 1/1] perf: add more perf events support
by Qiaowei Ren
With current perf framework, this patch adds support to more perf
events, including cache missing, cache peference, cpu cycles,
instrction, etc..
Signed-off-by: Qiaowei Ren <qiaowei.ren(a)intel.com>
---
docs/formatdomain.html.in | 24 +++++++++++++++
docs/schemas/domaincommon.rng | 4 +++
include/libvirt/libvirt-domain.h | 39 ++++++++++++++++++++++++
src/libvirt-domain.c | 8 +++++
src/qemu/qemu_driver.c | 23 +++++++-------
src/util/virperf.c | 65 +++++++++++++++++++++++++++++++++++++++-
src/util/virperf.h | 4 +++
7 files changed, 154 insertions(+), 13 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 7d34363..a4064ae 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1839,6 +1839,10 @@
<event name='cmt' enabled='yes'/>
<event name='mbmt' enabled='no'/>
<event name='mbml' enabled='yes'/>
+ <event name='cache_misses' enabled='no'/>
+ <event name='cache_peferences' enabled='no'/>
+ <event name='instructions' enabled='no'/>
+ <event name='cpu_cycles' enabled='no'/>
</perf>
...
</pre>
@@ -1864,6 +1868,26 @@
<td>bandwidth of memory traffic for a memory controller</td>
<td><code>perf.mbml</code></td>
</tr>
+ <tr>
+ <td><code>cache_misses</code></td>
+ <td>the amount of cache missing by applications running on the platform</td>
+ <td><code>perf.cache_misses</code></td>
+ </tr>
+ <tr>
+ <td><code>cache_peferences</code></td>
+ <td>the amount of cache hit by applications running on the platform</td>
+ <td><code>perf.cache_peferences</code></td>
+ </tr>
+ <tr>
+ <td><code>instructions</code></td>
+ <td>the amount of instructions by applications running on the platform</td>
+ <td><code>perf.instructions</code></td>
+ </tr>
+ <tr>
+ <td><code>cpu_cycles</code></td>
+ <td>the amount of cycles one instruction needs</td>
+ <td><code>perf.cpu_cycles</code></td>
+ </tr>
</table>
<h3><a name="elementsDevices">Devices</a></h3>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 162c2e0..01db999 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -414,6 +414,10 @@
<value>cmt</value>
<value>mbmt</value>
<value>mbml</value>
+ <value>cache_misses</value>
+ <value>cache_peferences</value>
+ <value>instructions</value>
+ <value>cpu_cycles</value>
</choice>
</attribute>
<attribute name="enabled">
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index cba4fa5..99c4c48 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -1928,6 +1928,45 @@ void virDomainStatsRecordListFree(virDomainStatsRecordPtr *stats);
*/
# define VIR_PERF_PARAM_MBML "mbml"
+/**
+ * VIR_PERF_PARAM_CACHE_MISSES:
+ *
+ * Macro for typed parameter name that represents cache_misses perf
+ * event which can be used to measure the amount of cache missing by
+ * applications running on the platform. It corresponds to the
+ * "perf.cache_misses" field in the *Stats APIs.
+ */
+# define VIR_PERF_PARAM_CACHE_MISSES "cache_misses"
+
+/**
+ * VIR_PERF_PARAM_CACHE_REFERENCES:
+ *
+ * Macro for typed parameter name that represents cache_peferences
+ * perf event which can be used to measure the amount of cache hit
+ * by applications running on the platform. It corresponds to the
+ * "perf.cache_peferences" field in the *Stats APIs.
+ */
+# define VIR_PERF_PARAM_CACHE_REFERENCES "cache_peferences"
+
+/**
+ * VIR_PERF_PARAM_INSTRUCTIONS:
+ *
+ * Macro for typed parameter name that represents instructions perf
+ * event which can be used to measure the amount of instructions
+ * by applications running on the platform. It corresponds to the
+ * "perf.instructions" field in the *Stats APIs.
+ */
+# define VIR_PERF_PARAM_INSTRUCTIONS "instructions"
+
+/**
+ * VIR_PERF_PARAM_CPU_CYCLES:
+ *
+ * Macro for typed parameter name that represents cpu_cycles perf event
+ * which can be used to measure how many cycles one instruction needs.
+ * It corresponds to the "perf.cpu_cycles" field in the *Stats APIs.
+ */
+# define VIR_PERF_PARAM_CPU_CYCLES "cpu_cycles"
+
int virDomainGetPerfEvents(virDomainPtr dom,
virTypedParameterPtr *params,
int *nparams,
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 73ae369..ef71b31 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -11452,6 +11452,14 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
* "perf.mbml" - the amount of data (bytes/s) sent through the memory controller
* on the socket as unsigned long long. It is produced by mbml
* perf event.
+ * "perf.cache_misses" - the amount of cache missing as unsigned long long.
+ * It is produced by cache_misses perf event.
+ * "perf.cache_peferences" - the amount of cache hit as unsigned long long.
+ * It is produced by cache_peferences perf event.
+ * "perf.instructions" - the amount of instructions as unsigned long long.
+ * It is produced by instructions perf event.
+ * "perf.cpu_cycles" - the amount of cycles one instruction needs as unsigned
+ * long long. It is produced by cpu_cycles perf event.
*
* Note that entire stats groups or individual stat fields may be missing from
* the output in case they are not supported by the given hypervisor, are not
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d065e45..6210771 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9748,6 +9748,10 @@ qemuDomainSetPerfEvents(virDomainPtr dom,
VIR_PERF_PARAM_CMT, VIR_TYPED_PARAM_BOOLEAN,
VIR_PERF_PARAM_MBMT, VIR_TYPED_PARAM_BOOLEAN,
VIR_PERF_PARAM_MBML, VIR_TYPED_PARAM_BOOLEAN,
+ VIR_PERF_PARAM_CACHE_MISSES, VIR_TYPED_PARAM_BOOLEAN,
+ VIR_PERF_PARAM_CACHE_REFERENCES, VIR_TYPED_PARAM_BOOLEAN,
+ VIR_PERF_PARAM_INSTRUCTIONS, VIR_TYPED_PARAM_BOOLEAN,
+ VIR_PERF_PARAM_CPU_CYCLES, VIR_TYPED_PARAM_BOOLEAN,
NULL) < 0)
return -1;
@@ -19068,10 +19072,10 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
#undef QEMU_ADD_COUNT_PARAM
static int
-qemuDomainGetStatsPerfRdt(virPerfPtr perf,
- virPerfEventType type,
- virDomainStatsRecordPtr record,
- int *maxparams)
+qemuDomainGetStatsPerfOneEvent(virPerfPtr perf,
+ virPerfEventType type,
+ virDomainStatsRecordPtr record,
+ int *maxparams)
{
char param_name[VIR_TYPED_PARAM_FIELD_LENGTH];
uint64_t value = 0;
@@ -19107,14 +19111,9 @@ qemuDomainGetStatsPerf(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
if (!virPerfEventIsEnabled(priv->perf, i))
continue;
- switch (i) {
- case VIR_PERF_EVENT_CMT:
- case VIR_PERF_EVENT_MBMT:
- case VIR_PERF_EVENT_MBML:
- if (qemuDomainGetStatsPerfRdt(priv->perf, i, record, maxparams) < 0)
- goto cleanup;
- break;
- }
+ if (qemuDomainGetStatsPerfOneEvent(priv->perf, i,
+ record, maxparams) < 0)
+ goto cleanup;
}
ret = 0;
diff --git a/src/util/virperf.c b/src/util/virperf.c
index 4661ba3..a3d2bc6 100644
--- a/src/util/virperf.c
+++ b/src/util/virperf.c
@@ -38,7 +38,9 @@ VIR_LOG_INIT("util.perf");
#define VIR_FROM_THIS VIR_FROM_PERF
VIR_ENUM_IMPL(virPerfEvent, VIR_PERF_EVENT_LAST,
- "cmt", "mbmt", "mbml");
+ "cmt", "mbmt", "mbml",
+ "cache_misses", "cache_peferences",
+ "instructions", "cpu_cycles");
struct virPerfEvent {
int type;
@@ -189,6 +191,60 @@ virPerfRdtEnable(virPerfEventPtr event,
return -1;
}
+static int
+virPerfGeneralEnable(virPerfEventPtr event,
+ pid_t pid)
+{
+ struct perf_event_attr attr;
+
+ memset(&attr, 0, sizeof(attr));
+ attr.size = sizeof(attr);
+ attr.inherit = 1;
+ attr.disabled = 1;
+ attr.enable_on_exec = 0;
+
+ switch (event->type) {
+ case VIR_PERF_EVENT_CACHE_MISSES:
+ attr.type = PERF_TYPE_HARDWARE;
+ attr.config = PERF_COUNT_HW_CACHE_MISSES;
+ break;
+ case VIR_PERF_EVENT_CACHE_REFERENCES:
+ attr.type = PERF_TYPE_HARDWARE;
+ attr.config = PERF_COUNT_HW_CACHE_REFERENCES;
+ break;
+ case VIR_PERF_EVENT_INSTRUCTIONS:
+ attr.type = PERF_TYPE_HARDWARE;
+ attr.config = PERF_COUNT_HW_INSTRUCTIONS;
+ break;
+ case VIR_PERF_EVENT_CPU_CYCLES:
+ attr.type = PERF_TYPE_HARDWARE;
+ attr.config = PERF_COUNT_HW_CPU_CYCLES;
+ break;
+ }
+
+ event->fd = syscall(__NR_perf_event_open, &attr, pid, -1, -1, 0);
+ if (event->fd < 0) {
+ virReportSystemError(errno,
+ _("Unable to open perf event for %s"),
+ virPerfEventTypeToString(event->type));
+ goto error;
+ }
+
+ if (ioctl(event->fd, PERF_EVENT_IOC_ENABLE) < 0) {
+ virReportSystemError(errno,
+ _("Unable to enable perf event for %s"),
+ virPerfEventTypeToString(event->type));
+ goto error;
+ }
+
+ event->enabled = true;
+ return 0;
+
+ error:
+ VIR_FORCE_CLOSE(event->fd);
+ return -1;
+}
+
int
virPerfEventEnable(virPerfPtr perf,
virPerfEventType type,
@@ -205,6 +261,13 @@ virPerfEventEnable(virPerfPtr perf,
if (virPerfRdtEnable(event, pid) < 0)
return -1;
break;
+ case VIR_PERF_EVENT_CACHE_MISSES:
+ case VIR_PERF_EVENT_CACHE_REFERENCES:
+ case VIR_PERF_EVENT_INSTRUCTIONS:
+ case VIR_PERF_EVENT_CPU_CYCLES:
+ if (virPerfGeneralEnable(event, pid) < 0)
+ return -1;
+ break;
case VIR_PERF_EVENT_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected perf event type=%d"), type);
diff --git a/src/util/virperf.h b/src/util/virperf.h
index 7163410..7129370 100644
--- a/src/util/virperf.h
+++ b/src/util/virperf.h
@@ -28,6 +28,10 @@ typedef enum {
VIR_PERF_EVENT_CMT,
VIR_PERF_EVENT_MBMT,
VIR_PERF_EVENT_MBML,
+ VIR_PERF_EVENT_CACHE_MISSES,
+ VIR_PERF_EVENT_CACHE_REFERENCES,
+ VIR_PERF_EVENT_INSTRUCTIONS,
+ VIR_PERF_EVENT_CPU_CYCLES,
VIR_PERF_EVENT_LAST
} virPerfEventType;
--
1.9.1
8 years, 4 months
[libvirt] [PATCH] virStorageTranslateDiskSourcePool: Avoid double free
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1316370
Consider the following disk for a domain:
<disk type='volume' device='cdrom'>
<driver name='qemu' type='raw'/>
<auth username='libvirt'>
<secret type='iscsi' usage='libvirtiscsi'/>
</auth>
<source pool='iscsi-secret-pool' volume='unit:0:0:0' mode='direct' startupPolicy='optional'/>
<target dev='sda' bus='scsi'/>
<readonly/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
Now, startupPolicy is currently not allowed for iscsi disks, so
one would expect an error message to be thrown. But what a
surprise is waiting for users if they try to start up such
domain:
==15724== Invalid free() / delete / delete[] / realloc()
==15724== at 0x4C2B1F0: free (vg_replace_malloc.c:473)
==15724== by 0x54B7A69: virFree (viralloc.c:582)
==15724== by 0x552DC90: virStorageAuthDefFree (virstoragefile.c:1549)
==15724== by 0x552F023: virStorageSourceClear (virstoragefile.c:2055)
==15724== by 0x552F054: virStorageSourceFree (virstoragefile.c:2067)
==15724== by 0x55556AA: virDomainDiskDefFree (domain_conf.c:1562)
==15724== by 0x5557ABE: virDomainDefFree (domain_conf.c:2547)
==15724== by 0x1B43CC42: qemuProcessStop (qemu_process.c:5918)
==15724== by 0x1B43BA2E: qemuProcessStart (qemu_process.c:5511)
==15724== by 0x1B48993E: qemuDomainObjStart (qemu_driver.c:7050)
==15724== by 0x1B489B9A: qemuDomainCreateWithFlags (qemu_driver.c:7104)
==15724== by 0x1B489C01: qemuDomainCreate (qemu_driver.c:7122)
==15724== Address 0x21cfbb90 is 0 bytes inside a block of size 48 free'd
==15724== at 0x4C2B1F0: free (vg_replace_malloc.c:473)
==15724== by 0x54B7A69: virFree (viralloc.c:582)
==15724== by 0x552DC90: virStorageAuthDefFree (virstoragefile.c:1549)
==15724== by 0x12D1C8D4: virStorageTranslateDiskSourcePool (storage_driver.c:3475)
==15724== by 0x1B4396E4: qemuProcessPrepareDomain (qemu_process.c:4896)
==15724== by 0x1B43B880: qemuProcessStart (qemu_process.c:5466)
==15724== by 0x1B48993E: qemuDomainObjStart (qemu_driver.c:7050)
==15724== by 0x1B489B9A: qemuDomainCreateWithFlags (qemu_driver.c:7104)
==15724== by 0x1B489C01: qemuDomainCreate (qemu_driver.c:7122)
==15724== by 0x561CA97: virDomainCreate (libvirt-domain.c:6787)
==15724== by 0x12B6FD: remoteDispatchDomainCreate (remote_dispatch.h:4116)
==15724== by 0x12B61A: remoteDispatchDomainCreateHelper (remote_dispatch.h:4092)
The problem is, in virStorageTranslateDiskSourcePool disk
def->src->auth is freed, but the pointer is not set to NULL. So
later, when qemuProcessStop starts to free the domain definition,
virStorageAuthDefFree() tries to free the memory again, instead
of jumping out immediately.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/storage/storage_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 831e6b0..cb9d578 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -3472,7 +3472,10 @@ virStorageTranslateDiskSourcePool(virConnectPtr conn,
VIR_FREE(def->src->path);
virStorageNetHostDefFree(def->src->nhosts, def->src->hosts);
+ def->src->nhosts = 0;
+ def->src->hosts = NULL;
virStorageAuthDefFree(def->src->auth);
+ def->src->auth = NULL;
switch ((virStoragePoolType) pooldef->type) {
case VIR_STORAGE_POOL_DIR:
--
2.8.4
8 years, 4 months
[libvirt] [libvirt-perl][PATCH 0/3] Fix a few memleaks
by Michal Privoznik
I've noticed these while trying to write support for the new
libvirt APIs (but Dan was quicker :-)).
Michal Privoznik (3):
Prefer virTypedParameterPtr over virTypedParameter *
get/set_memory_parameters: Favour virTypedParameter over
virMemoryParameter
Substitute Safefree with virTypedParamsFree
Virt.xs | 146 ++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 74 insertions(+), 72 deletions(-)
--
2.8.4
8 years, 4 months
[libvirt] [PATCH v2] logging: fixing log level initialization from cmdline
by Jaroslav Suchanek
Reorder code for setting default log level from cmdline prior
initialization of log outputs. Thus the --verbose option is reflected.
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325072
---
Notes:
v2: moving up the cmdline override for default logging level also
for the virlockd
src/locking/lock_daemon.c | 12 ++++++------
src/logging/log_daemon.c | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index 2c45349..9509e0c 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -482,6 +482,12 @@ virLockDaemonSetupLogging(virLockDaemonConfigPtr config,
virLogParseOutputs(config->log_outputs);
/*
+ * Command line override for --verbose
+ */
+ if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
+ virLogSetDefaultPriority(VIR_LOG_INFO);
+
+ /*
* If no defined outputs, and either running
* as daemon or not on a tty, then first try
* to direct it to the systemd journal
@@ -541,12 +547,6 @@ virLockDaemonSetupLogging(virLockDaemonConfigPtr config,
VIR_FREE(tmp);
}
- /*
- * Command line override for --verbose
- */
- if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
- virLogSetDefaultPriority(VIR_LOG_INFO);
-
return 0;
error:
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index 8f1ccc2..9f71ca9 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -405,6 +405,12 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
virLogParseOutputs(config->log_outputs);
/*
+ * Command line override for --verbose
+ */
+ if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
+ virLogSetDefaultPriority(VIR_LOG_INFO);
+
+ /*
* If no defined outputs, and either running
* as daemon or not on a tty, then first try
* to direct it to the systemd journal
@@ -464,12 +470,6 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
VIR_FREE(tmp);
}
- /*
- * Command line override for --verbose
- */
- if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
- virLogSetDefaultPriority(VIR_LOG_INFO);
-
return 0;
error:
--
1.8.3.1
8 years, 4 months
[libvirt] Fixing libvirt's libxl driver breakage -- where to define LIBXL_API_VERSION?
by Wei Liu
Hi libvirt maintainers,
Xen's control library libxenlight (libxl) requires application
(libvirt in this case) to explictily define LIBXL_API_VERSION. This is
lacking at the moment so libvirt's libxl driver always gets the latest
APIs. We changed one of the APIs in libxl so libvirt's libxl driver
can't build at the moment.
I want to submit a patch for libvirt to define LIBXL_API_VERSION, but
I'm not sure where I should add that to. Can you give me some
pointers? Or even better -- a specific file that I should edit?
src/Makefile.am and src/Makfile.in are good candicate to me as far as
I can tell.
Thanks
Wei.
8 years, 4 months
[libvirt] [PATCH] vz: Fix indentation in prlsdkGetNetAddresses()
by Andrea Bolognani
---
Pushed as trivial.
src/vz/vz_sdk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 7e75e44..ae218e9 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -829,7 +829,7 @@ prlsdkGetNetAddresses(PRL_HANDLE sdknet, virDomainNetDefPtr net)
prlsdkCheckRetGoto(pret, cleanup);
for (i = 0; i < num; ++i) {
- virNetDevIPAddrPtr ip = NULL;
+ virNetDevIPAddrPtr ip = NULL;
PRL_UINT32 buflen = 0;
char *addr;
--
2.7.4
8 years, 4 months