diff --git a/.gitignore b/.gitignore index 6893444..a490e7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /virt-manager-*.tar.gz -/virt-manager-*.tar.xz diff --git a/0001-initrdinject-Use-full-option-versions-for-cpio.patch b/0001-initrdinject-Use-full-option-versions-for-cpio.patch new file mode 100644 index 0000000..3ce130c --- /dev/null +++ b/0001-initrdinject-Use-full-option-versions-for-cpio.patch @@ -0,0 +1,25 @@ +From: Cole Robinson +Date: Tue, 2 Apr 2019 15:02:47 -0400 +Subject: [PATCH virt-manager] initrdinject: Use full option versions for cpio + +Makes it more self documenting IMO + +(cherry picked from commit 309840b9535b0e1965ed177b4558652faa256b36) +--- + virtinst/initrdinject.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/virtinst/initrdinject.py b/virtinst/initrdinject.py +index 78c18c28..9a09f20c 100644 +--- a/virtinst/initrdinject.py ++++ b/virtinst/initrdinject.py +@@ -30,7 +30,8 @@ def perform_initrd_injections(initrd, injections, scratchdir): + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=tempdir) +- cpio_proc = subprocess.Popen(['cpio', '-o', '--null', '-Hnewc', '--quiet'], ++ cpio_proc = subprocess.Popen(['cpio', '--create', '--null', '--quiet', ++ '--format=newc'], + stdin=find_proc.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, diff --git a/0001-virtinst-cloudinit-include-empty-meta-data-file.patch b/0001-virtinst-cloudinit-include-empty-meta-data-file.patch deleted file mode 100644 index 4d8459a..0000000 --- a/0001-virtinst-cloudinit-include-empty-meta-data-file.patch +++ /dev/null @@ -1,32 +0,0 @@ -From ea71cf9a8a4161ce6e19eacf5f0d86d40ab74f23 Mon Sep 17 00:00:00 2001 -Message-ID: -From: Pavel Hrdina -Date: Mon, 29 Sep 2025 16:14:35 +0200 -Subject: [PATCH] virtinst: cloudinit: include empty meta-data file - -Refactor creation of cloud-init config files introduced a bug where we -stopped including empty meta-data file. - -Introduced-by: 5b2d0997a1d2d213b17c227169da64e2fa7d09a6 -Fixes: https://github.com/virt-manager/virt-manager/issues/975 -Signed-off-by: Pavel Hrdina ---- - virtinst/install/cloudinit.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/virtinst/install/cloudinit.py b/virtinst/install/cloudinit.py -index 3f565f399..b2378fbfa 100644 ---- a/virtinst/install/cloudinit.py -+++ b/virtinst/install/cloudinit.py -@@ -36,7 +36,7 @@ class _CloudInitConfig: - def _create_file(self): - content = self._content() - -- if not content: -+ if content is None: - return None - - fileobj = tempfile.NamedTemporaryFile( --- -2.52.0 - diff --git a/0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch b/0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch new file mode 100644 index 0000000..881c1de --- /dev/null +++ b/0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch @@ -0,0 +1,33 @@ +From: Cole Robinson +Date: Wed, 3 Apr 2019 18:07:12 -0400 +Subject: [PATCH virt-manager] initrdinject: Force added files to be owned as + root (bz 1686464) + +systemd in fedora30 has some new security restriction about non-root +owned directories. Initrd inject would tickle this because the cpio +archive would cause the root dir in the initrd to be owned by the +uid that launched virt-install. + +Pass --owner=+0:+0 to cpio to force root ownership + +Suggested-by: James Szinger + +https://bugzilla.redhat.com/show_bug.cgi?id=1686464 +(cherry picked from commit c6b5f22fa61d87557b5fab23be080073d2f7906e) +--- + virtinst/initrdinject.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virtinst/initrdinject.py b/virtinst/initrdinject.py +index 9a09f20c..4032f9ba 100644 +--- a/virtinst/initrdinject.py ++++ b/virtinst/initrdinject.py +@@ -31,7 +31,7 @@ def perform_initrd_injections(initrd, injections, scratchdir): + stderr=subprocess.PIPE, + cwd=tempdir) + cpio_proc = subprocess.Popen(['cpio', '--create', '--null', '--quiet', +- '--format=newc'], ++ '--format=newc', '--owner=+0:+0'], + stdin=find_proc.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, diff --git a/sources b/sources index e062edf..a953d6f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (virt-manager-5.1.0.tar.xz) = 6306500ae442a6ccb36d5f19bc26b0e32984ca145ee8d41a475e175ee4db6c0d253f0cf9d908c30e3269cf7aabdad4bbd30e84f3cd0477f233da1e43e0235e3c +SHA512 (virt-manager-2.1.0.tar.gz) = 48590ff58246e13b73c7ab741ca854bfebae27fb90a891168db5d3fac1d066cce603f83b8d993e70e387624f911fc8503abe488e7992bc50f49d7e980aed5afb diff --git a/virt-manager.spec b/virt-manager.spec index fdef010..3de7f11 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -1,33 +1,42 @@ +# This package depends on automagic byte compilation +# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 +%global _python_bytecompile_extra 1 + # -*- rpm-spec -*- -%global default_hvs "qemu,xen,lxc" -%global have_spice %{defined fedora} +# RPM doesn't detect that code in /usr/share is python3, this forces it +# https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Python_bytecompilation +%global __python %{__python3} +%global with_guestfs 0 +%global default_hvs "qemu,xen,lxc" + # End local config Name: virt-manager -Version: 5.1.0 -Release: 5%{?dist} +Version: 2.1.0 +Release: 2%{?dist} %global verrel %{version}-%{release} Summary: Desktop tool for managing virtual machines via libvirt -License: GPL-2.0-or-later +License: GPLv2+ BuildArch: noarch URL: https://virt-manager.org/ -Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.xz +Source0: https://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz + +# Fix --initrd-inject with f30 URLs (bz #1686464) +Patch0001: 0001-initrdinject-Use-full-option-versions-for-cpio.patch +Patch0002: 0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch -Patch1: 0001-virtinst-cloudinit-include-empty-meta-data-file.patch Requires: virt-manager-common = %{verrel} -Requires: python3-gobject >= 3.31.3 -Requires: gtk3 >= 3.22.0 +Requires: python3-gobject +Requires: gtk3 Requires: libvirt-glib >= 0.0.9 Requires: gtk-vnc2 -%if %{have_spice} Requires: spice-gtk3 -%endif # virt-manager is one of those apps that people will often install onto # a headless machine for use over SSH. This means the virt-manager dep @@ -35,12 +44,7 @@ Requires: spice-gtk3 # Unfortunately nothing in our chain has an explicit dep on some kind # of usable gsettings backend, so we explicitly depend on dconf so that # user settings actually persist across app runs. -# -# That said, we skip this dep for flatpak, where dconf isn't used in -# the runtime. gsettings defaults to ini file in that case -%if ! 0%{?flatpak} Requires: dconf -%endif # The vte291 package is actually the latest vte with API version 2.91, while # the vte3 package is effectively a compat package with API version 2.90. @@ -48,21 +52,13 @@ Requires: dconf # no ambiguity. Requires: vte291 -# We can use GtkTextView, gtksourceview 3 or gtksourceview4, recommend -# the latest one but don't make it a hard requirement -Recommends: gtksourceview4 - # Weak dependencies for the common virt-manager usecase Recommends: (libvirt-daemon-kvm or libvirt-daemon-qemu) Recommends: libvirt-daemon-config-network -# Optional inspection of guests -Suggests: python3-libguestfs - -BuildRequires: gettext +BuildRequires: intltool +BuildRequires: /usr/bin/pod2man BuildRequires: python3-devel -BuildRequires: python3-docutils -BuildRequires: meson %description @@ -83,8 +79,8 @@ Requires: python3-requests Requires: libosinfo >= 0.2.10 # Required for gobject-introspection infrastructure Requires: python3-gobject-base -# Required for pulling files from iso media -Requires: xorriso +# Required for pulling files from iso media with isoinfo +Requires: genisoimage %description common Common files used by the different virt-manager interfaces, as well as @@ -100,6 +96,7 @@ Requires: libvirt-client Provides: virt-install Provides: virt-clone +Provides: virt-convert Provides: virt-xml %description -n virt-install @@ -109,225 +106,85 @@ machine). %prep -%autosetup -p1 +%setup -q + +# Fix --initrd-inject with f30 URLs (bz #1686464) +%patch0001 -p1 +%patch0002 -p1 %build -%if ! %{have_spice} -%global _default_graphics -Ddefault-graphics=vnc +%if %{default_hvs} +%global _default_hvs --default-hvs %{default_hvs} %endif -%meson \ - -Ddefault-hvs=%{default_hvs} \ - %{?_default_graphics} \ - -Dupdate-icon-cache=false \ - -Dcompile-schemas=false \ - -Dtests=disabled -%meson_build +./setup.py configure \ + %{?_default_hvs} + %install -%meson_install - +./setup.py \ + --no-update-icon-cache --no-compile-schemas \ + install -O1 --root=%{buildroot} %find_lang %{name} -%if 0%{?py_byte_compile:1} -# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#manual-bytecompilation -%py_byte_compile %{__python3} %{buildroot}%{_datadir}/virt-manager/ -%endif - +# Replace '#!/usr/bin/env python3' with '#!/usr/bin/python3' +# The format is ideal for upstream, but not a distro. See: +# https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython +for f in $(find %{buildroot} -type f -executable -print); do + sed -i "1 s|^#!/usr/bin/env python3|#!%{__python3}|" $f || : +done %files +%doc README.md COPYING NEWS.md %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* -%{_datadir}/%{name}/ui +%{_datadir}/%{name}/ui/*.ui +%{_datadir}/%{name}/virt-manager %{_datadir}/%{name}/virtManager %{_datadir}/%{name}/icons %{_datadir}/icons/hicolor/*/apps/* +%{_datadir}/appdata/%{name}.appdata.xml %{_datadir}/applications/%{name}.desktop %{_datadir}/glib-2.0/schemas/org.virt-manager.virt-manager.gschema.xml -%{_datadir}/metainfo/%{name}.appdata.xml %files common -f %{name}.lang -%license COPYING -%doc README.md NEWS.md - %dir %{_datadir}/%{name} + +%{_datadir}/%{name}/virtcli +%{_datadir}/%{name}/virtconv %{_datadir}/%{name}/virtinst %files -n virt-install %{_mandir}/man1/virt-install.1* %{_mandir}/man1/virt-clone.1* +%{_mandir}/man1/virt-convert.1* %{_mandir}/man1/virt-xml.1* +%{_datadir}/%{name}/virt-install +%{_datadir}/%{name}/virt-clone +%{_datadir}/%{name}/virt-convert +%{_datadir}/%{name}/virt-xml + %{_datadir}/bash-completion/completions/virt-install %{_datadir}/bash-completion/completions/virt-clone +%{_datadir}/bash-completion/completions/virt-convert %{_datadir}/bash-completion/completions/virt-xml %{_bindir}/virt-install %{_bindir}/virt-clone +%{_bindir}/virt-convert %{_bindir}/virt-xml %changelog -* Fri Jul 17 2026 Fedora Release Engineering - 5.1.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Sat Jan 17 2026 Fedora Release Engineering - 5.1.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Wed Jan 07 2026 Pavel Hrdina - 5.1.0.3 -- Fix cloud init - -* Fri Sep 19 2025 Python Maint - 5.1.0-2 -- Rebuilt for Python 3.14.0rc3 bytecode - -* Tue Aug 26 2025 Pavel Hrdina - 5.1.0-1 -- Update to version 5.1.0 - -* Fri Aug 15 2025 Python Maint - 5.0.0-4 -- Rebuilt for Python 3.14.0rc2 bytecode - -* Fri Jul 25 2025 Fedora Release Engineering - 5.0.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Sun Jan 19 2025 Fedora Release Engineering - 5.0.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Mon Dec 02 2024 Pavel Hrdina - 5.0.0-1 -- Update to version 5.0.0 - -* Tue Sep 10 2024 Cole Robinson - 4.1.0-9 -- Add sev-snp changes for feature ConfidentialVirtHostAMDSEVSNP - -* Mon Aug 05 2024 Cole Robinson - 4.1.0-8 -- Fix flatpak build -- Add /usr/share/virt-manager/ui/ to rpm db (bz 2283244) - -* Sat Jul 20 2024 Fedora Release Engineering - 4.1.0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Wed Jun 26 2024 Daniel. P. Berrange - 4.1.0-6 -- Fix compat with latest python 3.13 (rhbz #2294201) - -* Sat Jan 27 2024 Fedora Release Engineering - 4.1.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Sep 29 2023 Sandro Bonazzola - 4.1.0-4 -- Drop spice-gtk3 on Fedora ELN as in CentOS Stream 9 -- Resolves: fedora#2237969 - -* Sat Jul 22 2023 Fedora Release Engineering - 4.1.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Sat Jan 21 2023 Fedora Release Engineering - 4.1.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Thu Aug 04 2022 Cole Robinson - 4.1.0-1 -- Update to version 4.1.0 - -* Wed Aug 3 2022 Daniel. P. Berrange - 4.0.0-3 -- Fix compat with setuptools >= 61 (rhbz#2113754) - -* Sat Jul 23 2022 Fedora Release Engineering - 4.0.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Wed Mar 02 2022 Cole Robinson - 4.0.0-1 -- Update to version 4.0.0 - -* Sun Feb 20 2022 Cole Robinson - 3.2.0-6 -- Update to latest git snapshot - -* Sat Jan 22 2022 Fedora Release Engineering - 3.2.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 3.2.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Wed Jan 27 2021 Fedora Release Engineering - 3.2.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Mon Jan 11 2021 Cole Robinson - 3.2.0-2 -- Fix 'domain not found' race (bz #1901081) - -* Sat Nov 14 2020 Cole Robinson - 3.2.0-1 -- Update to version 3.2.0 -- Slim down filesystem device editor UI -- Fix TOCTTOU virt-install bugs (Martin Pitt) -- Several other bug fixes - -* Wed Sep 30 2020 Cole Robinson - 3.1.0-1 -- Update to version 3.1.0 - -* Tue Sep 15 2020 Cole Robinson - 3.0.0-1 -- Update to version 3.0.0 - -* Mon Aug 31 2020 Cole Robinson - 2.2.1-6 -- spec: Switch to latest Fedora bytecompile macros - -* Sat Aug 01 2020 Fedora Release Engineering - 2.2.1-5 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 2.2.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Fri Jan 31 2020 Fedora Release Engineering - 2.2.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sat Jul 27 2019 Fedora Release Engineering - 2.2.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Wed Jul 03 2019 Cole Robinson - 2.2.1-1 -- Rebased to version 2.2.1 -- CVE-2019-10183: Replace --unattended user-password and admin-password with - user-password-file and admin-password-file (Fabiano FidĂȘncio) -- Consistent --memballoon default across non-x86 (Andrea Bolognani) -- virt-install: add --numatune memnode.* (Athina Plaskasoviti) -- Drop hard dep on gtksourceview4, gtksourceview3 is fine as well - -* Tue Jun 18 2019 Cole Robinson - 2.2.0-2 -- Add missing dep on gtksourceview - -* Mon Jun 17 2019 Cole Robinson - 2.2.0-1 -- Rebased to version 2.2.0 -- libvirt XML viewing and editing UI for new and existing domain, pools, - volumes, networks -- virt-install: libosinfo --unattended support (Fabiano FidĂȘncio, Cole - Robinson) -- Improve CPU model security defaults (Pavel Hrdina) -- virt-install: new --install option. Ex: virt-install --install fedora29 -- virt-install: new --install kernel=,initrd= -- virt-install: --disk, --memory, --name defaults from libosinfo (Fabiano - FidĂȘncio, Cole Robinson) -- virt-install: add device suboption aliases which consistently match - libvirt XML naming -- virt-xml: new --start, --no-define options (Marc Hartmayer) -- virt-install: Add driver_queues argument to --controller (Vasudeva Kamath) -- RISC-V support (Andrea Bolognani) -- Device default improvements for non-x86 KVM (Andrea Bolognani) -- Redesigned 'New Network' wizard -- libguestfs inspection improvements (Pino Toscano) -- virt-install: Add support for xenbus controller (Jim Fehlig) -- cli: Add --disk wwn=,rawio= (Athina Plaskasoviti) -- cli: Add --memballoon autodeflate=,stats.period= (Athina Plaskasoviti) -- cli: Add --iothreads (Athina Plaskasoviti) -- cli: Add --numatune memory.placement (Athina Plaskasoviti) -- cli: Add --launchSecurity option (Erik Skultety) -- cli: Fill in --memorybacking options -- cli: --smartcard: support database= and certificate[0-9]*= -- cli: --sysinfo: Add chasis suboptions -- cli: --metadata: add genid= and genid_enable= -- cli: --vcpus: add vcpus.vcpu[0-9]* config -- cli: fill in all common char source options for --serial, --parellel, - --console, --channel, --smartcard, --rng, --redirdev - * Wed Apr 03 2019 Cole Robinson - 2.1.0-2 - Fix --initrd-inject with f30 URLs (bz #1686464) @@ -344,9 +201,6 @@ machine). - virt-install: Add --location LOCATION,kernel=X,initrd=Y for pointing to kernel/initrd in media that virt-install/libosinfo fails to detect -* Sun Feb 03 2019 Fedora Release Engineering - 2.0.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - * Mon Oct 15 2018 Cole Robinson - 2.0.0-1 - Rebased to version 2.0.0 - Finish port to Python 3 @@ -1175,7 +1029,7 @@ machine). - Disable wizard sensitivity while creating VM * Thu Oct 19 2006 Daniel P. Berrange - 0.2.5-1.fc7 -- Switch to use python-virtinst instead of python-xeninst due to +- Switch to use python-virtinst instead of python-xeninst due to renaming of original package - Disable keyboard accelerators when grabbing mouse to avoid things like Ctrl-W closing the local window, instead of remote window bz 210364