!280 适配openEuler构建,去除mdev依赖

From: @Mayunlong541 
Reviewed-by: @jjiacheng, @mdsc 
Signed-off-by: @mdsc
This commit is contained in:
openeuler-ci-bot 2024-03-28 09:38:23 +00:00 committed by Gitee
commit 7a960907c1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 124 additions and 9 deletions

View File

@ -35,6 +35,7 @@
%define with_lxc 0%{!?_without_lxc:0}
%define with_libxl 0%{!?_without_libxl:0}
%define with_vbox 0%{!?_without_vbox:0}
%define with_client_qemu 0%{!?_without_client_qemu:0}
%ifarch %{arches_qemu_kvm}
%define with_qemu_kvm %{with_qemu}
@ -93,15 +94,15 @@
# A few optional bits off by default, we enable later
%define with_fuse 0
%define with_sanlock 0
%define with_sanlock 1
%define with_numad 0
%define with_nbdkit 0
%define with_nbdkit_config_default 0
%define with_firewalld_zone 0
%define with_firewalld_zone 1
%define with_netcf 0
%define with_libssh2 0
%define with_wireshark 0
%define with_libssh 0
%define with_libssh2 1
%define with_wireshark 1
%define with_libssh 1
%define with_dmidecode 0
# Finally set the OS / architecture specific special cases
@ -141,7 +142,7 @@
# fuse is used to provide virtualized /proc for LXC
%if %{with_lxc}
%define with_fuse 0%{!?_without_fuse:1}
%define with_fuse 0%{!?_without_fuse:0}
%endif
# Enable sanlock library for lock management with QEMU
@ -270,14 +271,16 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 9.10.0
Release: 1%{?dist}
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
Release: 2
License: LGPLv2+
URL: https://libvirt.org/
%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
%define mainturl stable_updates/
%endif
Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz
Patch0000: nodedev-delete-mdev.patch
Patch0001: meson.build-isolate-the-client-qemu-using-macros.patch
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
@ -290,8 +293,10 @@ Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
%endif
%if %{with_qemu}
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
%if %{with_client_qemu}
Requires: libvirt-client-qemu = %{version}-%{release}
%endif
%endif
# We had UML driver, but we've removed it.
Obsoletes: libvirt-daemon-driver-uml <= 5.0.0
Obsoletes: libvirt-daemon-uml <= 5.0.0
@ -352,6 +357,7 @@ BuildRequires: libnl3-devel
BuildRequires: libselinux-devel
BuildRequires: iptables
BuildRequires: ebtables
BuildRequires: module-init-tools
# For modprobe
BuildRequires: kmod
BuildRequires: cyrus-sasl-devel
@ -614,7 +620,7 @@ Requires: libvirt-libs = %{version}-%{release}
# needed for device enumeration
Requires: systemd >= 185
# For managing persistent mediated devices
Requires: mdevctl
# Requires: mdevctl
# for modprobe of pci devices
Requires: module-init-tools
@ -1018,6 +1024,7 @@ Obsoletes: libvirt-bash-completion < 7.3.0
The client binaries needed to access the virtualization
capabilities of recent versions of Linux (and other OSes).
%if %{with_client_qemu}
%package client-qemu
Summary: Additional client side utilities for QEMU
Requires: libvirt-libs = %{version}-%{release}
@ -1028,6 +1035,7 @@ Requires: python3-lxml
%description client-qemu
The additional client binaries are used to interact
with some QEMU specific features of libvirt.
%endif
%package libs
Summary: Client side libraries
@ -1482,6 +1490,12 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
%endif
%if ! %{with_client_qemu}
rm -rf $RPM_BUILD_ROOT%{_mandir}/man1/virt-qemu-qmp-proxy.1*
rm -rf $RPM_BUILD_ROOT%{_mandir}/man1/virt-qemu-sev-validate.1*
rm -rf $RPM_BUILD_ROOT%{_bindir}/virt-qemu-qmp-proxy
rm -rf $RPM_BUILD_ROOT%{_bindir}/virt-qemu-sev-validate
%endif
%if ! %{with_qemu}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
@ -2361,11 +2375,13 @@ exit 0
%{_datadir}/bash-completion/completions/virsh
%if %{with_qemu}
%if %{with_client_qemu}
%files client-qemu
%{_mandir}/man1/virt-qemu-qmp-proxy.1*
%{_mandir}/man1/virt-qemu-sev-validate.1*
%{_bindir}/virt-qemu-qmp-proxy
%{_bindir}/virt-qemu-sev-validate
%endif
%endif
%files libs -f %{name}.lang
@ -2559,5 +2575,10 @@ exit 0
%endif
%changelog
* Wed Mar 27 2024 mayunlong <mayunlong6@huawei.com> - 9.10.0-2
- nodedev: delete mdev
- spec: fix some switch in spec
- spec: isolate the client-qemu using macros
* Thu Feb 29 2024 mayunlong <mayunlong6@huawei.com> - 9.10.0-1
- Update to 9.10.0 release, Initial package for openEuler.

