[PATCH 0/6] qemucapabilitiestest: Bump 8.2 dev cycle data
by Peter Krempa
Peter Krempa (6):
qemumigrationcookiexmltest: Don't crash when parsing of status XML
fails
tests: qemumigparamsdata: Drop deprecated fields
qemuxml2argvtest: Rename 'cpu-host-model' tests according to emulation
type
qemuxml2argvtest: Add complementary 'kvm/tcg' test cases for
cpu-host-model*
qemuxml2argvtest: Add '8.1.0' variants of 'cpu-host-model*' tests
qemucapabilitiestest: Update capabilities data for 8.2 dev cycle on
x86_64
.../domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 1 -
.../caps_8.2.0_x86_64.replies | 4365 +++++++++--------
.../caps_8.2.0_x86_64.xml | 53 +-
tests/qemumigparamsdata/basic.json | 3 -
tests/qemumigparamsdata/basic.reply | 3 -
tests/qemumigparamsdata/basic.xml | 3 -
tests/qemumigparamsdata/tls-enabled.json | 3 -
tests/qemumigparamsdata/tls-enabled.reply | 3 -
tests/qemumigparamsdata/tls-enabled.xml | 3 -
tests/qemumigparamsdata/tls-hostname.json | 3 -
tests/qemumigparamsdata/tls-hostname.reply | 3 -
tests/qemumigparamsdata/tls-hostname.xml | 3 -
tests/qemumigparamsdata/tls.json | 3 -
tests/qemumigparamsdata/tls.reply | 3 -
tests/qemumigparamsdata/tls.xml | 3 -
tests/qemumigrationcookiexmltest.c | 16 +-
...-host-model-fallback-kvm.x86_64-4.2.0.args | 33 +
...-host-model-fallback-kvm.x86_64-5.0.0.args | 33 +
...-host-model-fallback-kvm.x86_64-5.1.0.args | 33 +
...-host-model-fallback-kvm.x86_64-5.2.0.args | 34 +
...-host-model-fallback-kvm.x86_64-6.0.0.args | 34 +
...-host-model-fallback-kvm.x86_64-6.1.0.args | 34 +
...-host-model-fallback-kvm.x86_64-6.2.0.args | 34 +
...-host-model-fallback-kvm.x86_64-7.0.0.args | 34 +
...-host-model-fallback-kvm.x86_64-7.1.0.args | 34 +
...-host-model-fallback-kvm.x86_64-7.2.0.args | 34 +
...-host-model-fallback-kvm.x86_64-8.0.0.args | 33 +
...-host-model-fallback-kvm.x86_64-8.1.0.args | 33 +
...host-model-fallback-kvm.x86_64-latest.args | 33 +
.../cpu-host-model-fallback-kvm.xml | 19 +
...host-model-fallback-tcg.x86_64-4.2.0.args} | 0
...host-model-fallback-tcg.x86_64-5.0.0.args} | 0
...host-model-fallback-tcg.x86_64-5.1.0.args} | 0
...host-model-fallback-tcg.x86_64-5.2.0.args} | 0
...host-model-fallback-tcg.x86_64-6.0.0.args} | 0
...host-model-fallback-tcg.x86_64-6.1.0.args} | 0
...host-model-fallback-tcg.x86_64-6.2.0.args} | 0
...host-model-fallback-tcg.x86_64-7.0.0.args} | 0
...host-model-fallback-tcg.x86_64-7.1.0.args} | 0
...host-model-fallback-tcg.x86_64-7.2.0.args} | 0
...host-model-fallback-tcg.x86_64-8.0.0.args} | 0
...host-model-fallback-tcg.x86_64-8.1.0.args} | 2 +-
...host-model-fallback-tcg.x86_64-latest.args | 33 +
...ck.xml => cpu-host-model-fallback-tcg.xml} | 0
...s => cpu-host-model-kvm.x86_64-4.2.0.args} | 0
...s => cpu-host-model-kvm.x86_64-5.0.0.args} | 0
...s => cpu-host-model-kvm.x86_64-5.1.0.args} | 0
...s => cpu-host-model-kvm.x86_64-5.2.0.args} | 0
...s => cpu-host-model-kvm.x86_64-6.0.0.args} | 0
...s => cpu-host-model-kvm.x86_64-6.1.0.args} | 0
...s => cpu-host-model-kvm.x86_64-6.2.0.args} | 0
...s => cpu-host-model-kvm.x86_64-7.0.0.args} | 0
...s => cpu-host-model-kvm.x86_64-7.1.0.args} | 0
...s => cpu-host-model-kvm.x86_64-7.2.0.args} | 0
...s => cpu-host-model-kvm.x86_64-8.0.0.args} | 0
.../cpu-host-model-kvm.x86_64-8.1.0.args | 38 +
... => cpu-host-model-kvm.x86_64-latest.args} | 0
...-host-model.xml => cpu-host-model-kvm.xml} | 0
...ost-model-nofallback-kvm.x86_64-4.2.0.args | 33 +
...ost-model-nofallback-kvm.x86_64-5.0.0.args | 33 +
...ost-model-nofallback-kvm.x86_64-5.1.0.args | 33 +
...ost-model-nofallback-kvm.x86_64-5.2.0.args | 34 +
...ost-model-nofallback-kvm.x86_64-6.0.0.args | 34 +
...ost-model-nofallback-kvm.x86_64-6.1.0.args | 34 +
...ost-model-nofallback-kvm.x86_64-6.2.0.args | 34 +
...ost-model-nofallback-kvm.x86_64-7.0.0.args | 34 +
...ost-model-nofallback-kvm.x86_64-7.1.0.args | 34 +
...ost-model-nofallback-kvm.x86_64-7.2.0.args | 34 +
...ost-model-nofallback-kvm.x86_64-8.0.0.args | 33 +
...ost-model-nofallback-kvm.x86_64-8.1.0.args | 33 +
...st-model-nofallback-kvm.x86_64-latest.args | 33 +
.../cpu-host-model-nofallback-kvm.xml | 21 +
...st-model-nofallback-tcg.x86_64-4.2.0.args} | 0
...st-model-nofallback-tcg.x86_64-5.0.0.args} | 0
...st-model-nofallback-tcg.x86_64-5.1.0.args} | 0
...st-model-nofallback-tcg.x86_64-5.2.0.args} | 0
...st-model-nofallback-tcg.x86_64-6.0.0.args} | 0
...st-model-nofallback-tcg.x86_64-6.1.0.args} | 0
...st-model-nofallback-tcg.x86_64-6.2.0.args} | 0
...st-model-nofallback-tcg.x86_64-7.0.0.args} | 0
...st-model-nofallback-tcg.x86_64-7.1.0.args} | 0
...st-model-nofallback-tcg.x86_64-7.2.0.args} | 0
...st-model-nofallback-tcg.x86_64-8.0.0.args} | 0
...st-model-nofallback-tcg.x86_64-8.1.0.args} | 2 +-
...st-model-nofallback-tcg.x86_64-latest.args | 33 +
....xml => cpu-host-model-nofallback-tcg.xml} | 0
.../cpu-host-model-tcg.x86_64-4.2.0.args | 38 +
.../cpu-host-model-tcg.x86_64-5.0.0.args | 38 +
.../cpu-host-model-tcg.x86_64-5.1.0.args | 38 +
.../cpu-host-model-tcg.x86_64-5.2.0.args | 39 +
.../cpu-host-model-tcg.x86_64-6.0.0.args | 39 +
.../cpu-host-model-tcg.x86_64-6.1.0.args | 39 +
.../cpu-host-model-tcg.x86_64-6.2.0.args | 39 +
.../cpu-host-model-tcg.x86_64-7.0.0.args | 39 +
.../cpu-host-model-tcg.x86_64-7.1.0.args | 39 +
.../cpu-host-model-tcg.x86_64-7.2.0.args | 39 +
.../cpu-host-model-tcg.x86_64-8.0.0.args | 38 +
.../cpu-host-model-tcg.x86_64-8.1.0.args | 38 +
.../cpu-host-model-tcg.x86_64-latest.args | 38 +
tests/qemuxml2argvdata/cpu-host-model-tcg.xml | 21 +
tests/qemuxml2argvtest.c | 122 +-
101 files changed, 4025 insertions(+), 2110 deletions(-)
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-4.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-5.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-5.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-6.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-6.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-6.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-7.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-7.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-7.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-8.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-8.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-kvm.xml
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-4.2.0.args => cpu-host-model-fallback-tcg.x86_64-4.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-5.0.0.args => cpu-host-model-fallback-tcg.x86_64-5.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-5.1.0.args => cpu-host-model-fallback-tcg.x86_64-5.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-5.2.0.args => cpu-host-model-fallback-tcg.x86_64-5.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-6.0.0.args => cpu-host-model-fallback-tcg.x86_64-6.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-6.1.0.args => cpu-host-model-fallback-tcg.x86_64-6.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-6.2.0.args => cpu-host-model-fallback-tcg.x86_64-6.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-7.0.0.args => cpu-host-model-fallback-tcg.x86_64-7.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-7.1.0.args => cpu-host-model-fallback-tcg.x86_64-7.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-7.2.0.args => cpu-host-model-fallback-tcg.x86_64-7.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-8.0.0.args => cpu-host-model-fallback-tcg.x86_64-8.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.x86_64-latest.args => cpu-host-model-fallback-tcg.x86_64-8.1.0.args} (95%)
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-fallback-tcg.x86_64-latest.args
rename tests/qemuxml2argvdata/{cpu-host-model-fallback.xml => cpu-host-model-fallback-tcg.xml} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-4.2.0.args => cpu-host-model-kvm.x86_64-4.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-5.0.0.args => cpu-host-model-kvm.x86_64-5.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-5.1.0.args => cpu-host-model-kvm.x86_64-5.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-5.2.0.args => cpu-host-model-kvm.x86_64-5.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-6.0.0.args => cpu-host-model-kvm.x86_64-6.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-6.1.0.args => cpu-host-model-kvm.x86_64-6.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-6.2.0.args => cpu-host-model-kvm.x86_64-6.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-7.0.0.args => cpu-host-model-kvm.x86_64-7.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-7.1.0.args => cpu-host-model-kvm.x86_64-7.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-7.2.0.args => cpu-host-model-kvm.x86_64-7.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-8.0.0.args => cpu-host-model-kvm.x86_64-8.0.0.args} (100%)
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-8.1.0.args
rename tests/qemuxml2argvdata/{cpu-host-model.x86_64-latest.args => cpu-host-model-kvm.x86_64-latest.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model.xml => cpu-host-model-kvm.xml} (100%)
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-4.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-5.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-5.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-6.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-6.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-6.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-7.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-7.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-7.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-8.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-8.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-kvm.xml
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-4.2.0.args => cpu-host-model-nofallback-tcg.x86_64-4.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-5.0.0.args => cpu-host-model-nofallback-tcg.x86_64-5.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-5.1.0.args => cpu-host-model-nofallback-tcg.x86_64-5.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-5.2.0.args => cpu-host-model-nofallback-tcg.x86_64-5.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-6.0.0.args => cpu-host-model-nofallback-tcg.x86_64-6.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-6.1.0.args => cpu-host-model-nofallback-tcg.x86_64-6.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-6.2.0.args => cpu-host-model-nofallback-tcg.x86_64-6.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-7.0.0.args => cpu-host-model-nofallback-tcg.x86_64-7.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-7.1.0.args => cpu-host-model-nofallback-tcg.x86_64-7.1.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-7.2.0.args => cpu-host-model-nofallback-tcg.x86_64-7.2.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-8.0.0.args => cpu-host-model-nofallback-tcg.x86_64-8.0.0.args} (100%)
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.x86_64-latest.args => cpu-host-model-nofallback-tcg.x86_64-8.1.0.args} (95%)
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback-tcg.x86_64-latest.args
rename tests/qemuxml2argvdata/{cpu-host-model-nofallback.xml => cpu-host-model-nofallback-tcg.xml} (100%)
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-4.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-5.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-5.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-5.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-6.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-6.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-6.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-7.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-7.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-7.2.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-8.0.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-8.1.0.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-tcg.xml
--
2.41.0
1 year, 1 month
[libvirt PATCH] qemu: add runtime config option for nbdkit
by Jonathon Jongsma
Currently when we build with nbdkit support, libvirt will always try to
use nbdkit to access remote disk sources when it is available. But
without an up-to-date selinux policy allowing this, it will fail.
Because the required selinux policies are not yet widely available, we
have disabled nbdkit support on rpm builds for all distributions before
Fedora 40.
Unfortunately, this makes it more difficult to test nbdkit support.
After someone updates to the necessary selinux policies, they would also
need to rebuild libvirt to enable nbdkit support. By introducing a
configure option (storage_use_nbdkit), we can build packages with nbdkit
support but have it disabled by default.
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
Suggested as an option for making testing easier by Andrea Bolognani
libvirt.spec.in | 10 +---------
src/qemu/libvirtd_qemu.aug | 3 +++
src/qemu/qemu.conf.in | 10 ++++++++++
src/qemu/qemu_conf.c | 14 ++++++++++++++
src/qemu/qemu_conf.h | 2 ++
src/qemu/qemu_domain.c | 3 +++
tests/qemuxml2argvtest.c | 15 +++++++++------
7 files changed, 42 insertions(+), 15 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index f50c451e73..e2ba245ade 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -174,16 +174,8 @@
%endif
%endif
-# We should only enable nbdkit support if the OS ships a SELinux policy that
-# allows libvirt to launch it. Right now that's not the case anywhere, but
-# things should be fine by the time Fedora 40 is released.
-#
-# TODO: add RHEL 9 once a minor release that contains the necessary SELinux
-# bits exists (we only support the most recent minor release)
%if %{with_qemu}
- %if 0%{?fedora} >= 40
- %define with_nbdkit 0%{!?_without_nbdkit:1}
- %endif
+ %define with_nbdkit 0%{!?_without_nbdkit:1}
%endif
%ifarch %{arches_dmidecode}
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index ed097ea3d9..43485b43fb 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -147,6 +147,8 @@ module Libvirtd_qemu =
let capability_filters_entry = str_array_entry "capability_filters"
+ let storage_entry = bool_entry "storage_use_nbdkit"
+
(* Each entry in the config is one of the following ... *)
let entry = default_tls_entry
| vnc_entry
@@ -170,6 +172,7 @@ module Libvirtd_qemu =
| nbd_entry
| swtpm_entry
| capability_filters_entry
+ | storage_entry
| obsolete_entry
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in
index 6897e0f760..1017edefa5 100644
--- a/src/qemu/qemu.conf.in
+++ b/src/qemu/qemu.conf.in
@@ -974,3 +974,13 @@
# "full" - both QEMU and its helper processes are placed into separate
# scheduling group
#sched_core = "none"
+
+# Using nbdkit to access remote disk sources
+#
+# If this is set then libvirt will use nbdkit to access remote disk sources
+# when available. nbdkit will export an NBD share to qemu rather than having
+# qemu attempt access the remote server directly.
+#
+# Possible values are 0 or 1. Disabled by default.
+#
+# storage_use_nbdkit = 1
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 513b5ebb1e..b5c0ca10b4 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1065,6 +1065,17 @@ virQEMUDriverConfigLoadCapsFiltersEntry(virQEMUDriverConfig *cfg,
}
+static int
+virQEMUDriverConfigLoadStorageEntry(virQEMUDriverConfig *cfg,
+ virConf *conf)
+{
+ if (virConfGetValueBool(conf, "storage_use_nbdkit", &cfg->storageUseNbdkit) < 0)
+ return -1;
+
+ return 0;
+}
+
+
int virQEMUDriverConfigLoadFile(virQEMUDriverConfig *cfg,
const char *filename,
bool privileged)
@@ -1136,6 +1147,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfig *cfg,
if (virQEMUDriverConfigLoadCapsFiltersEntry(cfg, conf) < 0)
return -1;
+ if (virQEMUDriverConfigLoadStorageEntry(cfg, conf) < 0)
+ return -1;
+
return 0;
}
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 1a3ba3a0fb..36049b4bfa 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -230,6 +230,8 @@ struct _virQEMUDriverConfig {
char *deprecationBehavior;
+ bool storageUseNbdkit;
+
virQEMUSchedCore schedCore;
};
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ae19ce884b..f8dda6c898 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10333,6 +10333,9 @@ qemuDomainPrepareStorageSourceNbdkit(virStorageSource *src,
{
g_autoptr(qemuNbdkitCaps) nbdkit = NULL;
+ if (!cfg->storageUseNbdkit)
+ return false;
+
if (virStorageSourceGetActualType(src) != VIR_STORAGE_TYPE_NETWORK)
return false;
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 4fda68a4ce..3c64fcc7eb 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1115,7 +1115,6 @@ mymain(void)
DO_TEST_CAPS_LATEST("disk-cdrom-empty-network-invalid");
DO_TEST_CAPS_LATEST("disk-cdrom-bus-other");
DO_TEST_CAPS_LATEST("disk-cdrom-network");
- DO_TEST_CAPS_LATEST_NBDKIT("disk-cdrom-network-nbdkit", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
DO_TEST_CAPS_LATEST("disk-cdrom-tray");
DO_TEST_CAPS_LATEST("disk-floppy");
DO_TEST_CAPS_LATEST("disk-floppy-q35");
@@ -1161,8 +1160,6 @@ mymain(void)
DO_TEST_CAPS_VER("disk-network-sheepdog", "6.0.0");
DO_TEST_CAPS_LATEST("disk-network-source-auth");
DO_TEST_CAPS_LATEST("disk-network-source-curl");
- DO_TEST_CAPS_LATEST_NBDKIT("disk-network-source-curl-nbdkit", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
- DO_TEST_CAPS_LATEST_NBDKIT("disk-network-source-curl-nbdkit-backing", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
DO_TEST_CAPS_LATEST("disk-network-nfs");
driver.config->vxhsTLS = 1;
driver.config->nbdTLSx509secretUUID = g_strdup("6fd3f62d-9fe7-4a4e-a869-7acd6376d8ea");
@@ -1173,13 +1170,10 @@ mymain(void)
DO_TEST_CAPS_LATEST("disk-network-tlsx509-nbd-hostname");
DO_TEST_CAPS_VER("disk-network-tlsx509-vxhs", "5.0.0");
DO_TEST_CAPS_LATEST("disk-network-http");
- DO_TEST_CAPS_LATEST_NBDKIT("disk-network-http-nbdkit", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
VIR_FREE(driver.config->nbdTLSx509secretUUID);
VIR_FREE(driver.config->vxhsTLSx509secretUUID);
driver.config->vxhsTLS = 0;
DO_TEST_CAPS_LATEST("disk-network-ssh");
- DO_TEST_CAPS_LATEST_NBDKIT("disk-network-ssh-nbdkit", QEMU_NBDKIT_CAPS_PLUGIN_SSH);
- DO_TEST_CAPS_LATEST_NBDKIT("disk-network-ssh-password", QEMU_NBDKIT_CAPS_PLUGIN_SSH);
DO_TEST_CAPS_LATEST("disk-no-boot");
DO_TEST_CAPS_LATEST("disk-nvme");
DO_TEST_CAPS_VER("disk-vhostuser-numa", "4.2.0");
@@ -1249,6 +1243,15 @@ mymain(void)
DO_TEST_CAPS_LATEST("disk-geometry");
DO_TEST_CAPS_LATEST("disk-blockio");
+ driver.config->storageUseNbdkit = 1;
+ DO_TEST_CAPS_LATEST_NBDKIT("disk-cdrom-network-nbdkit", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST_CAPS_LATEST_NBDKIT("disk-network-source-curl-nbdkit", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST_CAPS_LATEST_NBDKIT("disk-network-source-curl-nbdkit-backing", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST_CAPS_LATEST_NBDKIT("disk-network-http-nbdkit", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST_CAPS_LATEST_NBDKIT("disk-network-ssh-nbdkit", QEMU_NBDKIT_CAPS_PLUGIN_SSH);
+ DO_TEST_CAPS_LATEST_NBDKIT("disk-network-ssh-password", QEMU_NBDKIT_CAPS_PLUGIN_SSH);
+ driver.config->storageUseNbdkit = 0;
+
DO_TEST_CAPS_VER("disk-virtio-scsi-reservations", "5.2.0");
DO_TEST_CAPS_LATEST("disk-virtio-scsi-reservations");
--
2.41.0
1 year, 1 month
[PATCH V4] support for hotplug/hotunplug in test hypervisor
by Thanos Makatos
Signed-off-by: Thanos Makatos <thanos.makatos(a)nutanix.com>
---
src/test/test_driver.c | 387 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 385 insertions(+), 2 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index e87d7cfd44..a3b4799a0f 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -26,8 +26,6 @@
#include <unistd.h>
#include <sys/stat.h>
#include <libxml/xmlsave.h>
-
-
#include "virerror.h"
#include "datatypes.h"
#include "test_driver.h"
@@ -38,10 +36,14 @@
#include "virnetworkobj.h"
#include "interface_conf.h"
#include "checkpoint_conf.h"
+#include "domain_addr.h"
+#include "domain_audit.h"
#include "domain_conf.h"
#include "domain_driver.h"
#include "domain_event.h"
+#include "domain_validate.h"
#include "network_event.h"
+#include "nwfilter_conf.h"
#include "snapshot_conf.h"
#include "virfdstream.h"
#include "storage_conf.h"
@@ -50,6 +52,7 @@
#include "node_device_conf.h"
#include "virnodedeviceobj.h"
#include "node_device_event.h"
+#include "vircgroup.h"
#include "virxml.h"
#include "virthread.h"
#include "virlog.h"
@@ -10035,6 +10038,383 @@ testConnectGetDomainCapabilities(virConnectPtr conn G_GNUC_UNUSED,
return virDomainCapsFormat(domCaps);
}
+static int
+testDomainAttachHostPCIDevice(testDriver *driver G_GNUC_UNUSED,
+ virDomainObj *vm,
+ virDomainHostdevDef *hostdev)
+{
+ int backend = hostdev->source.subsys.u.pci.backend;
+
+ switch ((virDomainHostdevSubsysPCIBackendType)backend) {
+ case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO:
+ case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT:
+ case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM:
+ break;
+
+ case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN:
+ case VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("test hypervisor does not support device assignment mode '%s'"),
+ virDomainHostdevSubsysPCIBackendTypeToString(backend));
+ return -1;
+ }
+
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("guest unexpectedly quit during hotplug"));
+ return -1;
+ }
+
+ VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1);
+
+ virDomainAuditHostdev(vm, hostdev, "attach", true);
+
+ vm->def->hostdevs[vm->def->nhostdevs++] = hostdev;
+
+ return 0;
+}
+
+static int
+testDomainAttachHostDevice(testDriver *driver,
+ virDomainObj *vm,
+ virDomainHostdevDef *hostdev)
+{
+ if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("hotplug is not supported for hostdev mode '%s'"),
+ virDomainHostdevModeTypeToString(hostdev->mode));
+ return -1;
+ }
+
+ if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("hotplug is not supported for hostdev subsys type '%s'"),
+ virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
+ return -1;
+ }
+
+ return testDomainAttachHostPCIDevice(driver, vm, hostdev);
+}
+
+static int
+testDomainAttachDeviceLive(virDomainObj *vm,
+ virDomainDeviceDef *dev,
+ testDriver *driver)
+{
+ int ret = -1;
+ const char *alias = NULL;
+
+ if ((virDomainDeviceType)dev->type != VIR_DOMAIN_DEVICE_HOSTDEV) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("live attach of device '%s' is not supported"),
+ virDomainDeviceTypeToString(dev->type));
+ return -1;
+ }
+
+ testDomainObjCheckHostdevTaint(vm, dev->data.hostdev);
+ if ((ret = testDomainAttachHostDevice(driver, vm, dev->data.hostdev)) != 0)
+ return ret;
+
+ alias = dev->data.hostdev->info->alias;
+ dev->data.hostdev = NULL;
+
+ if (alias) {
+ virObjectEvent *event;
+ event = virDomainEventDeviceAddedNewFromObj(vm, alias);
+ virObjectEventStateQueue(driver->eventState, event);
+ }
+
+ return 0;
+}
+
+static int
+testDomainAttachDeviceLiveAndConfig(virDomainObj *vm,
+ testDriver *driver,
+ const char *xml,
+ unsigned int flags)
+{
+ g_autoptr(virDomainDeviceDef) devConf = NULL;
+ g_autoptr(virDomainDeviceDef) devLive = NULL;
+ unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
+
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE, -1);
+
+ if (flags & VIR_DOMAIN_AFFECT_LIVE) {
+ if (!(devLive = virDomainDeviceDefParse(xml, vm->def,
+ driver->xmlopt, NULL,
+ parse_flags)))
+ return -1;
+
+ if (virDomainDeviceValidateAliasForHotplug(vm, devLive,
+ VIR_DOMAIN_AFFECT_LIVE) < 0)
+ return -1;
+
+ if (virDomainDefCompatibleDevice(vm->def, devLive, NULL,
+ VIR_DOMAIN_DEVICE_ACTION_ATTACH,
+ true) < 0)
+ return -1;
+
+ if (testDomainAttachDeviceLive(vm, devLive, driver) < 0)
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+testDomainAttachDeviceFlags(virDomainPtr domain,
+ const char *xml,
+ unsigned int flags) {
+
+ testDriver *driver = domain->conn->privateData;
+ virDomainObj *vm = NULL;
+ int ret = -1;
+
+ virNWFilterReadLockFilterUpdates();
+
+ if (!(vm = testDomObjFromDomain(domain)))
+ return -1;
+
+ if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
+ goto cleanup;
+
+ if (testDomainAttachDeviceLiveAndConfig(vm, driver, xml, flags) < 0)
+ goto cleanup;
+
+ ret = 0;
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ virNWFilterUnlockFilterUpdates();
+ return ret;
+
+}
+
+static int
+testDomainAttachDevice(virDomainPtr domain, const char *xml)
+{
+ return testDomainAttachDeviceFlags(domain, xml, 0);
+}
+
+/* search for a hostdev matching dev and detach it */
+static int
+testDomainDetachPrepHostdev(virDomainObj *vm,
+ virDomainHostdevDef *match,
+ virDomainHostdevDef **detach)
+{
+ virDomainHostdevSubsys *subsys = &match->source.subsys;
+ virDomainHostdevSubsysPCI *pcisrc = &subsys->u.pci;
+ virDomainHostdevDef *hostdev = NULL;
+
+ if (match->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("hot unplug is not supported for hostdev mode '%s'"),
+ virDomainHostdevModeTypeToString(match->mode));
+ return -1;
+ }
+
+ if (virDomainHostdevFind(vm->def, match, &hostdev) < 0) {
+ if (subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
+ virReportError(VIR_ERR_DEVICE_MISSING,
+ _("host pci device " VIR_PCI_DEVICE_ADDRESS_FMT
+ " not found"),
+ pcisrc->addr.domain, pcisrc->addr.bus,
+ pcisrc->addr.slot, pcisrc->addr.function);
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected hostdev type %d"), subsys->type);
+ }
+ return -1;
+ }
+
+ *detach = hostdev;
+
+ return 0;
+}
+
+static int
+testDomainRemoveHostDevice(testDriver *driver G_GNUC_UNUSED,
+ virDomainObj *vm,
+ virDomainHostdevDef *hostdev)
+{
+ virDomainNetDef *net = NULL;
+ size_t i;
+
+ VIR_DEBUG("Removing host device %s from domain %p %s",
+ hostdev->info->alias, vm, vm->def->name);
+
+ if (hostdev->parentnet) {
+ net = hostdev->parentnet;
+ for (i = 0; i < vm->def->nnets; i++) {
+ if (vm->def->nets[i] == hostdev->parentnet) {
+ virDomainNetRemove(vm->def, i);
+ break;
+ }
+ }
+ }
+
+ for (i = 0; i < vm->def->nhostdevs; i++) {
+ if (vm->def->hostdevs[i] == hostdev) {
+ virDomainHostdevRemove(vm->def, i);
+ break;
+ }
+ }
+
+ virDomainAuditHostdev(vm, hostdev, "detach", true);
+
+ virDomainHostdevDefFree(hostdev);
+
+ if (net) {
+ if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
+ g_autoptr(virConnect) conn = virGetConnectNetwork();
+ if (conn)
+ virDomainNetReleaseActualDevice(conn, vm->def, net);
+ else
+ VIR_WARN("Unable to release network device '%s'", NULLSTR(net->ifname));
+ }
+ virDomainNetDefFree(net);
+ }
+
+ return 0;
+}
+
+static int
+testDomainRemoveDevice(testDriver *driver,
+ virDomainObj *vm,
+ virDomainDeviceDef *dev)
+{
+ virDomainDeviceInfo *info;
+ virObjectEvent *event;
+ g_autofree char *alias = NULL;
+
+ /*
+ * save the alias to use when sending a DEVICE_REMOVED event after
+ * all other teardown is complete
+ */
+ if ((info = virDomainDeviceGetInfo(dev)))
+ alias = g_strdup(info->alias);
+ info = NULL;
+
+ if ((virDomainDeviceType)dev->type != VIR_DOMAIN_DEVICE_HOSTDEV) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("don't know how to remove a %s device"),
+ virDomainDeviceTypeToString(dev->type));
+ goto out;
+ }
+
+ if (testDomainRemoveHostDevice(driver, vm, dev->data.hostdev) < 0)
+ return -1;
+
+out:
+ event = virDomainEventDeviceRemovedNewFromObj(vm, alias);
+ virObjectEventStateQueue(driver->eventState, event);
+
+ return 0;
+}
+
+static int
+testDomainDetachDeviceLive(virDomainObj *vm,
+ virDomainDeviceDef *match,
+ testDriver *driver)
+{
+ virDomainDeviceDef detach = { .type = match->type };
+ virDomainDeviceInfo *info = NULL;
+
+ if ((virDomainDeviceType)match->type != VIR_DOMAIN_DEVICE_HOSTDEV) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("live detach of device '%s' is not supported"),
+ virDomainDeviceTypeToString(match->type));
+ return -1;
+ }
+
+ if (testDomainDetachPrepHostdev(vm, match->data.hostdev,
+ &detach.data.hostdev) < 0)
+ return -1;
+
+ /* "detach" now points to the actual device we want to detach */
+
+ if (!(info = virDomainDeviceGetInfo(&detach))) {
+ /*
+ * This should never happen, since all of the device types in
+ * the switch cases that end with a "break" instead of a
+ * return have a virDeviceInfo in them.
+ */
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("device of type '%s' has no device info"),
+ virDomainDeviceTypeToString(detach.type));
+ return -1;
+ }
+
+ /* Make generic validation checks common to all device types */
+
+ if (!info->alias) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Cannot detach %s device with no alias"),
+ virDomainDeviceTypeToString(detach.type));
+ return -1;
+ }
+
+ return testDomainRemoveDevice(driver, vm, &detach);
+}
+
+static int
+testDomainDetachDeviceAliasLiveAndConfig(testDriver *driver,
+ virDomainObj *vm,
+ const char *alias,
+ unsigned int flags)
+{
+ virDomainDef *def = NULL;
+ g_autoptr(virDomainDef) vmdef = NULL;
+
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE, -1);
+
+ if (virDomainObjGetDefs(vm, flags, &def, NULL) < 0)
+ return -1;
+
+ if (def) {
+ virDomainDeviceDef dev;
+
+ if (virDomainDefFindDevice(def, alias, &dev, true) < 0)
+ return -1;
+
+ if (testDomainDetachDeviceLive(vm, &dev, driver) < 0)
+ return -1;
+ }
+
+ if (vmdef) {
+ if (virDomainDefSave(vmdef, driver->xmlopt, NULL) < 0)
+ return -1;
+ virDomainObjAssignDef(vm, &vmdef, false, NULL);
+ }
+
+ return 0;
+}
+
+static int
+testDomainDetachDeviceAlias(virDomainPtr dom,
+ const char *alias,
+ unsigned int flags)
+{
+ testDriver *driver = dom->conn->privateData;
+ virDomainObj *vm = NULL;
+ int ret = -1;
+
+ if (!(vm = testDomObjFromDomain(dom)))
+ return -1;
+
+ if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
+ goto cleanup;
+
+ if (testDomainDetachDeviceAliasLiveAndConfig(driver, vm, alias, flags) < 0)
+ goto cleanup;
+
+ ret = 0;
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
/*
* Test driver
@@ -10058,6 +10438,9 @@ static virHypervisorDriver testHypervisorDriver = {
.connectListDomains = testConnectListDomains, /* 0.1.1 */
.connectNumOfDomains = testConnectNumOfDomains, /* 0.1.1 */
.connectListAllDomains = testConnectListAllDomains, /* 0.9.13 */
+ .domainAttachDevice = testDomainAttachDevice, /* 9.10.0 */
+ .domainAttachDeviceFlags = testDomainAttachDeviceFlags, /* 9.10.0 */
+ .domainDetachDeviceAlias = testDomainDetachDeviceAlias, /* 9.10.0 */
.domainCreateXML = testDomainCreateXML, /* 0.1.4 */
.domainCreateXMLWithFiles = testDomainCreateXMLWithFiles, /* 5.7.0 */
.domainLookupByID = testDomainLookupByID, /* 0.1.1 */
--
2.27.0
1 year, 1 month
[PATCH V3] support for hotplug/hotunplug in test hypervisor
by Thanos Makatos
Signed-off-by: Thanos Makatos <thanos.makatos(a)nutanix.com>
---
src/test/test_driver.c | 59 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index e87d7cfd44..d605649262 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -10035,6 +10035,62 @@ testConnectGetDomainCapabilities(virConnectPtr conn G_GNUC_UNUSED,
return virDomainCapsFormat(domCaps);
}
+static int
+testVirDomainAttachDeviceFlags(virDomainPtr domain,
+ const char *xml,
+ unsigned int flags G_GNUC_UNUSED) {
+
+ int ret = -1;
+ virDomainObj *vm;
+ testDriver *driver;
+ virDomainDeviceDef *devConf;
+
+ if (!(vm = testDomObjFromDomain(domain)))
+ return -1;
+
+ driver = domain->conn->privateData;
+
+ if (!(devConf = virDomainDeviceDefParse(xml, vm->def, driver->xmlopt,
+ NULL, 0)))
+ goto out;
+
+ VIR_APPEND_ELEMENT(vm->def->hostdevs, vm->def->nhostdevs,
+ devConf->data.hostdev);
+ virDomainDeviceDefFree(devConf);
+ ret = 0;
+out:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
+static int
+testVirDomainAttachDevice(virDomainPtr domain, const char *xml)
+{
+ return testVirDomainAttachDeviceFlags(domain, xml, 0);
+}
+
+static int
+testVirDomainDetachDeviceAlias(virDomainPtr domain,
+ const char *alias,
+ unsigned int flags G_GNUC_UNUSED)
+{
+ virDomainObj *vm;
+ size_t i;
+ bool found = false;
+
+ if (!(vm = testDomObjFromDomain(domain)))
+ return -1;
+
+ for (i = 0; i < vm->def->nhostdevs && !found; i++) {
+ if (!strcmp(vm->def->hostdevs[i]->info->alias, alias)) {
+ virDomainHostdevDefFree(vm->def->hostdevs[i]);
+ VIR_DELETE_ELEMENT(vm->def->hostdevs, i, vm->def->nhostdevs);
+ found = true;
+ }
+ }
+ virDomainObjEndAPI(&vm);
+ return found ? 0 : -1;
+}
/*
* Test driver
@@ -10058,6 +10114,9 @@ static virHypervisorDriver testHypervisorDriver = {
.connectListDomains = testConnectListDomains, /* 0.1.1 */
.connectNumOfDomains = testConnectNumOfDomains, /* 0.1.1 */
.connectListAllDomains = testConnectListAllDomains, /* 0.9.13 */
+ .domainAttachDevice = testVirDomainAttachDevice, /* 9.9.0 */
+ .domainAttachDeviceFlags = testVirDomainAttachDeviceFlags, /* 9.9.0 */
+ .domainDetachDeviceAlias = testVirDomainDetachDeviceAlias, /* 9.9.0 */
.domainCreateXML = testDomainCreateXML, /* 0.1.4 */
.domainCreateXMLWithFiles = testDomainCreateXMLWithFiles, /* 5.7.0 */
.domainLookupByID = testDomainLookupByID, /* 0.1.1 */
--
2.27.0
1 year, 1 month
[libvirt PATCH] systemd: More tweaks to Description and Documentation lines
by Andrea Bolognani
We recently unified all services and sockets, except a couple
were missed. Finish the job.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/remote/virt-guest-shutdown.target | 4 ++--
tools/libvirt-guests.service.in | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/remote/virt-guest-shutdown.target b/src/remote/virt-guest-shutdown.target
index 25d4aaa267..34219d00b0 100644
--- a/src/remote/virt-guest-shutdown.target
+++ b/src/remote/virt-guest-shutdown.target
@@ -1,3 +1,3 @@
[Unit]
-Description=Libvirt guests shutdown
-Documentation=https://libvirt.org
+Description=libvirt guests shutdown target
+Documentation=https://libvirt.org/
diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
index c547218f2a..b044444298 100644
--- a/tools/libvirt-guests.service.in
+++ b/tools/libvirt-guests.service.in
@@ -1,5 +1,7 @@
[Unit]
-Description=Suspend/Resume Running libvirt Guests
+Description=libvirt guests suspend/resume service
+Documentation=man:libvirt-guests(8)
+Documentation=https://libvirt.org/
Requires=virt-guest-shutdown.target
After=network.target
After=time-sync.target
@@ -10,8 +12,6 @@ After=virtvboxd.socket
After=virtvzd.socket
After=virtxend.socket
After=virt-guest-shutdown.target
-Documentation=man:libvirt-guests(8)
-Documentation=https://libvirt.org
[Service]
EnvironmentFile=-@initconfdir@/libvirt-guests
--
2.41.0
1 year, 1 month
[libvirt PATCH] conf: virDomainDiskSourceFormat: check for srcpool presence correctly
by Ján Tomko
As a guard against programming errors, one part of the condition
only dereferences srcpool if it exists, other one does not.
Move the check up one level so that it actually has a chance to do
something useful.
Fixes: 19b1c0d31988a3a10c4694c10c27eb15c018f450
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_conf.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 80f467ae7a..99f9d56f07 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -22357,14 +22357,12 @@ virDomainDiskSourceFormat(virBuffer *buf,
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
- if (src->type == VIR_STORAGE_TYPE_VOLUME) {
- if (src->srcpool) {
- virBufferEscapeString(&attrBuf, " pool='%s'", src->srcpool->pool);
- virBufferEscapeString(&attrBuf, " volume='%s'", src->srcpool->volume);
- if (src->srcpool->mode)
- virBufferAsprintf(&attrBuf, " mode='%s'",
- virStorageSourcePoolModeTypeToString(src->srcpool->mode));
- }
+ if (src->type == VIR_STORAGE_TYPE_VOLUME && src->srcpool) {
+ virBufferEscapeString(&attrBuf, " pool='%s'", src->srcpool->pool);
+ virBufferEscapeString(&attrBuf, " volume='%s'", src->srcpool->volume);
+ if (src->srcpool->mode)
+ virBufferAsprintf(&attrBuf, " mode='%s'",
+ virStorageSourcePoolModeTypeToString(src->srcpool->mode));
if (flags & VIR_DOMAIN_DEF_FORMAT_VOLUME_TRANSLATED &&
src->srcpool->actualtype != VIR_STORAGE_TYPE_NONE) {
--
2.41.0
1 year, 1 month
[PATCH] ci: workaround broken opensuse leap 15.5 tirpc
by Daniel P. Berrangé
Temporarily disable '-Wmissing-include-dirs' becuase the
libtirpc pkg-confog file has a bogus include dir. The
headers can fortunately still be found since they are
in the system include dir.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
ci/gitlab/builds.yml | 2 ++
ci/manifest.yml | 2 ++
2 files changed, 4 insertions(+)
diff --git a/ci/gitlab/builds.yml b/ci/gitlab/builds.yml
index 9ae2225e35..e1ea87db1b 100644
--- a/ci/gitlab/builds.yml
+++ b/ci/gitlab/builds.yml
@@ -332,6 +332,7 @@ x86_64-opensuse-leap-15-prebuilt-env:
optional: true
allow_failure: false
variables:
+ CFLAGS: -Wno-missing-include-dirs
NAME: opensuse-leap-15
RPM: skip
@@ -340,6 +341,7 @@ x86_64-opensuse-leap-15-local-env:
needs: []
allow_failure: false
variables:
+ CFLAGS: -Wno-missing-include-dirs
IMAGE: registry.opensuse.org/opensuse/leap:15.5
NAME: opensuse-leap-15
RPM: skip
diff --git a/ci/manifest.yml b/ci/manifest.yml
index 0e5a17a2bd..2af8e62f28 100644
--- a/ci/manifest.yml
+++ b/ci/manifest.yml
@@ -205,6 +205,8 @@ targets:
- arch: x86_64
variables:
RPM: skip
+ # Keep until fix for: https://bugzilla.opensuse.org/show_bug.cgi?id=1216862
+ CFLAGS: -Wno-missing-include-dirs
opensuse-tumbleweed:
jobs:
--
2.41.0
1 year, 1 month
[libvirt PATCH 0/5] ci: Add macOS 13 & 14, drop macOS 12
by Andrea Bolognani
Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines/1062214982
Assumes that
https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/444
has been merged, which it hasn't yet, but I don't expect it to be
controversial.
I've added both macOS 13 and 14, doubling the amount of coverage. I'm
not aware of us being particularly tight on Cirrus CI credits, but if
that's the case we can just skip the macOS 13 patch.
The job environment is supposed to make the build system pick up
dependencies that are installed via Homebrew but can't be exposed by
default because they conflict with OS-supplied packages. Right now it
doesn't really do anything, because it hasn't been updated with the
switch to aarch64. I'm going to look into it later, but for now I've
left it as-is as reminder/documentation.
Andrea Bolognani (5):
ci: Update generated files
ci: Drop rpcgen override from macOS $PATH
ci: Add macOS 13
ci: Add macOS 14
ci: Drop macOS 12
ci/buildenv/almalinux-8.sh | 1 -
ci/buildenv/alpine-317.sh | 1 -
ci/buildenv/alpine-edge.sh | 1 -
ci/buildenv/centos-stream-8.sh | 1 -
ci/buildenv/centos-stream-9.sh | 1 -
ci/buildenv/debian-11-cross-aarch64.sh | 1 -
ci/buildenv/debian-11-cross-armv6l.sh | 1 -
ci/buildenv/debian-11-cross-armv7l.sh | 1 -
ci/buildenv/debian-11-cross-i686.sh | 1 -
ci/buildenv/debian-11-cross-mips64el.sh | 1 -
ci/buildenv/debian-11-cross-mipsel.sh | 1 -
ci/buildenv/debian-11-cross-ppc64le.sh | 1 -
ci/buildenv/debian-11-cross-s390x.sh | 1 -
ci/buildenv/debian-11.sh | 1 -
ci/buildenv/debian-12-cross-aarch64.sh | 1 -
ci/buildenv/debian-12-cross-armv6l.sh | 1 -
ci/buildenv/debian-12-cross-armv7l.sh | 1 -
ci/buildenv/debian-12-cross-i686.sh | 1 -
ci/buildenv/debian-12-cross-mips64el.sh | 1 -
ci/buildenv/debian-12-cross-mipsel.sh | 1 -
ci/buildenv/debian-12-cross-ppc64le.sh | 1 -
ci/buildenv/debian-12-cross-s390x.sh | 1 -
ci/buildenv/debian-12.sh | 1 -
ci/buildenv/debian-sid-cross-aarch64.sh | 1 -
ci/buildenv/debian-sid-cross-armv6l.sh | 1 -
ci/buildenv/debian-sid-cross-armv7l.sh | 1 -
ci/buildenv/debian-sid-cross-i686.sh | 1 -
ci/buildenv/debian-sid-cross-mips64el.sh | 1 -
ci/buildenv/debian-sid-cross-ppc64le.sh | 1 -
ci/buildenv/debian-sid-cross-s390x.sh | 1 -
ci/buildenv/debian-sid.sh | 1 -
ci/buildenv/fedora-37.sh | 1 -
ci/buildenv/fedora-38-cross-mingw32.sh | 2 +-
ci/buildenv/fedora-38-cross-mingw64.sh | 2 +-
ci/buildenv/fedora-38.sh | 1 -
ci/buildenv/fedora-rawhide-cross-mingw32.sh | 2 +-
ci/buildenv/fedora-rawhide-cross-mingw64.sh | 2 +-
ci/buildenv/fedora-rawhide.sh | 1 -
ci/buildenv/opensuse-leap-15.sh | 1 -
ci/buildenv/opensuse-tumbleweed.sh | 1 -
ci/buildenv/ubuntu-2004.sh | 1 -
ci/buildenv/ubuntu-2204.sh | 1 -
ci/cirrus/{macos-12.vars => macos-13.vars} | 2 +-
ci/cirrus/{macos-12.vars => macos-14.vars} | 2 +-
ci/containers/almalinux-8.Dockerfile | 1 -
ci/containers/alpine-317.Dockerfile | 1 -
ci/containers/alpine-edge.Dockerfile | 1 -
ci/containers/centos-stream-8.Dockerfile | 1 -
ci/containers/centos-stream-9.Dockerfile | 1 -
.../debian-11-cross-aarch64.Dockerfile | 1 -
.../debian-11-cross-armv6l.Dockerfile | 1 -
.../debian-11-cross-armv7l.Dockerfile | 1 -
ci/containers/debian-11-cross-i686.Dockerfile | 1 -
.../debian-11-cross-mips64el.Dockerfile | 1 -
.../debian-11-cross-mipsel.Dockerfile | 1 -
.../debian-11-cross-ppc64le.Dockerfile | 1 -
.../debian-11-cross-s390x.Dockerfile | 1 -
ci/containers/debian-11.Dockerfile | 1 -
.../debian-12-cross-aarch64.Dockerfile | 1 -
.../debian-12-cross-armv6l.Dockerfile | 1 -
.../debian-12-cross-armv7l.Dockerfile | 1 -
ci/containers/debian-12-cross-i686.Dockerfile | 1 -
.../debian-12-cross-mips64el.Dockerfile | 1 -
.../debian-12-cross-mipsel.Dockerfile | 1 -
.../debian-12-cross-ppc64le.Dockerfile | 1 -
.../debian-12-cross-s390x.Dockerfile | 1 -
ci/containers/debian-12.Dockerfile | 1 -
.../debian-sid-cross-aarch64.Dockerfile | 1 -
.../debian-sid-cross-armv6l.Dockerfile | 1 -
.../debian-sid-cross-armv7l.Dockerfile | 1 -
.../debian-sid-cross-i686.Dockerfile | 1 -
.../debian-sid-cross-mips64el.Dockerfile | 1 -
.../debian-sid-cross-ppc64le.Dockerfile | 1 -
.../debian-sid-cross-s390x.Dockerfile | 1 -
ci/containers/debian-sid.Dockerfile | 1 -
ci/containers/fedora-37.Dockerfile | 1 -
.../fedora-38-cross-mingw32.Dockerfile | 2 +-
.../fedora-38-cross-mingw64.Dockerfile | 2 +-
ci/containers/fedora-38.Dockerfile | 1 -
.../fedora-rawhide-cross-mingw32.Dockerfile | 2 +-
.../fedora-rawhide-cross-mingw64.Dockerfile | 2 +-
ci/containers/fedora-rawhide.Dockerfile | 1 -
ci/containers/opensuse-leap-15.Dockerfile | 1 -
ci/containers/opensuse-tumbleweed.Dockerfile | 1 -
ci/containers/ubuntu-2004.Dockerfile | 1 -
ci/containers/ubuntu-2204.Dockerfile | 1 -
ci/gitlab/builds.yml | 24 +++++++++++++++----
ci/manifest.yml | 11 +++++++--
88 files changed, 39 insertions(+), 92 deletions(-)
copy ci/cirrus/{macos-12.vars => macos-13.vars} (91%)
rename ci/cirrus/{macos-12.vars => macos-14.vars} (91%)
--
2.41.0
1 year, 1 month
[PATCH] virDomainDeviceInfoCheckABIStability: Implement proper check for CCW addresses
by Peter Krempa
CCW addresses need to be also checked for ABI stability.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/domain_conf.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 80f467ae7a..5ce1793c2d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19719,10 +19719,21 @@ virDomainDeviceInfoCheckABIStability(virDomainDeviceInfo *src,
}
break;
+ case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
+ if (src->addr.ccw.cssid != dst->addr.ccw.cssid ||
+ src->addr.ccw.ssid != dst->addr.ccw.ssid ||
+ src->addr.ccw.devno != dst->addr.ccw.devno) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target device CCW address %1$x.%2$x.%3$04x does not match source %4$x.%5$x.%6$04x"),
+ dst->addr.ccw.cssid, dst->addr.ccw.ssid, dst->addr.ccw.devno,
+ src->addr.ccw.cssid, src->addr.ccw.ssid, src->addr.ccw.devno);
+ return false;
+ }
+ break;
+
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390:
- case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_UNASSIGNED:
--
2.41.0
1 year, 1 month
[PATCH] virhostmem: Get total memory on macOS properly
by Michal Privoznik
Problem with HW_PHYSMEM sysctl on 64-bit macOS is that it
returns a 32-bit signed value. Thus it overflows. Switching to
HW_MEMSIZE is recommended as it's of an uint_64 type [1].
1: https://github.com/apple-oss-distributions/xnu/blob/xnu-10002.1.13/bsd/sy...
Reported-by: Jaroslav Suchanek <jsuchane(a)redhat.com>
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virhostmem.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c
index 1da2759ac3..a7027af835 100644
--- a/src/util/virhostmem.c
+++ b/src/util/virhostmem.c
@@ -617,7 +617,10 @@ virHostMemGetTotal(void)
unsigned long long physmem = 0;
size_t len = sizeof(physmem);
- if (sysctlbyname("hw.physmem", &physmem, &len, NULL, 0) < 0) {
+ /* On macOS hw.physmem is int32_t which doesn't fly with >4GiB of memory.
+ * But hw.memsize is uint64_t. */
+ if (sysctlbyname("hw.memsize", &physmem, &len, NULL, 0) < 0 &&
+ sysctlbyname("hw.physmem", &physmem, &len, NULL, 0) < 0) {
virReportSystemError(errno, "%s",
_("Unable to query memory total"));
return 0;
--
2.41.0
1 year, 1 month