[libvirt PATCH] qemu: Fix domain ID allocation
by Ján Tomko
The rewrite to use GLib's atomic ops functions changed the behavior
of virAtomicIntInc - before it returned the pre-increment value.
Most of the callers using its value were adjusted, but the one
in qemuDriverAllocateID was not. If libvirtd would reconnect to
a running domain during startup, the next started domain would get
the same ID:
$ virsh list
Id Name State
--------------------------
1 f28live running
1 f28live1 running
Use the g_atomic_add function directly (as recommended in viratomic.h)
and add 1 to the result.
This also restores the usual numbering from 1 instead of 0.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
Fixes: 7b9645a7d127a374b8d1c83fdf9789706dbab2c9
---
src/qemu/qemu_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index e5051027fc..0b119cbe78 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1858,7 +1858,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
int qemuDriverAllocateID(virQEMUDriverPtr driver)
{
- return virAtomicIntInc(&driver->lastvmid);
+ return g_atomic_int_add(&driver->lastvmid, 1) + 1;
}
--
2.21.0
4 years, 9 months
[libvirt PATCH 0/5] qemu: Add support for the kvm-no-adjvtime CPU feature
by Andrea Bolognani
This ARM-specific CPU feature has been recently added to QEMU with
https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg04124.html
Patch 1/5 has been trimmed quite liberally: to obtain the unabridged
version of this series, use
$ git fetch https://gitlab.com/abologna/libvirt kvm-no-adjvtime
Andrea Bolognani (5):
tests: Add capabilities for QEMU 5.0.0 on aarch64
qemu: Add the QEMU_CAPS_CPU_KVM_NO_ADJVTIME capability
cpu: Add the kvm-no-adjvtime CPU feature
qemu: Validate the kvm-no-adjvtime CPU feature
tests: Add tests for the kvm-no-adjvtime CPU feature
src/cpu_map/arm_features.xml | 3 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.c | 14 +-
.../qemu_5.0.0-virt.aarch64.xml | 156 +
tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 150 +
.../caps_5.0.0.aarch64.replies | 22717 ++++++++++++++++
.../caps_5.0.0.aarch64.xml | 457 +
.../aarch64-features-misc.aarch64-latest.args | 32 +
.../aarch64-features-misc.xml | 17 +
tests/qemuxml2argvtest.c | 2 +
11 files changed, 23549 insertions(+), 2 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml
create mode 100644 tests/domaincapsdata/qemu_5.0.0.aarch64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml
create mode 100644 tests/qemuxml2argvdata/aarch64-features-misc.aarch64-latest.args
create mode 100644 tests/qemuxml2argvdata/aarch64-features-misc.xml
--
2.24.1
4 years, 9 months
[PATCH] build: Drop execute permissions on virsh bash completion command
by Jim Fehlig
rpmlint complains about "script-without-shebang" due to the execute
permissions on /usr/share/bash-completion/completions/vsh. Use
INSTALL_DATA instead of INSTALL_SCRIPT to avoid the unnecessary
execute permissions.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
BTW, of the nearly 800 files in /usr/share/bash-completion/completions/
on my installation, only vsh has execute permissions set.
tools/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 426a6ba661..d9d1a2f43f 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -357,7 +357,7 @@ libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status
if WITH_BASH_COMPLETION
install-bash-completion:
$(MKDIR_P) "$(DESTDIR)$(BASH_COMPLETIONS_DIR)"
- $(INSTALL_SCRIPT) $(srcdir)/bash-completion/vsh \
+ $(INSTALL_DATA) $(srcdir)/bash-completion/vsh \
"$(DESTDIR)$(BASH_COMPLETIONS_DIR)/vsh"
( cd $(DESTDIR)$(BASH_COMPLETIONS_DIR) && \
rm -f virsh virt-admin && \
--
2.16.4
4 years, 9 months
[libvirt PATCH] qemu: drop unused variable
by Ján Tomko
The g_auto conversion made clang realize the variable is unused:
../../src/qemu/qemu_domain.c:10349:36: error: unused variable
'cfg' [-Werror,-Wunused-variable]
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
Fixes: 20fa2bc6e52e01feaf39d12d38bcf8eaec4c9a46
---
Pushed as a mundanely trivial and depressingly boring build fix.
src/qemu/qemu_domain.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index c5ae3a5210..d3045b4bcd 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10346,8 +10346,6 @@ void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver,
virDomainDiskDefPtr disk,
qemuDomainLogContextPtr logCtxt)
{
- g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
-
if (disk->rawio == VIR_TRISTATE_BOOL_YES)
qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HIGH_PRIVILEGES,
logCtxt);
--
2.19.2
4 years, 9 months
[libvirt PATCH] docs: fix a typo
by Ján Tomko
s/axnd/and/
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
Fixes: f0f34056ab26eaa9f903a51cd1fa155088fd640f
---
Pushed as trivial
docs/formatdomain.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 20bf6a9b84..60a103d7c6 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -5877,7 +5877,7 @@
<p>
<span class="since">Since 6.1.0 (QEMU and KVM only, requires
- QEMU 4.2.0 or newer axnd a guest virtio-net driver supporting
+ QEMU 4.2.0 or newer and a guest virtio-net driver supporting
the "failover" feature, such as the one included in Linux
kernel 4.18 and newer)
</span>
--
2.19.2
4 years, 9 months
[libvirt] [PATCH v1 0/8] domain_addr and qemu_domain cleanups
by Daniel Henrique Barboza
Hi,
These are a few cleanups in some files that I'll end up
messing with in a future series (which isn't Glibfied ATM).
Figured it's best to clean them up now instead of adding
more non-Glibfied code on top.
Patches 7 and 8 are stuff that I noted some time ago and
figured it might be worth sending as well.
Daniel Henrique Barboza (8):
conf/domain_addr.c: use g_autofree in strings
conf/domain_addr.c: remove unneeded 'cleanup' labels
qemu_domain.c: remove redundant virObjectUnref()
qemu_domain.c: use g_autofree when possible
qemu_domain.c: use g_autoptr when possible
qemu_domain.c: removing unneeded cleanup labels
qemu_domain.c: turn qemuDomainChrDefDropDefaultPath to void
qemu_domain_address.c: turn qemuDomainFillDeviceIsolationGroup to void
src/conf/domain_addr.c | 124 +++-----
src/qemu/qemu_domain.c | 511 +++++++++++----------------------
src/qemu/qemu_domain_address.c | 20 +-
src/qemu/qemu_domain_address.h | 2 +-
src/qemu/qemu_hotplug.c | 6 +-
5 files changed, 227 insertions(+), 436 deletions(-)
--
2.24.1
4 years, 9 months
[hooks PATCH] Don't allow @localhost email addresses in commit message
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
update | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/update b/update
index 247b008..966fe22 100755
--- a/update
+++ b/update
@@ -264,6 +264,19 @@ if [ $check_diff = yes ]; then
fi
done
fi
+
+ allow_localhost_email=$(git config --bool hooks.allowlocalhostemail)
+ if [ "$allow_localhost_email" != "true" ]; then
+ for rev in `git log --format=%h $oldrev..$newrev`
+ do
+ git show $rev | grep '@localhost' >/dev/null 2>&1
+ if test $? != 0
+ then
+ echo "*** Update hook: @localhost email address is forbidden $rev" >&2
+ exit 1
+ fi
+ done
+ fi
fi
# --- Finished
--
2.24.1
4 years, 9 months
[PATCH] apparmor: fix qemu_bridge_helper for named profile
by Christian Ehrhardt
Since a3ab6d42 "apparmor: convert libvirtd profile to a named profile"
the detection of the subelement for qemu_bridge_helper is wrong.
In combination with the older 123cc3e1 "apparmor: allow
/usr/lib/qemu/qemu-bridge-helper" it now detects qemu-bridge-helper no
more with its path, but instead as a proper subelement of the named profile
like: label=libvirtd//qemu_bridge_helper
In the same fashion the reverse rule in the qemu_bridge_helper
sub-profile still uses the path and not the named profile label.
Triggering denies like:
apparmor="DENIED" operation="file_inherit"
profile="libvirtd//qemu_bridge_helper" pid=5629 comm="qemu-bridge-hel"
family="unix" sock_type="stream" protocol=0 requested_mask="send receive"
denied_mask="send receive" addr=none peer_addr=none peer="libvirtd"
This patch fixes the unix socket rules for the communication between
libvirtd and qemu-bridge-helper to match that.
Fixes: a3ab6d42d825499af44b8f19f9299e150d9687bc
Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1655111
Signed-off-by: Christian Ehrhardt <christian.ehrhardt(a)canonical.com>
---
src/security/apparmor/usr.sbin.libvirtd | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/security/apparmor/usr.sbin.libvirtd b/src/security/apparmor/usr.sbin.libvirtd
index 29f9936ad9..172972e525 100644
--- a/src/security/apparmor/usr.sbin.libvirtd
+++ b/src/security/apparmor/usr.sbin.libvirtd
@@ -62,8 +62,8 @@ profile libvirtd /usr/sbin/libvirtd flags=(attach_disconnected) {
signal (send) set=("kill", "term") peer=unconfined,
# For communication/control to qemu-bridge-helper
- unix (send, receive) type=stream addr=none peer=(label=/usr/sbin/libvirtd//qemu_bridge_helper),
- signal (send) set=("term") peer=/usr/sbin/libvirtd//qemu_bridge_helper,
+ unix (send, receive) type=stream addr=none peer=(label=libvirtd//qemu_bridge_helper),
+ signal (send) set=("term") peer=libvirtd//qemu_bridge_helper,
# allow connect with openGraphicsFD, direction reversed in newer versions
unix (send, receive) type=stream addr=none peer=(label=libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*),
@@ -121,7 +121,7 @@ profile libvirtd /usr/sbin/libvirtd flags=(attach_disconnected) {
network inet stream,
# For communication/control from libvirtd
- unix (send, receive) type=stream addr=none peer=(label=/usr/sbin/libvirtd),
+ unix (send, receive) type=stream addr=none peer=(label=libvirtd),
signal (receive) set=("term") peer=/usr/sbin/libvirtd,
signal (receive) set=("term") peer=libvirtd,
--
2.25.0
4 years, 9 months