[libvirt] [PATCH] spec: Drop unittest overrides
by Cole Robinson
nodinfotest.c doesn't exist anymore
seclabeltest.c has changed substantially since this behavior was
added to the spec, and in my testing doesn't have any problems
running in mock
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
libvirt.spec.in | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index e2f2a40238..2e1d575663 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1313,15 +1313,6 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
%endif
%check
-cd tests
-# These tests don't current work in a mock build root
-for i in nodeinfotest seclabeltest
-do
- rm -f $i
- printf 'int main(void) { return 0; }' > $i.c
- printf '#!/bin/sh\nexit 0\n' > $i
- chmod +x $i
-done
if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1
then
cat test-suite.log || true
--
2.23.0
5 years, 3 months
[libvirt] [PATCH v2 00/11] remove repetition of URI path validation
by Daniel Henrique Barboza
This is a code repetition that I crossed a few times, then
I noticed that Cole Robinson suggested a solution for it
in the wiki. Here it is.
changes from v1:
- handle QEMU and vbox cases separately inside the validation
function
v1: https://www.redhat.com/archives/libvir-list/2019-September/msg00983.html
Daniel Henrique Barboza (11):
src/driver.c: add virConnectValidateURIPath()
interface_backend_netcf.c: use virConnectValidateURIPath()
interface_backend_udev.c: use virConnectValidateURIPath()
bridge_driver.c: virConnectValidateURIPath()
node_device_driver.c: use virConnectValidateURIPath()
secret_driver.c: use virConnectValidateURIPath()
storage_driver.c: use virConnectValidateURIPath()
driver.c: change URI validation to handle QEMU and vbox case
qemu_driver.c: use virConnectValidateURIPath()
vbox_common.c: use virConnectValidateURIPath()
vbox_driver.c: use virConnectValidateURIPath()
src/driver.c | 40 +++++++++++++++++++++++++
src/driver.h | 4 +++
src/interface/interface_backend_netcf.c | 17 ++---------
src/interface/interface_backend_udev.c | 17 ++---------
src/libvirt_private.syms | 1 +
src/network/bridge_driver.c | 19 +++---------
src/node_device/node_device_driver.c | 17 ++---------
src/qemu/qemu_driver.c | 20 +++----------
src/secret/secret_driver.c | 17 ++---------
src/storage/storage_driver.c | 17 ++---------
src/vbox/vbox_common.c | 16 ++--------
src/vbox/vbox_driver.c | 16 ++--------
12 files changed, 67 insertions(+), 134 deletions(-)
--
2.21.0
5 years, 3 months
[libvirt] [PATCH v5 00/20] Hi,
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
This series adds support for running virtio GPUs in seperate
processes, thanks to vhost-user backend.
The QEMU support landed for 4.1. There are several benefits of running
the GPU/virgl in an external process, since Mesa is rather heavy on
the qemu main loop, and may block for a while, or crash.
The external GPU process is started with one end of a socket pair, the
other end is given to a QEMU chardev attached to a device. The
external process is also added to the cgroup to limit resources usage.
vhost-user is a generic mechanism that allows implementing virtio device
dataplane handling in a separate userspace process. vhost-user-gpu here
notably moves the virgl 3d handling out of the main qemu process. The
external process will be /usr/libexec/vhost-user-gpu, which comes from
qemu.git contrib/vhost-user-gpu code, first released in qemu-4.1.
Part of this series deals with discovering the location on disk of the
vhost-user-gpu binary, and what capabilities it provides. This uses a
similar mechanism to firmware.json, described in qemu
docs/interop/vhost-user.json
https://github.com/qemu/qemu/blob/master/docs/interop/vhost-user.json
qemu 4.1 ships a 50-qemu-gpu.json to match. I believe virtio-fs
will use a similar mechanism when it lands in upstream qemu, as
virtiofsd is a separate process that communicates with qemu over
vhost-user.
For a bit more background on vhost-user-gpu process handling and
the json interop motivation, here's some of the qemu discussion:
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg02610.html
https://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg00807.html
For this series, the XML to enable this is:
<video model='virtio'>
<driver name='vhostuser'/>
<acceleration accel3d='yes' rendernode='/path/to/rendernode'/>
</video>
rendernode is optional
qemu_vhost_user.c handles vhost-user.json
qemu_vhost_user_gpu.c handles the process management for
vhost-user-gpu
v5: addressing v4 reviews
- replaced "util: ignore EACCESS in virDirOpenIfExists" with more
specific "qemu-interop: ignore non-readable directories"
- use virFileSanitizePath & virBufferEscapeString on rendernode path
- fix ->accel NULL crash, replace qemuSetupVideoAccelCgroup with
qemuSetupVideoCgroup
- fix src/vz virDomainDefAddImplicitVideo usage
- few indent changes, rebased, added r-b tags
v4:
- rebased
- simplify vhost-user-gpu pidfile checking
- fix check/syntax-check
v3:
- rename qemu_configs -> qemu_interop_config
- replace <model .. vhostuser='yes'/> with <driver name='vhostuser'/>
- move vhost_user_binary to virDomainVideoDriverDef
- some VIR_AUTO usage improvements
- introduce qemuDomainVideoPrivate to store vhost-user fd
- improved selection of -device model
- use DO_TEST_CAPS_LATEST
- allocate a rendernode with virHostGetDRMRenderNode() - but no clear idea how to have a test
- add a patch to ignore EPERM in virDirOpenIfExists()
- better domain checks/validate
- added Ján r-b
- no s-o-b from Cole, per request and commits taken from his git branch
- rebase, indentation/style fixes, update doc, version..
v2:
- rebase to master
- if test file build by dropping LDADDS usage
- syntax-check issues:
* use #pragma once
* if () bracket issues
* jump label indent issues
* error message %s usage
* size_t for loops
Marc-André Lureau (20):
qemu: generalize qemuFetchConfigs
qemu-interop: ignore non-readable directories
conf: format/parse/rng/docs for video <driver name='qemu|vhostuser'/>
domain: add rendernode attribute on <accel>
qemu-cgroup: allow accel rendernode access
qemu: add vhost-user-gpu capabilities checks
qemu: check that qemu is vhost-user-vga capable
qemu: validate virtio-gpu with vhost-user
qemu: restrict 'virgl=' option to non-vhostuser video type
qemu: add vhost-user helpers
qemu: add qemuSecurityStartVhostUserGPU helper
conf: add privateData to virDomainVideoDef
qemu: add qemuDomainVideoPrivate
qemu: add vhost-user-gpu helper unit
tests: mock execv/execve
tests: wrap vhost-user paths in qemuxml2argvtest
qemu: prepare domain for vhost-user GPU
qemu: start/stop the vhost-user-gpu external device
qemu: build vhost-user GPU devices
tests: add vhost-user-gpu xml2argv tests
docs/formatdomain.html.in | 18 +-
docs/schemas/domaincommon.rng | 13 +
src/conf/domain_conf.c | 85 +++-
src/conf/domain_conf.h | 22 +-
src/qemu/Makefile.inc.am | 6 +
src/qemu/qemu_capabilities.c | 6 +
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_cgroup.c | 28 ++
src/qemu/qemu_command.c | 65 ++-
src/qemu/qemu_domain.c | 52 ++-
src/qemu/qemu_domain.h | 12 +
src/qemu/qemu_extdevice.c | 74 ++-
src/qemu/qemu_extdevice.h | 5 +
src/qemu/qemu_firmware.c | 144 +-----
src/qemu/qemu_interop_config.c | 189 ++++++++
src/qemu/qemu_interop_config.h | 25 ++
src/qemu/qemu_process.c | 61 ++-
src/qemu/qemu_security.c | 40 ++
src/qemu/qemu_security.h | 6 +
src/qemu/qemu_vhost_user.c | 422 ++++++++++++++++++
src/qemu/qemu_vhost_user.h | 48 ++
src/qemu/qemu_vhost_user_gpu.c | 275 ++++++++++++
src/qemu/qemu_vhost_user_gpu.h | 49 ++
src/vz/vz_sdk.c | 2 +-
tests/Makefile.am | 9 +
.../caps_4.1.0.x86_64.xml | 2 +
.../etc/qemu/vhost-user/40-gpu.json | 1 +
.../etc/qemu/vhost-user/50-gpu.json | 0
.../qemu/vhost-user/test-vhost-user-gpu | 11 +
.../usr/share/qemu/vhost-user/30-gpu.json | 1 +
.../usr/share/qemu/vhost-user/50-gpu.json | 8 +
.../usr/share/qemu/vhost-user/60-gpu.json | 1 +
tests/qemuvhostusertest.c | 132 ++++++
...host-user-gpu-secondary.x86_64-latest.args | 43 ++
.../vhost-user-gpu-secondary.xml | 46 ++
.../vhost-user-vga.x86_64-latest.args | 40 ++
tests/qemuxml2argvdata/vhost-user-vga.xml | 42 ++
tests/qemuxml2argvdata/virtio-options.args | 5 +-
tests/qemuxml2argvdata/virtio-options.xml | 4 +-
tests/qemuxml2argvtest.c | 16 +-
tests/virfilewrapper.c | 22 +
41 files changed, 1828 insertions(+), 206 deletions(-)
create mode 100644 src/qemu/qemu_interop_config.c
create mode 100644 src/qemu/qemu_interop_config.h
create mode 100644 src/qemu/qemu_vhost_user.c
create mode 100644 src/qemu/qemu_vhost_user.h
create mode 100644 src/qemu/qemu_vhost_user_gpu.c
create mode 100644 src/qemu/qemu_vhost_user_gpu.h
create mode 120000 tests/qemuvhostuserdata/etc/qemu/vhost-user/40-gpu.json
create mode 100644 tests/qemuvhostuserdata/etc/qemu/vhost-user/50-gpu.json
create mode 100755 tests/qemuvhostuserdata/usr/libexec/qemu/vhost-user/test-vhost-user-gpu
create mode 120000 tests/qemuvhostuserdata/usr/share/qemu/vhost-user/30-gpu.json
create mode 100644 tests/qemuvhostuserdata/usr/share/qemu/vhost-user/50-gpu.json
create mode 120000 tests/qemuvhostuserdata/usr/share/qemu/vhost-user/60-gpu.json
create mode 100644 tests/qemuvhostusertest.c
create mode 100644 tests/qemuxml2argvdata/vhost-user-gpu-secondary.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-gpu-secondary.xml
create mode 100644 tests/qemuxml2argvdata/vhost-user-vga.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-vga.xml
--
2.23.0
5 years, 3 months
[libvirt] [PATCH 00/22] qemu: Clean up typed parameter handling in bulk stats
by Peter Krempa
While investigating whether block bulk stats work properly with blockdev
I got irritated by macros hiding gotos.
Refactor the stats tracking by introducing few new typed parameter
handlers.
Peter Krempa (22):
util: typedparam: Split out public APIs into a separate file
util: typedparam: Purge public bits from virTypedParamsGetStringList
util: typedparam: Move and unexport virTypedParameterAssignFromStr
util: typedparam: Remove pointless cleanup label from
virTypedParameterAssignFromStr
docs: apibuild: Purge irrelevant typed parameter APIs from ignore
util: typedparam: Separate code to assign value to typed parameter
util: typedparam: Optionally copy strings passed to
virTypedParameterAssignValue
util: typedparam: Simplify handling of lists of typed parameters
qemu: Remove stale comment for qemuDomainBlockStats
qemu: monitor: Refactor cleanup in
qemuMonitorJSONBlockStatsCollectData
qemu: monitor: Refactor cleanup in qemuMonitorJSONGetOneBlockStatsInfo
qemu: monitor: Refactor cleanup in qemuMonitorJSONGetAllBlockStatsInfo
qemu: monitor: Change fields in qemuBlockStats to 'unsigned'
qemu: driver: Remove pointless macro QEMU_BLOCK_STAT_TOTAL
qemu: driver: Don't return anything from
qemuDomainBlockStatsGatherTotals
qemu: driver: Remove QEMU_ADD_BLOCK_PARAM_LL macro
qemu: Use virTypedParamList in the bulk stats gathering functions
qemu: driver: Stop using QEMU_ADD_BLOCK_PARAM_ULL in
qemuDomainGetStatsOneBlockFallback
qemu: driver: Stop using QEMU_ADD_BLOCK_PARAM_ULL in
qemuDomainGetStatsOneBlock
qemu: driver: Stop using QEMU_ADD_BLOCK_PARAM_ULL in
qemuDomainGetStatsBlockExportBackendStorage
qemu: driver: Stop using QEMU_ADD_BLOCK_PARAM_ULL in
qemuDomainGetStatsBlockExportFrontend
qemu: driver: Remove unused cleanup labels in stats gathering
functions
docs/Makefile.am | 2 +-
docs/apibuild.py | 7 +-
src/libvirt_private.syms | 10 +-
src/qemu/qemu_driver.c | 635 ++++++-----------
src/qemu/qemu_monitor.h | 16 +-
src/qemu/qemu_monitor_json.c | 57 +-
src/util/Makefile.inc.am | 1 +
src/util/virtypedparam-public.c | 886 ++++++++++++++++++++++++
src/util/virtypedparam.c | 1129 +++++++------------------------
src/util/virtypedparam.h | 67 +-
10 files changed, 1440 insertions(+), 1370 deletions(-)
create mode 100644 src/util/virtypedparam-public.c
--
2.21.0
5 years, 3 months
[libvirt] [libvirt-tck PATCH] domain: Relax the checks matching disk sizes
by Erik Skultety
There may be some preallocation going on depending on what host
filesystem is in place which may mess up the numbers we expect mainly in
allocation, so let's stick with exact matching of the capacity and
relaxing the checks on allocation and physical size as commit 30beeb2e
did.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
scripts/domain/121-block-info.t | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/domain/121-block-info.t b/scripts/domain/121-block-info.t
index bfff48c..d9d644e 100644
--- a/scripts/domain/121-block-info.t
+++ b/scripts/domain/121-block-info.t
@@ -98,8 +98,8 @@ ok_domain(sub { $dom = $conn->create_domain($xml) }, "Create domain");
$xml = $dom->get_xml_description();
is($dom->get_block_info($dst2,0)->{capacity}, 1024*1024*50, "Get disk capacity info");
-is($dom->get_block_info($dst2,0)->{allocation}, 1024*1024, "Get disk allocation info");
-is($dom->get_block_info($dst2,0)->{physical}, 1024*1024*50, "Get disk physical info");
+ok($dom->get_block_info($dst2,0)->{allocation} >= 1024*1024, "Get disk allocation info");
+ok($dom->get_block_info($dst2,0)->{physical} >= 1024*1024*50, "Get disk physical info");
is($dom->get_block_info($dst,0)->{capacity}, 1024*1024*50, "Get disk capacity info");
--
2.20.1
5 years, 3 months
[libvirt] [libvirt-tck PATCH] conf: Upgrade the used version of fedora to 30
by Erik Skultety
Fedora 28 is already EOL and the URLs don't work anymore either because
EOL resources eventually move to
http://archives.fedoraproject.org/pub/archive/fedora/ from
https://dl.fedoraproject.org/pub/fedora/linux/releases/.
---
Notes:
I'm wondering whether we shouldn't drop the secondary i686 sections as well
since i686 will die starting with fedora 31. On a similar note with UML,
upstream libvirt dropped it a while ago.
conf/default.cfg | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/conf/default.cfg b/conf/default.cfg
index b97688e..d9fd0cb 100644
--- a/conf/default.cfg
+++ b/conf/default.cfg
@@ -49,7 +49,7 @@ images = (
hvm
xen
)
- osname = fedora-28
+ osname = fedora-30
}
)
@@ -75,25 +75,25 @@ images = (
# empty sparse root FS will be created
#
kernels = (
- # Fedora 28 i686 PAE has pv_ops, so one kernel can do both Xen and KVM guests here
+ # Fedora 30 i686 PAE has pv_ops, so one kernel can do both Xen and KVM guests here
{
arch = i686
ostype = (
hvm
xen
)
- kernel = http://dl.fedoraproject.org/pub/fedora-secondary/releases/28/Everything/i...
- initrd = http://dl.fedoraproject.org/pub/fedora-secondary/releases/28/Everything/i...
+ kernel = http://dl.fedoraproject.org/pub/fedora-secondary/releases/30/Everything/i...
+ initrd = http://dl.fedoraproject.org/pub/fedora-secondary/releases/30/Everything/i...
}
- # Fedora 28 x86_64 has pv_ops, so one kernel can do both Xen and KVM guests here
+ # Fedora 30 x86_64 has pv_ops, so one kernel can do both Xen and KVM guests here
{
arch = x86_64
ostype = (
hvm
xen
)
- kernel = http://dl.fedoraproject.org/pub/fedora/linux/releases/28/Everything/x86_6...
- initrd = http://dl.fedoraproject.org/pub/fedora/linux/releases/28/Everything/x86_6...
+ kernel = http://dl.fedoraproject.org/pub/fedora/linux/releases/30/Everything/x86_6...
+ initrd = http://dl.fedoraproject.org/pub/fedora/linux/releases/30/Everything/x86_6...
}
# User mode linux i686 needs custom kernel + root filesystem
{
--
2.20.1
5 years, 3 months
[libvirt] [libvirt-tck PATCH] TCK.pm: Define libvirt VMs with an RNG device
by Erik Skultety
The nwfilter 220-no-ip-spoofing.t test relies on an SSH connection to
the test VM. However, because the domain definition passed to libvirt
lacks an RNG device, the SSH server isn't started inside the guest
(even though that is the default on virt-builder images) and therefore:
"ssh: connect to host 192.168.122.227 port 22: Connection refused"
is returned which in turn makes a bunch of sub tests fail because the
very basic premise - a working SSH connection - is false.
This patch makes sure a virtio RNG is contained in the XML definition,
thus causing the SSH server to be started successfully, thus allowing
all the subtests to pass.
---
lib/Sys/Virt/TCK.pm | 4 ++++
lib/Sys/Virt/TCK/DomainBuilder.pm | 21 +++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm
index 389d5cc..3ea06cc 100644
--- a/lib/Sys/Virt/TCK.pm
+++ b/lib/Sys/Virt/TCK.pm
@@ -807,6 +807,8 @@ sub generic_machine_domain {
$b->disk(src => $config{root},
dst => $config{dev},
type => "file");
+ $b->rng(backend_model => "random",
+ backend => "/dev/urandom");
if ($config{firstboot}) {
print "# Running the first boot\n";
@@ -865,6 +867,8 @@ sub generic_machine_domain {
dst => $config{dev},
type => "file",
shareable => $shareddisk);
+ $b->rng(backend_model => "random",
+ backend => "/dev/urandom");
return $b;
}
}
diff --git a/lib/Sys/Virt/TCK/DomainBuilder.pm b/lib/Sys/Virt/TCK/DomainBuilder.pm
index 45336b5..be8708f 100644
--- a/lib/Sys/Virt/TCK/DomainBuilder.pm
+++ b/lib/Sys/Virt/TCK/DomainBuilder.pm
@@ -49,6 +49,7 @@ sub new {
graphics => [],
hostdevs => [],
seclabel => {},
+ rng => {},
};
bless $self, $class;
@@ -328,6 +329,19 @@ sub seclabel {
return $self;
}
+sub rng {
+ my $self = shift;
+ my %params = @_;
+
+ die "backend model parameter is required" unless $params{backend_model};
+ die "backend parameter is required" unless $params{backend};
+
+ $self->{rng} = \%params;
+ $self->{rng}->{model} = "virtio" unless defined $self->{rng}->{model};
+
+ return $self;
+}
+
sub as_xml {
my $self = shift;
@@ -504,6 +518,13 @@ sub as_xml {
$w->endTag("graphics");
}
$w->emptyTag("console", type => "pty");
+
+ $w->startTag("rng",
+ model => $self->{rng}->{model});
+ $w->dataElement("backend", $self->{rng}->{backend},
+ model => $self->{rng}->{backend_model});
+ $w->endTag("rng");
+
$w->endTag("devices");
if ($self->{seclabel}->{model}) {
$w->startTag("seclabel",
--
2.20.1
5 years, 3 months
[libvirt] [PATCH 0/4] Sanitize restrictions imposed by VIR_DOMAIN_START_AUTODESTROY
by Peter Krempa
Migration to a different host is the only reasonable restriction that
should apply. Fix the wording in the docs and remove the restrictions
of saving the VM, taking a snapshot and taking a checkpoint.
Peter Krempa (4):
lib: Lessen restrictions on VIR_DOMAIN_START_AUTODESTROY
qemu: migration: Forbid only remote migration if autodestroy is active
for VM
qemu: snapshot: Don't forbid snapshot if autodestroy is registered
qemu: checkpoint: Don't forbid checkpoint when VM is marked for
autodestroy
src/libvirt-domain.c | 9 ++++++---
src/qemu/qemu_driver.c | 12 ------------
src/qemu/qemu_migration.c | 3 ++-
3 files changed, 8 insertions(+), 16 deletions(-)
--
2.21.0
5 years, 3 months
[libvirt] [jenkins-ci PATCH 0/4] Switch libosinfo builds to Meson
by Fabiano Fidêncio
Subject says it all, basically. It's important to note that we will add
the whole machinery to install meson via pip and build the projects in
platforms where the minimum required version of meson is not present,
I really would like to go ahead with this patch as soon as I can have
the libosinfo MR acked.
Fabiano Fidêncio (4):
libosinfo: Add meson dependency
Only build libosinfo on systems with meson >= 0.49.0
Update libosinfo's archive_format
Switch libosinfo builds to Meson
guests/host_vars/libvirt-centos-7/main.yml | 1 -
guests/host_vars/libvirt-debian-9/main.yml | 1 -
guests/host_vars/libvirt-ubuntu-16/main.yml | 1 -
guests/host_vars/libvirt-ubuntu-18/main.yml | 1 -
.../build/projects/libosinfo+mingw32.yml | 6 ++---
.../build/projects/libosinfo+mingw64.yml | 6 ++---
guests/playbooks/build/projects/libosinfo.yml | 26 ++++++++++++++-----
guests/vars/projects/libosinfo+mingw32.yml | 1 +
guests/vars/projects/libosinfo+mingw64.yml | 1 +
guests/vars/projects/libosinfo.yml | 1 +
jenkins/projects/libosinfo+mingw32.yaml | 6 ++---
jenkins/projects/libosinfo+mingw64.yaml | 6 ++---
jenkins/projects/libosinfo.yaml | 26 +++++++++++++------
13 files changed, 52 insertions(+), 31 deletions(-)
--
2.23.0
5 years, 3 months