[libvirt] [PATCH] network: restart dnsmasq after adding/removing txt and srv records
by Laine Stump
Although dns host records are stored in a separate configuration file
that is reread by dnsmasq when it receives a SIGHUP, the txt and srv
records are directly in the dnsmasq .conf file which can't be reread
after initial dnsmasq startup. This means that if an srv or txt record
is modified in a network config, libvirt needs to restart the dnsmasq
process rather than just sending a SIGHUP.
This was pointed out in a question in
https://bugzilla.redhat.com/show_bug.cgi?id=988718 , but no separate
BZ was filed.
---
src/network/bridge_driver.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 0fd2095..7c8d2cc 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3404,9 +3404,14 @@ networkUpdate(virNetworkPtr net,
if (section == VIR_NETWORK_SECTION_BRIDGE ||
section == VIR_NETWORK_SECTION_DOMAIN ||
section == VIR_NETWORK_SECTION_IP ||
- section == VIR_NETWORK_SECTION_IP_DHCP_RANGE) {
- /* these sections all change things on the dnsmasq commandline,
- * so we need to kill and restart dnsmasq.
+ section == VIR_NETWORK_SECTION_IP_DHCP_RANGE ||
+ section == VIR_NETWORK_SECTION_DNS_TXT ||
+ section == VIR_NETWORK_SECTION_DNS_SRV) {
+ /* these sections all change things on the dnsmasq
+ * commandline (i.e. in the .conf file), so we need to
+ * kill and restart dnsmasq, because dnsmasq sets its uid
+ * to "nobody" after it starts, and is unable to re-read
+ * the conf file (owned by root, mode 600)
*/
if (networkRestartDhcpDaemon(driver, network) < 0)
goto cleanup;
@@ -3434,12 +3439,10 @@ networkUpdate(virNetworkPtr net,
goto cleanup;
}
- } else if (section == VIR_NETWORK_SECTION_DNS_HOST ||
- section == VIR_NETWORK_SECTION_DNS_TXT ||
- section == VIR_NETWORK_SECTION_DNS_SRV) {
- /* these sections only change things in config files, so we
- * can just update the config files and send SIGHUP to
- * dnsmasq.
+ } else if (section == VIR_NETWORK_SECTION_DNS_HOST) {
+ /* this section only changes data in an external file
+ * (not the .conf file) so we can just update the config
+ * files and send SIGHUP to dnsmasq.
*/
if (networkRefreshDhcpDaemon(driver, network) < 0)
goto cleanup;
--
2.5.5
8 years, 10 months
[libvirt] [PATCH 0/2] qemu: expand domain memory statistics
by Derbyshev Dmitriy
From: Derbyshev Dmitry <dderbyshev(a)virtuozzo.com>
QEMU reports timestamp and available along with other memory statistics.
This information was not saved into domain statistics.
Derbyshev Dmitry (2):
qemu: expand domain memory statistics with 'usable'
qemu: expand domain memory statistics with 'last-update' timestamp
include/libvirt/libvirt-domain.h | 12 +++++++++++-
src/libvirt-domain.c | 5 +++++
src/qemu/qemu_monitor_json.c | 23 +++++++++++++----------
tools/virsh-domain-monitor.c | 4 ++++
4 files changed, 33 insertions(+), 11 deletions(-)
--
1.9.5.msysgit.0
8 years, 10 months
[libvirt] [PATCH] qemu: expand domain memory statistics with 'last-update' timestamp
by Derbyshev Dmitriy
From: Derbyshev Dmitry <dderbyshev(a)virtuozzo.com>
QEMU reports timestamp along with other memory statistics, but this information is not saved into domain statistics.
It could be useful to determine if the data reported is fresh or not.
Balloon statistics are not reported in hrf, so no modifications are made in qemu_monitor_text.c.
---
include/libvirt/libvirt-domain.h | 6 +++++-
src/libvirt-domain.c | 2 ++
src/qemu/qemu_monitor_json.c | 21 +++++++++++----------
tools/virsh-domain-monitor.c | 2 ++
4 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index e1d9a0d..51f9785 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -603,11 +603,15 @@ typedef enum {
* is in kB */
VIR_DOMAIN_MEMORY_STAT_RSS = 7,
+
+ /* Timestamp of the last update of statistics */
+ VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE = 8,
+
/*
* The number of statistics supported by this version of the interface.
* To add new statistics, add them to the enum and increase this value.
*/
- VIR_DOMAIN_MEMORY_STAT_NR = 8,
+ VIR_DOMAIN_MEMORY_STAT_NR = 9,
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_MEMORY_STAT_LAST = VIR_DOMAIN_MEMORY_STAT_NR
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 3e144b6..b1c7d73 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -5988,6 +5988,8 @@ virDomainGetInterfaceParameters(virDomainPtr domain,
* The total amount of memory available to the domain's OS (in kb).
* VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON:
* Current balloon value (in kb).
+ * VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE
+ * Timestamp of the last statistic
*
* Returns: The number of stats provided or -1 in case of failure.
*/
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index e767414..175ef10 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1602,10 +1602,10 @@ qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon,
* rates and/or whether data has been collected since a previous cycle.
* It's currently unused.
*/
-#define GET_BALLOON_STATS(FIELD, TAG, DIVISOR) \
- if (virJSONValueObjectHasKey(statsdata, FIELD) && \
+#define GET_BALLOON_STATS(OBJECT, FIELD, TAG, DIVISOR) \
+ if (virJSONValueObjectHasKey(OBJECT, FIELD) && \
(got < nr_stats)) { \
- if (virJSONValueObjectGetNumberUlong(statsdata, FIELD, &mem) < 0) { \
+ if (virJSONValueObjectGetNumberUlong(OBJECT, FIELD, &mem) < 0) { \
VIR_DEBUG("Failed to get '%s' value", FIELD); \
} else { \
/* Not being collected? No point in providing bad data */ \
@@ -1676,19 +1676,20 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
goto cleanup;
}
- GET_BALLOON_STATS("stat-swap-in",
+ GET_BALLOON_STATS(statsdata, "stat-swap-in",
VIR_DOMAIN_MEMORY_STAT_SWAP_IN, 1024);
- GET_BALLOON_STATS("stat-swap-out",
+ GET_BALLOON_STATS(statsdata, "stat-swap-out",
VIR_DOMAIN_MEMORY_STAT_SWAP_OUT, 1024);
- GET_BALLOON_STATS("stat-major-faults",
+ GET_BALLOON_STATS(statsdata, "stat-major-faults",
VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT, 1);
- GET_BALLOON_STATS("stat-minor-faults",
+ GET_BALLOON_STATS(statsdata, "stat-minor-faults",
VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT, 1);
- GET_BALLOON_STATS("stat-free-memory",
+ GET_BALLOON_STATS(statsdata, "stat-free-memory",
VIR_DOMAIN_MEMORY_STAT_UNUSED, 1024);
- GET_BALLOON_STATS("stat-total-memory",
+ GET_BALLOON_STATS(statsdata, "stat-total-memory",
VIR_DOMAIN_MEMORY_STAT_AVAILABLE, 1024);
-
+ GET_BALLOON_STATS(data, "last-update",
+ VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE, 1);
cleanup:
virJSONValueFree(cmd);
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 0a93949..3893b90 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -373,6 +373,8 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd)
vshPrint(ctl, "actual %llu\n", stats[i].val);
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_RSS)
vshPrint(ctl, "rss %llu\n", stats[i].val);
+ if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE)
+ vshPrint(ctl, "last_update %llu\n", stats[i].val);
}
ret = true;
--
1.9.5.msysgit.0
8 years, 10 months
[libvirt] [PATCH 0/3] Do not check for domain liveness in virDomainObjSetDefTransient
by Ján Tomko
virDomainObjSetDefTransient has an unintuitive attribute 'live':
when set to 'true', it ignores the virDomainObjIsActive test.
The most common usage is on domain startup, where most of the callers
want to create a transient definition even though the domain is not
yet active.
The only place where live=false is still required is
virDomainObjGetPersistentDef (and its usage could possibly be cleaned
up too, since it's only called in the drivers that already do SetDefTransient
on domain startup).
Split out the virDomainObjIsActive check into virDomainObjGetPersistentDef
and remove it for the rest of the callers along with the 'live' attribute.
Ján Tomko (3):
Clean up redundant usage of virDomainObjSetDefTransient
Check if the domain is active in virDomainObjGetPersistentDef
Do not check for domain liveness in virDomainObjSetDefTransient
src/conf/domain_conf.c | 15 ++++-----------
src/conf/domain_conf.h | 3 +--
src/libxl/libxl_domain.c | 3 +--
src/lxc/lxc_process.c | 6 +-----
src/qemu/qemu_process.c | 4 ++--
src/test/test_driver.c | 2 +-
src/uml/uml_driver.c | 5 ++---
7 files changed, 12 insertions(+), 26 deletions(-)
--
2.7.3
8 years, 10 months
[libvirt] [PATCH v5 0/2] qemu: Support for QXL heads
by Martin Kletzander
v5:
- Just a rebase, plus v4 had some hunk in that didn't belong there so
this one's cleaner to look at
- https://www.redhat.com/archives/libvir-list/2016-March/msg01436.html
v4:
- Added test case without "heads="
- Don't consolidate 'size_t i, j' declarations
v3:
- rebase on top of current master in order to cleanly apply
- https://www.redhat.com/archives/libvir-list/2016-March/msg01198.html
v2:
- don't change heads when migrating
- https://www.redhat.com/archives/libvir-list/2016-March/msg00811.html
v1:
- https://www.redhat.com/archives/libvir-list/2016-March/msg00410.html
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1283207
Martin Kletzander (2):
qemu: Check for qxl's max_outputs parameter
qemu: Add support to QXL's max_outputs parameter
src/qemu/qemu_capabilities.c | 5 ++
src/qemu/qemu_capabilities.h | 4 ++
src/qemu/qemu_command.c | 8 +++
src/qemu/qemu_migration.c | 64 ++++++++++++++++++++--
.../qemuxml2argv-video-qxl-heads.args | 28 ++++++++++
.../qemuxml2argv-video-qxl-heads.xml | 47 ++++++++++++++++
.../qemuxml2argv-video-qxl-noheads.args | 24 ++++++++
.../qemuxml2argv-video-qxl-noheads.xml | 39 +++++++++++++
tests/qemuxml2argvtest.c | 16 ++++++
.../qemuxml2xmlout-video-qxl-heads.xml | 47 ++++++++++++++++
.../qemuxml2xmlout-video-qxl-noheads.xml | 39 +++++++++++++
tests/qemuxml2xmltest.c | 3 +
12 files changed, 319 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-heads.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-heads.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-noheads.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-noheads.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-video-qxl-heads.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-video-qxl-noheads.xml
--
2.8.1
8 years, 10 months
[libvirt] [PATCH v3 0/2] Add support for zero-write detection
by Martin Kletzander
v3:
- I know Peter said he'll review it, but there are conflicts every
once in a while, so rebased version will apply cleanly for a while
- And it's actually not that big of a change to wait for some bigger
things to be designed, I believe =)
- https://www.redhat.com/archives/libvir-list/2016-April/msg01926.html
v2:
- use 'zeroes' instead of 'zeros'
- https://www.redhat.com/archives/libvir-list/2016-February/msg01146.html
v1:
- https://www.redhat.com/archives/libvir-list/2015-December/msg00511.html
Martin Kletzander (2):
conf: Add support of zero-detection for disks
qemu: Add support for zero-detection writes
docs/formatdomain.html.in | 10 +++++
docs/schemas/domaincommon.rng | 12 ++++++
src/conf/domain_conf.c | 21 +++++++++-
src/conf/domain_conf.h | 11 ++++++
src/libvirt_private.syms | 2 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 11 ++++++
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.6.0-1.caps | 1 +
.../qemuxml2argv-disk-drive-detect-zeroes.args | 27 +++++++++++++
.../qemuxml2argv-disk-drive-detect-zeroes.xml | 45 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 ++
.../qemuxml2xmlout-disk-drive-detect-zeroes.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
17 files changed, 149 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeroes.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeroes.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-detect-zeroes.xml
--
2.8.1
8 years, 10 months
[libvirt] [PATCH 0/6] Final round of build fixes
by Michal Privoznik
Hopefully.
Michal Privoznik (6):
virNetDevBridgeGet: Avoid NULL dereference
virDomainFormatSchedDef: Handle case when func returns NULL
esxStorageVolGetXMLDesc: Lookup SCSI lun properly
qemuMonitorTextGetAllBlockStatsInfo: Fix line validation
ppc64Compute: Avoid false positive
domain_conf: Avoid false positive
src/conf/domain_conf.c | 27 ++++++++++++++++++++++++---
src/cpu/cpu_ppc64.c | 12 +++++++++++-
src/esx/esx_storage_backend_iscsi.c | 4 ++--
src/qemu/qemu_monitor_text.c | 2 +-
src/util/virnetdevbridge.c | 6 +++++-
5 files changed, 43 insertions(+), 8 deletions(-)
--
2.8.3
8 years, 10 months
[libvirt] [libvirt-perl][PATCH 0/2] Catch up with latest libvirt
by Michal Privoznik
Two public constants are to be introduced in libvirt. While
touching that are of code, update documentation to a constant
of the same origin.
Michal Privoznik (2):
Add PERF_PARAM_MBML and PERF_PARAM_MBMT constants
Expand description for PERF_PARAM_CMT constant
Changes | 1 +
Virt.xs | 2 ++
lib/Sys/Virt/Domain.pm | 16 +++++++++++++++-
3 files changed, 18 insertions(+), 1 deletion(-)
--
2.8.3
8 years, 10 months
[libvirt] [PATCH 0/3] docs/website: drop some old bits
by Cole Robinson
Patches to drop the (busted) website search, (busted) static todo
list, and not-very-useful ChangeLog-old
Cole Robinson (3):
docs: website: remove search
docs: website: drop the static todo list page
docs: drop ChangeLog-old
.gitignore | 2 -
ChangeLog-old | 16699 ----------------------------------------------
Makefile.am | 1 -
TODO | 22 +-
docs/404.html.in | 9 +-
docs/Makefile.am | 31 +-
docs/devhelp/html.xsl | 4 -
docs/index.py | 1266 ----
docs/libvirt.css | 24 -
docs/page.xsl | 8 -
docs/search.php.code.in | 225 -
docs/search.php.in | 18 -
docs/sitemap.html.in | 2 +-
docs/todo.cfg-example | 26 -
docs/todo.pl | 125 -
15 files changed, 13 insertions(+), 18449 deletions(-)
delete mode 100644 ChangeLog-old
delete mode 100755 docs/index.py
delete mode 100644 docs/search.php.code.in
delete mode 100644 docs/search.php.in
delete mode 100644 docs/todo.cfg-example
delete mode 100755 docs/todo.pl
--
2.7.4
8 years, 10 months
[libvirt] [PATCH 0/2] Yet another round of build fixes
by Michal Privoznik
After these regular errors, I still cannot build cleanly:
../../src/conf/domain_conf.c: In function 'virDomainChrPreAlloc':
../../src/conf/domain_conf.c:14109:57: error: potential null pointer dereference [-Werror=null-dereference]
return VIR_REALLOC_N(*arrPtr, *cntPtr + 1);
^
../../src/conf/domain_conf.c: In function 'virDomainChrRemove':
../../src/conf/domain_conf.c:14133:21: error: potential null pointer dereference [-Werror=null-dereference]
for (i = 0; i < *cntPtr; i++) {
^~~~~~~
cc1: all warnings being treated as errors
These are obviously false positives. I know some developers here
are not very fond of fixing those, so my question is - is it
worth the effort or will my patches be NACKed straight away?
Michal Privoznik (2):
apibuild: Substitute only pure number tokens
virSocketAddrIsPrivate: Work on 32bits platforms
docs/apibuild.py | 2 +-
src/util/virsocketaddr.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
--
2.8.3
8 years, 10 months