[libvirt] [jenkins-ci PATCH] guests: Set remote_user at the playbook level
by Andrea Bolognani
This is very convenient for developers using the 'test' flavor,
because it ensures
$ ./lcitool update all
still works by logging in as root, but at the same time ad-hoc
invocations such as
$ ansible all -m shell -a 'cd libvirt && $MAKE -j check'
and custom playbooks log in as the 'test' user instead, and as
such have all the usual environment variables ($MAKE, $PYTHON,
$PATH, $VIRT_PREFIX and friends) available to them, which makes
testing changes locally a breeze.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/group_vars/all/main.yml | 2 --
guests/site.yml | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml
index 2bdb7b3..4e05c66 100644
--- a/guests/group_vars/all/main.yml
+++ b/guests/group_vars/all/main.yml
@@ -1,6 +1,4 @@
---
-ansible_user: root
-
# This password is only used to access the guest the very first time
# Ansible is used: afterwards, the user's SSH key will have been installed
# in the guest and SSH password authentication will have been disabled
diff --git a/guests/site.yml b/guests/site.yml
index 26127be..520aea7 100644
--- a/guests/site.yml
+++ b/guests/site.yml
@@ -1,5 +1,6 @@
---
- hosts: all
+ remote_user: root
gather_facts: no
tasks:
@@ -8,6 +9,7 @@
- include: tasks/bootstrap.yml
- hosts: all
+ remote_user: root
vars_files:
- vars/mappings.yml
--
2.14.3
6 years, 7 months
[libvirt] [jenkins-ci PATCH v2] guests: Clean up packages after update
by Andrea Bolognani
The package cache can grow to eat up a lot of disk space, and
not removing unused packages can lead to upgrade issues down
the line for fast moving distributions such as Fedora Rawhide.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Changes from [v1]:
* call 'yum autoremove' when possible.
[v1] https://www.redhat.com/archives/libvir-list/2018-April/msg00970.html
guests/tasks/base.yml | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml
index 53cbd65..616db0a 100644
--- a/guests/tasks/base.yml
+++ b/guests/tasks/base.yml
@@ -117,6 +117,34 @@
when:
- package_format == 'pkg'
+- name: Clean up packages after update
+ command: yum clean packages -y
+ args:
+ warn: no
+ when:
+ - package_format == 'rpm'
+
+- name: Clean up packages after update
+ command: yum autoremove -y
+ args:
+ warn: no
+ when:
+ - package_format == 'rpm'
+ - not ( os_name == 'CentOS' and
+ os_version == '6' )
+
+- name: Clean up packages after update
+ apt:
+ autoclean: yes
+ autoremove: yes
+ when:
+ - package_format == 'deb'
+
+- name: Clean up packages after update
+ shell: pkg clean -y && pkg autoremove -y
+ when:
+ - package_format == 'pkg'
+
- name: Configure hostname
hostname:
name: '{{ inventory_hostname }}'
--
2.14.3
6 years, 7 months
[libvirt] [jenkins-ci PATCH] guests: Introduce libvirt+mingw project
by Andrea Bolognani
Instead of cramming the dependencies that we need for a MinGW
build of libvirt along with those we need for a native build,
create a new project for the former.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 +
guests/vars/projects/libvirt+mingw.yml | 28 ++++++++++++++++++++++++
guests/vars/projects/libvirt.yml | 24 --------------------
3 files changed, 29 insertions(+), 24 deletions(-)
create mode 100644 guests/vars/projects/libvirt+mingw.yml
diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml b/guests/host_vars/libvirt-fedora-rawhide/main.yml
index 3f69f80..c905fb0 100644
--- a/guests/host_vars/libvirt-fedora-rawhide/main.yml
+++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml
@@ -5,6 +5,7 @@ PYTHONPATH: $VIRT_PREFIX/lib64/python3.6/site-packages
projects:
- libosinfo
- libvirt
+ - libvirt+mingw
- libvirt-cim
- libvirt-dbus
- libvirt-glib
diff --git a/guests/vars/projects/libvirt+mingw.yml b/guests/vars/projects/libvirt+mingw.yml
new file mode 100644
index 0000000..0dacb30
--- /dev/null
+++ b/guests/vars/projects/libvirt+mingw.yml
@@ -0,0 +1,28 @@
+---
+packages:
+ - mingw32-curl
+ - mingw32-dbus
+ - mingw32-dlfcn
+ - mingw32-gcc
+ - mingw32-gettext
+ - mingw32-gnutls
+ - mingw32-libssh2
+ - mingw32-libxml2
+ - mingw32-openssl
+ - mingw32-pkg-config
+ - mingw32-portablexdr
+ - mingw32-readline
+ - mingw64-curl
+ - mingw64-dbus
+ - mingw64-dlfcn
+ - mingw64-gcc
+ - mingw64-gettext
+ - mingw64-gnutls
+ - mingw64-libssh2
+ - mingw64-libxml2
+ - mingw64-openssl
+ - mingw64-pkg-config
+ - mingw64-portablexdr
+ - mingw64-readline
+ - rpcgen
+ - xsltproc
diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml
index 598dfc4..ad42fd5 100644
--- a/guests/vars/projects/libvirt.yml
+++ b/guests/vars/projects/libvirt.yml
@@ -36,30 +36,6 @@ packages:
- libudev
- libxml2
- lvm2
- - mingw32-curl
- - mingw32-dbus
- - mingw32-dlfcn
- - mingw32-gcc
- - mingw32-gettext
- - mingw32-gnutls
- - mingw32-libssh2
- - mingw32-libxml2
- - mingw32-openssl
- - mingw32-pkg-config
- - mingw32-portablexdr
- - mingw32-readline
- - mingw64-curl
- - mingw64-dbus
- - mingw64-dlfcn
- - mingw64-gcc
- - mingw64-gettext
- - mingw64-gnutls
- - mingw64-libssh2
- - mingw64-libxml2
- - mingw64-openssl
- - mingw64-pkg-config
- - mingw64-portablexdr
- - mingw64-readline
- netcf
- numad
- openwsman
--
2.14.3
6 years, 7 months
[libvirt] [dbus PATCH] tests: Avoid hidding TimeoutError in main loop
by Katerina Koukiou
Currently the error was not propagated from the timeout
handler properly, and we had PASSED tests even with
timeouts.
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
test/libvirttest.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/test/libvirttest.py b/test/libvirttest.py
index 7168e66..d1b71cc 100644
--- a/test/libvirttest.py
+++ b/test/libvirttest.py
@@ -60,11 +60,14 @@ class BaseTestClass():
def timeout():
self.loop.quit()
del self.loop
- raise TimeoutError()
+ self.timeout = True
+ self.timeout = False
self.loop = GLib.MainLoop()
GLib.timeout_add(2000, timeout)
self.loop.run()
+ if self.timeout:
+ raise TimeoutError()
def domain(self):
path = self.connect.ListDomains(0)[0]
--
2.15.0
6 years, 7 months
[libvirt] [PATCHv3 0/6] Use query-cpus-fast instead of query-cpus
by Viktor Mihajlovski
The QEMU monitor commmand query-cpus is deprecated starting
with QEMU 2.12.0 because it can adversely affect the performance of
a running virtual machine.
This series enables libvirt to use the new query-cpus-fast interface
if supported by the local QEMU instance and is required in order
to support QEMU once the interface has been removed.
query-cpus-fast doesn't return the halted state for a virtual CPU,
meaning that the vcpu.<n>.halted value won't be reported with
'virsh domstats' anymore. This is OK, as stats values are not
guaranteed to be reported under all circumstances and on all
architectures.
Upstream discussion consensus was that the halted state was
problematic anyway, as it had different semantics per architecture.
The only known exploitation happened for s390, for this architecture
the halted state will be computed based on an architecture-specific
cpu value returned in query-cpus-fast.
v2 -> v3:
=========
Patch changes:
1/6:
- formatting changes as requested by John Ferlan
- updated the qemucapabilitiestest XML files
- dropped A/R-bys (due to change above)
2/6:
- fixed comment to also account for query-cpus-fast
3/6:
- updated json monitor tests to account for props returned by
query-cpus and query-cpus-fast
- updated json monitor tests to handle the halted property
(moved here from patch 5)
4/6:
- removed stale text (about callbacks) from commit message
- simplified qemuMonitorJSONExtractCPUArchInfo call
- enhanced sample JSON response in comment
- fixed inter-function spacing
5/6:
- kept s390-specific tests and moved the rest to patch 3
- reformatted the JSON responses (indented "props")
- dropped R-b
v1 -> v2:
=========
Patch changes:
1/6:
- add Acked-by: Peter Krempa
2/6:
- evaluate capability outside of monitor code (changes signatures
of qemuMonitorGetCPUInfo and qemuMonitorGetCpuHalted)
- remove ternary expressions as requested by review
- remove Reviewed-bys due to code changes
3/6
- adapt test cases to changes above
- remove Reviewed-bys due to code changes
4/6
- replace callbacks for architecture data extraction with direct
function calls
- remove Reviewed-bys due to code changes
Viktor Mihajlovski (6):
qemu: add capability detection for query-cpus-fast
qemu: use query-cpus-fast in JSON monitor
tests: add qemumonitorjson tests for query-cpus-fast
qemu: add architecture-specific CPU info handling
tests: add testcase for s390 query-cpus-fast
qemu: refresh vcpu halted state only via query-cpus-fast
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.c | 23 +++-
src/qemu/qemu_monitor.c | 30 +++--
src/qemu/qemu_monitor.h | 7 +-
src/qemu/qemu_monitor_json.c | 133 +++++++++++++++++++--
src/qemu/qemu_monitor_json.h | 3 +-
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
.../qemumonitorjson-cpuinfo-ppc64-hotplug-4.data | 8 ++
.../qemumonitorjson-cpuinfo-s390-fast-cpus.json | 25 ++++
.../qemumonitorjson-cpuinfo-s390-fast-hotplug.json | 21 ++++
.../qemumonitorjson-cpuinfo-s390-fast.data | 19 +++
...emumonitorjson-cpuinfo-x86-basic-pluggable.data | 5 +
...qemumonitorjson-cpuinfo-x86-full-fast-cpus.json | 126 +++++++++++++++++++
...umonitorjson-cpuinfo-x86-full-fast-hotplug.json | 115 ++++++++++++++++++
.../qemumonitorjson-cpuinfo-x86-full-fast.data | 109 +++++++++++++++++
.../qemumonitorjson-cpuinfo-x86-node-full.data | 2 +
tests/qemumonitorjsontest.c | 123 +++++++++++++++----
tests/qemumonitortestutils.c | 7 ++
tests/qemumonitortestutils.h | 1 +
23 files changed, 706 insertions(+), 58 deletions(-)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-cpus.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast-hotplug.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-s390-fast.data
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-cpus.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast-hotplug.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-full-fast.data
--
1.9.1
6 years, 7 months
[libvirt] [PATCH] qemu: remove obsolete qemuMonitorMigrateToCommand
by Daniel P. Berrangé
The last use of qemuMonitorMigrateToCommand was removed years back in
commit 2e90c9daf9eabe15d826a48c06607acb9d18fda6
Author: Daniel P. Berrange <berrange(a)redhat.com>
Date: Fri Nov 6 16:50:26 2015 +0000
qemu: assume support for all migration protocols except rdma
Prior to that commit, 'exec:' to used to replicate the 'unix:' protocol
by spawning 'nc'.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_monitor.c | 31 -------------------------------
src/qemu/qemu_monitor.h | 4 ----
2 files changed, 35 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 7b647525b3..22f05222db 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2730,37 +2730,6 @@ qemuMonitorMigrateToHost(qemuMonitorPtr mon,
}
-int
-qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
- unsigned int flags,
- const char * const *argv)
-{
- char *argstr;
- char *dest = NULL;
- int ret = -1;
- VIR_DEBUG("argv=%p flags=0x%x", argv, flags);
-
- QEMU_CHECK_MONITOR(mon);
-
- argstr = virArgvToString(argv);
- if (!argstr)
- goto cleanup;
-
- if (virAsprintf(&dest, "exec:%s", argstr) < 0)
- goto cleanup;
-
- if (mon->json)
- ret = qemuMonitorJSONMigrate(mon, flags, dest);
- else
- ret = qemuMonitorTextMigrate(mon, flags, dest);
-
- cleanup:
- VIR_FREE(argstr);
- VIR_FREE(dest);
- return ret;
-}
-
-
int
qemuMonitorMigrateCancel(qemuMonitorPtr mon)
{
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index d04148e568..9556a51341 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -784,10 +784,6 @@ int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
const char *hostname,
int port);
-int qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
- unsigned int flags,
- const char * const *argv);
-
int qemuMonitorMigrateCancel(qemuMonitorPtr mon);
int qemuMonitorGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
--
2.14.3
6 years, 7 months
[libvirt] [PATCH] apparmor: add rules to use qemu_bridge_helper
by Christian Ehrhardt
Due to mediation of socket and signal activity currently qemu:///session
connections calling qemu_bridge_helper fail.
We need the profile for libvirtd itself and the subprofile for
qemu-bridge-helper to be able to talk/notify to each other via unix socket and
signals.
Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1754871
Signed-off-by: Christian Ehrhardt <christian.ehrhardt(a)canonical.com>
---
examples/apparmor/usr.sbin.libvirtd | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/examples/apparmor/usr.sbin.libvirtd b/examples/apparmor/usr.sbin.libvirtd
index be4fabf..3102cab 100644
--- a/examples/apparmor/usr.sbin.libvirtd
+++ b/examples/apparmor/usr.sbin.libvirtd
@@ -65,6 +65,10 @@
signal (read, send) peer=libvirt-*,
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,
+
# Very lenient profile for libvirtd since we want to first focus on confining
# the guests. Guests will have a very restricted profile.
/ r,
@@ -112,6 +116,10 @@
network inet stream,
+ # For communication/control from libvirtd
+ unix (send, receive) type=stream addr=none peer=(label=/usr/sbin/libvirtd),
+ signal (receive) set=("term") peer=/usr/sbin/libvirtd,
+
/dev/net/tun rw,
/etc/qemu/** r,
owner @{PROC}/*/status r,
--
2.7.4
6 years, 7 months
[libvirt] [PATCH] acl: remove various left over Xen ACL whitelist entries
by Daniel P. Berrangé
The legacy xen driver is removed, so these ACLL hacks can be removed
too now.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/check-aclrules.pl | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/src/check-aclrules.pl b/src/check-aclrules.pl
index 5b6c711dc8..374abaa722 100755
--- a/src/check-aclrules.pl
+++ b/src/check-aclrules.pl
@@ -61,26 +61,12 @@ my %whitelist = (
"interfaceClose" => 1,
);
-# Temp hack - remove it once xen driver is fixed
+# XXX this vzDomainMigrateConfirm3Params looks
+# bogus - determine why it doesn't have a valid
+# ACL check.
my %implwhitelist = (
- "xenUnifiedDomainRestore" => 1,
- "xenUnifiedDomainRestoreFlags" => 1,
- "xenUnifiedDomainMigratePrepare" => 1,
- "xenUnifiedNodeDeviceDettach" => 1,
- "xenUnifiedNodeDeviceDetachFlags" => 1,
- "xenUnifiedNodeDeviceReset" => 1,
- "xenUnifiedDomainIsActive" => 1,
- "xenUnifiedDomainIsPersistent" => 1,
- "xenUnifiedDomainIsUpdated" => 1,
- "xenUnifiedDomainOpenConsole" => 1,
"vzDomainMigrateConfirm3Params" => 1,
);
-my %filterimplwhitelist = (
- "xenUnifiedConnectListDomains" => 1,
- "xenUnifiedConnectNumOfDomains" => 1,
- "xenUnifiedConnectListDefinedDomains" => 1,
- "xenUnifiedConnectNumOfDefinedDomains" => 1,
- );
my $lastfile;
@@ -234,8 +220,7 @@ while (<>) {
}
if (exists $filtered{$api} &&
- !exists $aclfilters{$impl} &&
- !exists $filterimplwhitelist{$impl}) {
+ !exists $aclfilters{$impl}) {
print "$ARGV:$. Missing ACL filter in function '$impl' for '$api'\n";
$status = 1;
}
--
2.14.3
6 years, 7 months
[libvirt] [PATCH 0/2] Fix vmware driver for VMware Fusion 10
by Rainer Müller
These changes were required to get VMware Fusion working at all.
I tested with VMware Fusion 10.1.1 on macOS 10.12 Sierra.
I am not sure whether calling virCapabilitiesInitCaches() makes sense at
all on macOS. This function looks highly specific to Linux as it relies
on /sys/devices/system, so it should probably be wrapped with an
appropriate #ifdef. I do not feel proficient enough with the libvirt
internals to make this change, though.
Rainer Müller (2):
vmware: Fix initialization of VMware Fusion
vmware: Failures in cache info init are non-fatal
src/vmware/vmware_conf.c | 7 ++++++-
src/vmware/vmware_driver.c | 9 ++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
--
2.16.3
6 years, 7 months
[libvirt] [PATCH jenkins-ci 0/2] Enable virt-viewer mingw build
by Daniel P. Berrangé
Daniel P. Berrangé (2):
Enable mingw build for libvirt-glib project
Enable mingw build for virt-viewer project
guests/vars/mappings.yml | 72 +++++++++++++++++++++++++++++++++++
guests/vars/projects/libvirt-glib.yml | 2 +
guests/vars/projects/virt-viewer.yml | 24 ++++++++++++
projects/libvirt-glib.yaml | 4 ++
projects/virt-viewer.yaml | 4 ++
5 files changed, 106 insertions(+)
--
2.14.3
6 years, 7 months