View File

@ -0,0 +1,64 @@
From 00e273149d7584750df88be94ce7f53beea26f6d Mon Sep 17 00:00:00 2001
From: MaYunlong <mayunlong6@huawei.com>
Date: Wed, 27 Mar 2024 07:56:14 +0800
Subject: [PATCH] meson.build: isolate the client-qemu using macros
---
docs/manpages/meson.build | 4 ++--
meson.build | 1 +
tools/meson.build | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
index bdc1701..38ee547 100644
--- a/docs/manpages/meson.build
+++ b/docs/manpages/meson.build
@@ -18,9 +18,9 @@ docs_man_files = [
{ 'name': 'virt-pki-query-dn', 'section': '1', 'install': true },
{ 'name': 'virt-pki-validate', 'section': '1', 'install': true },
{ 'name': 'virt-qemu-run', 'section': '1', 'install': conf.has('WITH_QEMU') },
- { 'name': 'virt-qemu-qmp-proxy', 'section': '1', 'install': conf.has('WITH_QEMU') },
+ { 'name': 'virt-qemu-qmp-proxy', 'section': '1', 'install': conf.has('WITH_CLIENT_QEMU') },
{ 'name': 'virt-xml-validate', 'section': '1', 'install': true },
- { 'name': 'virt-qemu-sev-validate', 'section': '1', 'install': conf.has('WITH_QEMU') },
+ { 'name': 'virt-qemu-sev-validate', 'section': '1', 'install': conf.has('WITH_CLIENT_QEMU') },
{ 'name': 'libvirt-guests', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
{ 'name': 'libvirtd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
diff --git a/meson.build b/meson.build
index 611cc58..2a7fa8c 100644
--- a/meson.build
+++ b/meson.build
@@ -1637,6 +1637,7 @@ if not get_option('driver_qemu').disabled()
if use_qemu
conf.set('WITH_QEMU', 1)
+ conf.set('WITH_CLIENT_QEMU', 0)
qemu_moddir = get_option('qemu_moddir')
if qemu_moddir == ''
qemu_moddir = libdir / 'qemu'
diff --git a/tools/meson.build b/tools/meson.build
index c72f760..9a5bbd6 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -301,7 +301,7 @@ if conf.has('WITH_SANLOCK')
)
endif
-if conf.has('WITH_QEMU')
+if conf.has('WITH_CLIENT_QEMU')
install_data('virt-qemu-sev-validate',
install_dir: bindir)
endif
@@ -327,7 +327,7 @@ if conf.has('WITH_LIBVIRTD')
endif
endif
-if conf.has('WITH_QEMU')
+if conf.has('WITH_CLIENT_QEMU')
install_data('virt-qemu-qmp-proxy',
install_dir: bindir)
endif
--
2.33.0

30
nodedev-delete-mdev.patch Normal file
View File

@ -0,0 +1,30 @@
From b782178492141454fc263040708dffa039e7de2a Mon Sep 17 00:00:00 2001
From: mayunlong <mayunlong6@huawei.com>
Date: Wed, 27 Mar 2024 01:08:02 +0800
Subject: [PATCH] nodedev: delete mdev
mdev is deleted because it has no application scenario
Signed-off-by: mayunlong <mayunlong6@huawei.com>
---
src/node_device/node_device_driver.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index a59cd08..f2c3b36 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -850,6 +850,10 @@ nodeDeviceCreateXMLMdev(virConnectPtr conn,
{
g_autofree char *uuid = NULL;
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Unsupported device type"));
+ return NULL;
+
if (!def->parent) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("cannot create a mediated device without a parent"));
--
2.33.0