Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package virt-manager.15783 for 
openSUSE:Leap:15.2:Update checked in at 2021-02-16 06:05:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2:Update/virt-manager.15783 (Old)
 and      /work/SRC/openSUSE:Leap:15.2:Update/.virt-manager.15783.new.28504 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "virt-manager.15783"

Tue Feb 16 06:05:05 2021 rev:1 rq:871548 version:2.2.1

Changes:
--------
New Changes file:

--- /dev/null   2021-01-11 18:20:20.070723563 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2:Update/.virt-manager.15783.new.28504/virt-manager.changes
      2021-02-16 06:05:07.322604988 +0100
@@ -0,0 +1,3557 @@
+-------------------------------------------------------------------
+Mon Jan 25 14:32:10 MST 2021 - carn...@suse.com
+
+- bsc#1180897 - SLES15 SP2: VM does not boot after virt-install
+  installing from ISO image.
+  virtinst-keep-iso-for-xenpv.patch
+
+-------------------------------------------------------------------
+Thu Jan  7 12:48:11 MST 2021 - carn...@suse.com
+
+- bsc#1180069 - L3: virsh edit Error: XML document failed to
+  validate against schema: Unable to validate doc.
+  virtinst-smbios-unsupported-for-xenpv.patch
+
+-------------------------------------------------------------------
+Fri Dec 18 06:06:52 MST 2020 - carn...@suse.com
+
+- bsc#1180062 - virt-install uses isoinfo. Include mkisofs in the
+  spec file.
+  virt-manager.spec
+
+-------------------------------------------------------------------
+Mon Nov 30 13:39:10 MST 2020 - carn...@suse.com
+
+- bsc#1179236 - L3: virt-install: "Error validating install
+  location: invalid literal for int() with base 10" reported by
+  virt-install ref:_00D1igLOd._5001iTe00n:ref
+  virtinst-sap-detection.patch
+
+-------------------------------------------------------------------
+Tue Oct 27 14:16:41 MDT 2020 - carn...@suse.com
+
+- bsc#1177620 - [xen] deployed WIN2K19 guest system could not find
+  a driver for network adapter
+  virtinst-set-default-nic.patch
+
+-------------------------------------------------------------------
+Thu Sep  3 13:59:39 MDT 2020 - carn...@suse.com
+
+- bsc#1176080 - selecting one UEFI firmware in install wizard
+  resets UI to BIOS
+  e8bf16b9-details-fix-detection-of-firmware-auto-selection.patch
+- Upstream bug fix (bsc#1027942)
+  5573aeb4-createnet-Fix-XML-editor-error-when-dhcp-fields-are-empty.patch
+  7e3fb3f2-graphics-Default-to-vga-instead-of-qxl-for-non-spice.patch
+
+-------------------------------------------------------------------
+Wed Jul 29 13:22:53 MDT 2020 - carn...@suse.com
+
+- bsc#1174176 - IDE: "Only 2 disks for bus 'NONE' are supported"
+  virtman-disallow-adding-floppy-disk.patch
+
+-------------------------------------------------------------------
+Thu Jul 23 17:20:03 MDT 2020 - carn...@suse.com
+
+- bsc#1172356 - Not able to hot-plug NIC via virt-manager, asks to
+  attach on next reboot while it should be live attached
+  virtinst-set-default-nic.patch
+
+-------------------------------------------------------------------
+Mon Jul 13 14:43:35 MDT 2020 - carn...@suse.com
+
+- bsc#1169708 - Virtualization/virt-manager: Bug yast2 virt-install
+  internal error
+  virt-install.rb
+
+-------------------------------------------------------------------
+Tue Mar 24 14:00:39 MDT 2020 - carn...@suse.com
+
+- bsc#1167569 - SLES 15 SP2 RC1 - virt-install: cache=none is
+  ignored (kvm)
+  virtinst-set-cache-mode-unsafe-for-install.patch
+
+-------------------------------------------------------------------
+Fri Mar 20 15:03:40 MDT 2020 - carn...@suse.com
+
+- bsc#1167202 - SLES 15 SP2 Snapshot8 - virt-install misses module
+  gi
+  virt-manager.spec
+
+-------------------------------------------------------------------
+Mon Mar  9 13:46:48 MDT 2020 - carn...@suse.com
+
+- Upstream bug fix (bsc#1027942)
+  
15a9502b-Fix-showing-the-firmware-type-in-case-of-firmware-auto-selection.patch
+
+-------------------------------------------------------------------
+Mon Dec  2 14:03:00 MST 2019 - carn...@suse.com
+
+- bsc#1157144 - [s390][virt-manager] There was the black screen
+  from guest graphical console during guest installation
+  virtinst-s390x-disable-graphics.patch
+- bsc#1158227 - virt-manager: Fix duplicate entries in the
+  operating system URL drop down menu
+  virtman-show-suse-install-repos.patch
+- Upstream bug fix (bsc#1027942)
+  29f9f5f2-virt-xml-fix-defined_xml_is_unchanged.patch
+- Drop virtman-default-to-xen-pv.patch
+- Refreshed
+  virtinst-add-pvh-support.patch
+  virtinst-modify-gui-defaults.patch
+  virt-manager.changes
+  virt-manager.spec
+  virtman-allow-creating-i686-vm.patch
+  virtman-python2-to-python3-conversion.patch
+
+-------------------------------------------------------------------
+Wed Nov 27 14:53:06 MST 2019 - carn...@suse.com
+
+- bsc#1156964 - import a exist disk for creating PV guest failed
+  virtinst-pvgrub2-bootloader.patch
+- Refreshed patches
+  virtinst-change-location-for-grub_xen.patch
+  virtinst-set-cache-mode-unsafe-for-install.patch
+
+-------------------------------------------------------------------
+Fri Nov 22 13:50:11 MST 2019 - carn...@suse.com
+
+- bsc#1157097 - PV guest on_reboot event be set to 'destroy' by
+  default
+  virtinst-pvgrub2-bootloader.patch
+- Rebased patches
+  virtinst-change-location-for-grub_xen.patch
+  virtman-increase-setKeepAlive-count.patch
+
+-------------------------------------------------------------------
+Tue Nov 12 10:17:56 MST 2019 - carn...@suse.com
+
+- Upstream bug fixes (bsc#1027942)
+  1547e16d-domcapabilities-Get-video-devices.patch
+  2e20b128-domcapabilities-Add-supports_video_bochs.patch
+  ae19d6d6-fix-resizing-of-spice-clients-with-guest-resizing-enabled.patch
+  51d84c54-connection-Avoid-repeated-default-pool-creation-attempts.patch
+  d934d6f2-domcaps-Fix-check-for-uncached-security-features.patch
+
+-------------------------------------------------------------------
+Mon Oct 28 07:35:25 MDT 2019 - carn...@suse.com
+
+- bsc#1155197 - [xen][virt-manager] Fail to boot up installed
+  sles15sp2 PV guest
+  virtinst-pvgrub2-bootloader.patch
+  virtinst-change-location-for-grub_xen.patch
+- Upstream bug fixes (bsc#1027942)
+  9465da41-urlfetcher-Deal-with-file-in-_LocalURLFetcher.patch
+  651e5b6d-devices-video-Simplify-model-hvm-check.patch
+  d9736db9-addhardware-Add-bochs-display-to-the-video-list.patch
+  8f4c53ea-video-Prefer-bochs-when-its-supported..patch
+
+-------------------------------------------------------------------
+Tue Aug 27 13:54:23 MDT 2019 - carn...@suse.com
+
+- Upstream bug fixes (bsc#1027942)
+  0c223ab2-guest-Dont-set-default-uefi-if-firmware-is-set.patch
+  414ffa5e-virt-install-Use-minutes-instead-of-seconds-on-get_time_string.patch
+  53245827-urlfetcher-Force-a-flush-after-writing-to-a-file.patch
+  3009888a-urlfetcher-Dont-override-fullurl-when-its-explicitly-set.patch
+
+-------------------------------------------------------------------
+Mon Jul 29 13:22:56 MDT 2019 - carn...@suse.com
+
+- bsc#1143315 - virt-manager: Fix detection for SLE15
+  virtinst-add-sle15-detection-support.patch
+  virtinst-add-caasp-support.patch
+  virtinst-detect-oes-distros.patch
+  virtinst-add-pvh-support.patch
+  virtinst-s390x-disable-graphics.patch
+  virtinst-set-qemu-emulator.patch
+
+-------------------------------------------------------------------
+Wed Jul 10 14:21:53 MDT 2019 - carn...@suse.com
+
+- Upstream bug fix (bsc#1027942)
+  
3c6e8537-guest-fix-warning-message-when-machine-type-is-changed-for-secure-boot.patch
+
+-------------------------------------------------------------------
+Fri Jul  5 08:54:18 MDT 2019 - carn...@suse.com
+
+- Update to virt-manager 2.2.1 (fate#326786)
+  virt-manager-2.2.1.tar.bz2
+  * 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
+- Drop patches no longer needed
+  033e9702-xmleditor-Handle-gtksourceview3-as-well-as-gtksourceview4.patch
+  51d28f04-unattended-Dont-log-user-admin-passwords.patch
+  5312a961-virt-install-Revive-wait-0-as-alias-for-noautoconsole.patch
+  58c68764-unattended-Read-the-passwords-from-a-file.patch
+
+-------------------------------------------------------------------
+Wed Jul  3 12:07:53 MDT 2019 - carn...@suse.com
+
+- bsc#1140211 - VUL-1: CVE-2019-10183: virt-manager: unattended
+  option leaks password via command line argument
+  58c68764-unattended-Read-the-passwords-from-a-file.patch
+  51d28f04-unattended-Dont-log-user-admin-passwords.patch
+- Upstream bug fix (bsc#1027942)
++++ 3360 more lines (skipped)
++++ between /dev/null
++++ and 
/work/SRC/openSUSE:Leap:15.2:Update/.virt-manager.15783.new.28504/virt-manager.changes

New:
----
  0002-virtinst-python3-avoid-comparison-of-None-and-int.patch
  0c223ab2-guest-Dont-set-default-uefi-if-firmware-is-set.patch
  1547e16d-domcapabilities-Get-video-devices.patch
  
15a9502b-Fix-showing-the-firmware-type-in-case-of-firmware-auto-selection.patch
  29f9f5f2-virt-xml-fix-defined_xml_is_unchanged.patch
  2e20b128-domcapabilities-Add-supports_video_bochs.patch
  3009888a-urlfetcher-Dont-override-fullurl-when-its-explicitly-set.patch
  
3c6e8537-guest-fix-warning-message-when-machine-type-is-changed-for-secure-boot.patch
  414ffa5e-virt-install-Use-minutes-instead-of-seconds-on-get_time_string.patch
  51d84c54-connection-Avoid-repeated-default-pool-creation-attempts.patch
  53245827-urlfetcher-Force-a-flush-after-writing-to-a-file.patch
  5573aeb4-createnet-Fix-XML-editor-error-when-dhcp-fields-are-empty.patch
  651e5b6d-devices-video-Simplify-model-hvm-check.patch
  7e3fb3f2-graphics-Default-to-vga-instead-of-qxl-for-non-spice.patch
  8f4c53ea-video-Prefer-bochs-when-its-supported..patch
  9465da41-urlfetcher-Deal-with-file-in-_LocalURLFetcher.patch
  ae19d6d6-fix-resizing-of-spice-clients-with-guest-resizing-enabled.patch
  d934d6f2-domcaps-Fix-check-for-uncached-security-features.patch
  d9736db9-addhardware-Add-bochs-display-to-the-video-list.patch
  e8bf16b9-details-fix-detection-of-firmware-auto-selection.patch
  virt-install.desktop
  virt-install.rb
  virt-manager-2.2.1.tar.bz2
  virt-manager-supportconfig
  virt-manager.changes
  virt-manager.spec
  virtconv-python2-to-python3-conversion.patch
  virtinst-add-caasp-support.patch
  virtinst-add-pvh-support.patch
  virtinst-add-sle15-detection-support.patch
  virtinst-change-location-for-grub_xen.patch
  virtinst-default-xen-to-qcow2-format.patch
  virtinst-detect-oes-distros.patch
  virtinst-dont-use-special-copy-cpu-features.patch
  virtinst-keep-install-iso-attached.patch
  virtinst-keep-iso-for-xenpv.patch
  virtinst-media-detection.patch
  virtinst-modify-gui-defaults.patch
  virtinst-osdict-get_supported.patch
  virtinst-pvgrub2-bootloader.patch
  virtinst-python2-to-python3-conversion.patch
  virtinst-refresh_before_fetch_pool.patch
  virtinst-s390x-disable-graphics.patch
  virtinst-sap-detection.patch
  virtinst-set-cache-mode-unsafe-for-install.patch
  virtinst-set-default-nic.patch
  virtinst-set-qemu-emulator.patch
  virtinst-smbios-unsupported-for-xenpv.patch
  virtinst-use-qemu-for-cdrom-device.patch
  virtinst-use-xenpae-kernel-for-32bit.patch
  virtinst-vol-default-nocow.patch
  virtinst-xen-drive-type.patch
  virtinst-xenbus-disk-index-fix.patch
  virtman-allow-creating-i686-vm.patch
  virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch
  virtman-check-for-valid-display.patch
  virtman-desktop.patch
  virtman-disallow-adding-floppy-disk.patch
  virtman-dont-allow-grub.xen-to-be-deleted.patch
  virtman-dont-specify-gtksource-version.patch
  virtman-dont-specify-vte-version.patch
  virtman-fix-env-script-interpreter.patch
  virtman-fix-restore-vm-menu-selection.patch
  virtman-increase-setKeepAlive-count.patch
  virtman-keycombo.patch
  virtman-kvm.patch
  virtman-load-stored-uris.patch
  virtman-python2-to-python3-conversion.patch
  virtman-register-delete-event-for-details-dialog.patch
  virtman-show-suse-install-repos.patch
  virttests-python2-to-python3-conversion.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ virt-manager.spec ++++++
#
# spec file for package virt-manager
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%global __python %{__python3}
%global with_guestfs               0
%global default_hvs                "qemu,xen,lxc"

Name:           virt-manager
Version:        2.2.1
Release:        0
Summary:        Virtual Machine Manager
License:        GPL-2.0-or-later
Group:          System/Monitoring
Url:            http://virt-manager.org/
Source0:        %{name}-%{version}.tar.bz2
Source1:        virt-install.rb
Source2:        virt-install.desktop
Source3:        virt-manager-supportconfig
# Upstream Patches
Patch1:         
3c6e8537-guest-fix-warning-message-when-machine-type-is-changed-for-secure-boot.patch
Patch2:         0c223ab2-guest-Dont-set-default-uefi-if-firmware-is-set.patch
Patch3:         
414ffa5e-virt-install-Use-minutes-instead-of-seconds-on-get_time_string.patch
Patch4:         53245827-urlfetcher-Force-a-flush-after-writing-to-a-file.patch
Patch5:         
3009888a-urlfetcher-Dont-override-fullurl-when-its-explicitly-set.patch
Patch6:         9465da41-urlfetcher-Deal-with-file-in-_LocalURLFetcher.patch
Patch7:         651e5b6d-devices-video-Simplify-model-hvm-check.patch
Patch8:         1547e16d-domcapabilities-Get-video-devices.patch
Patch9:         2e20b128-domcapabilities-Add-supports_video_bochs.patch
Patch10:        d9736db9-addhardware-Add-bochs-display-to-the-video-list.patch
Patch11:        8f4c53ea-video-Prefer-bochs-when-its-supported..patch
Patch12:        
ae19d6d6-fix-resizing-of-spice-clients-with-guest-resizing-enabled.patch
Patch13:        
51d84c54-connection-Avoid-repeated-default-pool-creation-attempts.patch
Patch14:        d934d6f2-domcaps-Fix-check-for-uncached-security-features.patch
Patch15:        29f9f5f2-virt-xml-fix-defined_xml_is_unchanged.patch
Patch16:        
15a9502b-Fix-showing-the-firmware-type-in-case-of-firmware-auto-selection.patch
Patch17:        
5573aeb4-createnet-Fix-XML-editor-error-when-dhcp-fields-are-empty.patch
Patch18:        e8bf16b9-details-fix-detection-of-firmware-auto-selection.patch
Patch19:        
7e3fb3f2-graphics-Default-to-vga-instead-of-qxl-for-non-spice.patch
# SUSE Only
Patch70:        virtman-desktop.patch
Patch71:        virtman-kvm.patch
Patch72:        virtman-keycombo.patch
Patch73:        virtman-show-suse-install-repos.patch
Patch74:        virtman-dont-allow-grub.xen-to-be-deleted.patch
Patch75:        virtinst-pvgrub2-bootloader.patch
Patch76:        virtinst-change-location-for-grub_xen.patch
Patch77:        virtman-fix-env-script-interpreter.patch
Patch78:        virtinst-set-qemu-emulator.patch
# Features or Enhancements
Patch103:       virtman-load-stored-uris.patch
Patch120:       virtinst-default-xen-to-qcow2-format.patch
Patch121:       virtinst-detect-oes-distros.patch
Patch122:       virtinst-modify-gui-defaults.patch
Patch123:       virtinst-vol-default-nocow.patch
Patch124:       virtinst-set-cache-mode-unsafe-for-install.patch
Patch125:       virtinst-s390x-disable-graphics.patch
Patch126:       virtinst-add-caasp-support.patch
Patch127:       virtinst-add-sle15-detection-support.patch
Patch128:       virtinst-add-pvh-support.patch
Patch129:       virtinst-media-detection.patch
# Bug Fixes
Patch151:       virtman-increase-setKeepAlive-count.patch
Patch152:       virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch
Patch153:       virtman-check-for-valid-display.patch
Patch154:       virtman-allow-creating-i686-vm.patch
Patch155:       virtman-dont-specify-vte-version.patch
Patch156:       virtman-dont-specify-gtksource-version.patch
Patch157:       virtman-fix-restore-vm-menu-selection.patch
Patch158:       virtman-disallow-adding-floppy-disk.patch
Patch160:       virtinst-xen-drive-type.patch
Patch161:       virtinst-xenbus-disk-index-fix.patch
Patch162:       virtinst-refresh_before_fetch_pool.patch
Patch163:       virtinst-use-xenpae-kernel-for-32bit.patch
Patch164:       virtinst-use-qemu-for-cdrom-device.patch
Patch165:       virtinst-keep-install-iso-attached.patch
Patch166:       virtinst-osdict-get_supported.patch
Patch167:       virtinst-dont-use-special-copy-cpu-features.patch
Patch168:       virtinst-set-default-nic.patch
Patch169:       virtinst-sap-detection.patch
Patch170:       virtinst-smbios-unsupported-for-xenpv.patch
Patch171:       virtinst-keep-iso-for-xenpv.patch
# Python2 to Python3 patches
Patch200:       virtconv-python2-to-python3-conversion.patch
Patch201:       virtinst-python2-to-python3-conversion.patch
Patch202:       virtman-python2-to-python3-conversion.patch
Patch203:       virttests-python2-to-python3-conversion.patch
Patch204:       0002-virtinst-python3-avoid-comparison-of-None-and-int.patch
Patch205:       virtman-register-delete-event-for-details-dialog.patch

BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%define verrel %{version}-%{release}
Requires:       dbus-1-x11
Requires:       dconf
Requires:       gtk3 >= 3.22
Requires:       python3-gobject-Gdk
# For console widget
Requires:       python3-cairo
Requires:       python3-gobject-cairo
Recommends:     python3-SpiceClientGtk
Requires:       gtksourceview >= 3
Requires:       virt-install
Requires:       virt-manager-common = %{verrel}

%if %{with_guestfs}
Requires:       python3-libguestfs
%endif

BuildRequires:  glib2-devel
BuildRequires:  gtk3-tools
BuildRequires:  intltool
BuildRequires:  perl
BuildRequires:  python3-devel
BuildRequires:  python3-gobject
BuildRequires:  python3-libvirt-python >= 0.7.0
BuildRequires:  python3-libxml2-python
BuildRequires:  python3-requests
BuildRequires:  typelib(Libosinfo)

%description
Virtual Machine Manager provides a graphical tool for administering virtual
machines for KVM, Xen, and QEmu. Start, stop, add or remove virtual devices,
connect to a graphical or serial console, and see resource usage statistics
for existing VMs on local or remote machines. Uses libvirt as the backend
management API.


%package common
Summary:        Common files used by the different Virtual Machine Manager 
interfaces
Group:          System/Monitoring

# This version not strictly required: virt-manager should work with older,
# however varying amounts of functionality will not be enabled.
Requires:       libosinfo >= 0.2.10
Requires:       mkisofs
Requires:       python3-gobject
Requires:       python3-ipaddr
Requires:       python3-libvirt-python >= 0.7.0
Requires:       python3-libxml2-python
Requires:       python3-pycurl
Requires:       typelib(LibvirtGLib)
Suggests:       python3-virt-bootstrap
BuildRequires:  gobject-introspection
# No AppIndicator package on SLE
%if 0%{?is_opensuse} == 0
%define __requires_exclude typelib\\(AppIndicator3\\)
%endif

%description common
Common files used by the different virt-manager interfaces, as well as
virt-install related tools.


%package -n virt-install
Summary:        Utilities for installing virtual machines
Group:          System/Monitoring

Requires:       virt-manager-common = %{verrel}

Requires:       python3-requests
Provides:       python3-virtinst
Provides:       virt-clone
Provides:       virt-convert
Obsoletes:      python-virtinst <= 0.600.4
Supplements:    virt-manager

%description -n virt-install
Package includes several command line utilities, including virt-install
(build and install new VMs) and virt-clone (clone an existing virtual
machine).


%prep
%setup -q
# Upstream Patches
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
# SUSE Only
%patch70 -p1
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
%patch76 -p1
%patch77 -p1
%patch78 -p1
# Enhancements
%patch103 -p1
%patch120 -p1
%patch121 -p1
%patch122 -p1
%patch123 -p1
%patch124 -p1
%patch125 -p1
%patch126 -p1
%patch127 -p1
%patch128 -p1
%patch129 -p1
# Bug Fixes
%patch151 -p1
%patch152 -p1
%patch153 -p1
%patch154 -p1
%patch155 -p1
%patch156 -p1
%patch157 -p1
%patch158 -p1
%patch160 -p1
%patch161 -p1
%patch162 -p1
%patch163 -p1
%patch164 -p1
%patch165 -p1
%patch166 -p1
%patch167 -p1
%patch168 -p1
%patch169 -p1
%patch170 -p1
%patch171 -p1
# Python2 to Python3 patches
%patch200 -p1
%patch201 -p1
%patch202 -p1
%patch203 -p1
%patch204 -p1
%patch205 -p1

%build
%if %{default_hvs}
%global _default_hvs --default-hvs %{default_hvs}
%endif

python3 setup.py configure \
    --prefix=%{_prefix} \
    --default-graphics="spice" \
    %{?_default_hvs}

%install
python3 setup.py \
    --no-update-icon-cache \
    --no-compile-schemas install \
    --prefix=%{_prefix} \
    -O1 --root=%{buildroot}
mkdir -p %{buildroot}/%{_datadir}/YaST2/clients/
install -m644 %SOURCE1 %{buildroot}/%{_datadir}/YaST2/clients/virt-install.rb
mkdir -p %{buildroot}/%{_datadir}/applications/YaST2/
install -m644 %SOURCE2 
%{buildroot}/%{_datadir}/applications/YaST2/virt-install.desktop
# Oddly, supportconfig doesn't execute plugins with '-' in the name, so use 
'virt_manager'
mkdir -p %{buildroot}/usr/lib/supportconfig/plugins
install -m 755 %SOURCE3 %{buildroot}/usr/lib/supportconfig/plugins/virt_manager

%find_lang %{name}

%post
/bin/touch --no-create %{_datadir}/icons/hicolor >/dev/null 2>&1 || :
/usr/bin/update-desktop-database > /dev/null 2>&1 || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor >/dev/null 2>&1
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null 2>&1 || 
:
    /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas > /dev/null 2>&1 
|| :
fi
/usr/bin/update-desktop-database > /dev/null 2>&1 || :

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null 2>&1 || :
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas > /dev/null 2>&1 || :

%files
%defattr(-,root,root,-)
%{_bindir}/%{name}

%{_mandir}/man1/%{name}.1*

%dir %{_datadir}/virt-manager/ui
%{_datadir}/%{name}/ui/*.ui
%{_datadir}/%{name}/virt-manager
%{_datadir}/%{name}/virtManager

%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*/
%dir %{_datadir}/icons/hicolor/*/apps
%{_datadir}/%{name}/icons
%{_datadir}/icons/hicolor/*/apps/*

%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/YaST2/virt-install.desktop
%{_datadir}/glib-2.0/schemas/org.virt-manager.virt-manager.gschema.xml
%dir /usr/lib/supportconfig
%dir /usr/lib/supportconfig/plugins
/usr/lib/supportconfig/plugins/virt_manager

%files common -f %{name}.lang
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}

%{_datadir}/%{name}/virtconv
%{_datadir}/%{name}/virtinst

%files -n virt-install
%defattr(-,root,root,-)
%{_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}/bash-completion/completions/virt-install
%{_datadir}/%{name}/virt-clone
%{_datadir}/bash-completion/completions/virt-clone
%{_datadir}/%{name}/virt-convert
%{_datadir}/bash-completion/completions/virt-convert
%{_datadir}/%{name}/virt-xml
%{_datadir}/bash-completion/completions/virt-xml
%dir %{_datadir}/YaST2
%dir %{_datadir}/YaST2/clients
%dir %{_datadir}/applications/YaST2
%dir %{_datadir}/appdata
%{_datadir}/YaST2/clients/virt-install.rb

%{_bindir}/virt-install
%{_bindir}/virt-clone
%{_bindir}/virt-convert
%{_bindir}/virt-xml

%changelog
++++++ 0002-virtinst-python3-avoid-comparison-of-None-and-int.patch ++++++
>From cb90bbc8671aa25e23e55341745cc2682547e5f0 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwi...@suse.com>
Date: Thu, 7 Dec 2017 11:17:03 +0100
Subject: [PATCH 2/4] virtinst: python3: avoid comparison of None and int

This avoids the following error in python3:

  File "/usr/share/virt-manager/virtinst/progress.py", line 249, in _do_update
    ave_dl = format_number(self.re.average_rate())
  File "/usr/share/virt-manager/virtinst/progress.py", line 481, in 
format_number
    while number > thresh and depth < max_depth:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
---
 virtinst/progress.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: virt-manager-2.1.0/virtinst/progress.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/progress.py
+++ virt-manager-2.1.0/virtinst/progress.py
@@ -350,7 +350,7 @@ class RateEstimator:
         self.start_time = now
         self.last_update_time = now
         self.last_amount_read = 0
-        self.ave_rate = None
+        self.ave_rate = 0
 
     def update(self, amount_read, now=None):
         if now is None:
@@ -363,7 +363,7 @@ class RateEstimator:
             # if we just started this file, all bets are off
             self.last_update_time = now
             self.last_amount_read = amount_read
-            self.ave_rate = None
+            self.ave_rate = 0
             return
 
         time_diff = now - self.last_update_time
++++++ 0c223ab2-guest-Dont-set-default-uefi-if-firmware-is-set.patch ++++++
Subject: guest: Don't set default uefi if firmware= is set
From: Cole Robinson crobi...@redhat.com Fri Jul 12 15:58:22 2019 -0400
Date: Fri Jul 12 16:01:21 2019 -0400:
Git: 0c223ab21f0cff216b4a1ab2070a43f0e943d308


diff --git 
a/tests/cli-test-xml/compare/virt-install-aarch64-firmware-no-override.xml 
b/tests/cli-test-xml/compare/virt-install-aarch64-firmware-no-override.xml
new file mode 100644
index 00000000..b062e805
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-firmware-no-override.xml
@@ -0,0 +1,55 @@
+<domain type="kvm">
+  <name>vm1</name>
+  <uuid>00000000-1111-2222-3333-444444444444</uuid>
+  <memory>65536</memory>
+  <currentMemory>65536</currentMemory>
+  <vcpu>1</vcpu>
+  <os firmware="efi">
+    <type arch="aarch64" machine="virt">hvm</type>
+    <boot dev="network"/>
+  </os>
+  <cpu mode="host-passthrough"/>
+  <clock offset="utc"/>
+  <on_reboot>destroy</on_reboot>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
+    <interface type="bridge">
+      <source bridge="testsuitebr0"/>
+      <mac address="00:11:22:33:44:55"/>
+      <model type="virtio"/>
+    </interface>
+    <console type="pty"/>
+    <channel type="unix">
+      <source mode="bind"/>
+      <target type="virtio" name="org.qemu.guest_agent.0"/>
+    </channel>
+  </devices>
+</domain>
+<domain type="kvm">
+  <name>vm1</name>
+  <uuid>00000000-1111-2222-3333-444444444444</uuid>
+  <memory>65536</memory>
+  <currentMemory>65536</currentMemory>
+  <vcpu>1</vcpu>
+  <os firmware="efi">
+    <type arch="aarch64" machine="virt">hvm</type>
+    <boot dev="network"/>
+  </os>
+  <cpu mode="host-passthrough"/>
+  <clock offset="utc"/>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
+    <interface type="bridge">
+      <source bridge="testsuitebr0"/>
+      <mac address="00:11:22:33:44:55"/>
+      <model type="virtio"/>
+    </interface>
+    <console type="pty"/>
+    <channel type="unix">
+      <source mode="bind"/>
+      <target type="virtio" name="org.qemu.guest_agent.0"/>
+    </channel>
+  </devices>
+</domain>
diff --git a/tests/clitest.py b/tests/clitest.py
index 7ef324bc..a309f937 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -990,6 +990,7 @@ c.add_compare("--arch aarch64 --boot 
kernel=/f19-arm.kernel,initrd=/f19-arm.init
 c.add_compare("--arch aarch64 --cdrom %(EXISTIMG2)s --boot 
loader=CODE.fd,nvram.template=VARS.fd --disk %(EXISTIMG1)s --cpu none --events 
on_crash=preserve,on_reboot=destroy,on_poweroff=restart", "aarch64-cdrom")
 c.add_compare("--connect %(URI-KVM-AARCH64)s --disk %(EXISTIMG1)s --import 
--os-variant fedora21 --panic default", "aarch64-kvm-import")  # the --panic is 
a no-op
 c.add_compare("--connect %(URI-KVM-AARCH64)s --disk size=1 --os-variant 
fedora22 --features gic_version=host --network network=default,address.type=pci 
--controller type=scsi,model=virtio-scsi,address.type=pci", "aarch64-kvm-gic")
+c.add_compare("--connect %(URI-KVM-AARCH64)s --arch aarch64 --disk none --pxe 
--boot firmware=efi", "aarch64-firmware-no-override")
 
 
 # Simple headless guests for various architectures
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 41357644..f0fcfe7d 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -561,8 +561,9 @@ class Guest(XMLBuilder):
         return path
 
     def is_uefi(self):
-        return bool(self.os.loader and
-                    self.os.loader_type == "pflash")
+        if self.os.loader and self.os.loader_type == "pflash":
+            return True
+        return self.os.firmware == "efi"
 
     def set_uefi_path(self, path):
         """
@@ -781,11 +782,13 @@ class Guest(XMLBuilder):
             not self.os.kernel and
             not self.os.loader and
             self.os.loader_ro is None and
-            self.os.nvram is None)
+            self.os.nvram is None and
+            self.os.firmware is None)
 
         if use_default_uefi or self.uefi_requested:
             try:
                 path = self.get_uefi_path()
+                log.debug("Setting UEFI path=%s", path)
                 self.set_uefi_path(path)
             except RuntimeError as e:
                 if self.uefi_requested:
++++++ 1547e16d-domcapabilities-Get-video-devices.patch ++++++
Subject: domcapabilities: Get video devices
From: Fabiano Fid??ncio fiden...@redhat.com Thu Oct 3 10:44:52 2019 +0200
Date: Fri Oct 4 11:15:09 2019 -0400:
Git: 1547e16d62736c861a0e4dadeb86ef372d2698bd

domcapabilities already handles disk and hostdev. Let's add support for
getting video devices as well.

Signed-off-by: Fabiano Fid??ncio <fiden...@redhat.com>

diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index f11f18aa..9cc27bc2 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -95,6 +95,7 @@ class _Devices(_CapsBlock):
     XML_NAME = "devices"
     hostdev = XMLChildProperty(_make_capsblock("hostdev"), is_single=True)
     disk = XMLChildProperty(_make_capsblock("disk"), is_single=True)
+    video = XMLChildProperty(_make_capsblock("video"), is_single=True)
 
 
 class _Features(_CapsBlock):
++++++ 
15a9502b-Fix-showing-the-firmware-type-in-case-of-firmware-auto-selection.patch 
++++++
Subject: details: Fix showing the firmware type in case of firmware auto 
selection
From: Lin Ma l...@suse.com Wed Jan 15 10:34:12 2020 +0800
Date: Wed Jan 15 10:21:46 2020 -0500:
Git: 15a9502b7b7a263c4d66ff2b3f31c209f58fe0b4

For a shutoff VM, If user select uefi firmware auto selection, e.g.
<os firmware='efi'>
...
</os>

Its firmware information is set to 'BIOS' in details, This is incorrect.
This fixes it.

Reviewed-by: Cole Robinson <crobi...@redhat.com>
Signed-off-by: Lin Ma <l...@suse.com>

Index: virt-manager-2.2.1/virtManager/details/details.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/details/details.py
+++ virt-manager-2.2.1/virtManager/details/details.py
@@ -2017,8 +2017,11 @@ class vmmDetails(vmmGObjectUI):
 
         # Firmware
         domcaps = self.vm.get_domain_capabilities()
-        firmware = domcaps.label_for_firmware_path(
-            self.vm.get_xmlobj().os.loader)
+        if self.vm.get_xmlobj().is_uefi():
+            firmware = 'UEFI'
+        else:
+            firmware = domcaps.label_for_firmware_path(
+                self.vm.get_xmlobj().os.loader)
         if self.widget("overview-firmware").is_visible():
             uiutil.set_list_selection(
                 self.widget("overview-firmware"), firmware)
++++++ 29f9f5f2-virt-xml-fix-defined_xml_is_unchanged.patch ++++++
Subject: virt-xml: fix defined_xml_is_unchanged
From: Pavel Hrdina phrd...@redhat.com Tue Dec 3 13:02:21 2019 +0100
Date: Tue Dec 3 13:04:37 2019 +0100:
Git: 29f9f5f2d7f47fe6cc3333f2a9e6c6209db5a8f3

Commit <53f075ab76e1c372474ae0d88f202e487d9f213f> added a warning if the
VM XML is not changed after removing default devices but the code was
incorrect.  We have to compare strings instead of string vs Guest object
and also the condition was inverted.

Signed-off-by: Pavel Hrdina <phrd...@redhat.com>

diff --git a/virt-xml b/virt-xml
index 71445c9f..7b0174c9 100755
--- a/virt-xml
+++ b/virt-xml
@@ -105,8 +105,8 @@ def get_domain_and_guest(conn, domstr):
 
 def defined_xml_is_unchanged(conn, domain, original_xml):
     rawxml = get_xmldesc(domain, inactive=True)
-    new_xml = virtinst.Guest(conn, parsexml=rawxml)
-    return new_xml != original_xml
+    new_xml = virtinst.Guest(conn, parsexml=rawxml).get_xml()
+    return new_xml == original_xml
 
 
 ################
++++++ 2e20b128-domcapabilities-Add-supports_video_bochs.patch ++++++
Subject: domcapabilities: Add supports_video_bochs()
From: Fabiano Fid??ncio fiden...@redhat.com Thu Oct 3 10:47:15 2019 +0200
Date: Fri Oct 4 11:15:09 2019 -0400:
Git: 2e20b128a1a1f064c5036d3d3d0cf5b09117b9da

Returns whether bochs display is supported, according to the domain
capabilities.

Signed-off-by: Fabiano Fid??ncio <fiden...@redhat.com>

Index: virt-manager-2.2.1/virtinst/domcapabilities.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/domcapabilities.py
+++ virt-manager-2.2.1/virtinst/domcapabilities.py
@@ -325,6 +325,14 @@ class DomainCapabilities(XMLBuilder):
         """
         return bool(self.features.sev.supported)
 
+    def supports_video_bochs(self):
+        """
+        Returns False if either libvirt or qemu do not have support to bochs
+        video type.
+        """
+        models = self.devices.video.get_enum("modelType").get_values()
+        return bool("bochs" in models)
+
     XML_NAME = "domainCapabilities"
     os = XMLChildProperty(_OS, is_single=True)
     cpu = XMLChildProperty(_CPU, is_single=True)
++++++ 3009888a-urlfetcher-Dont-override-fullurl-when-its-explicitly-set.patch 
++++++
Subject: urlfetcher: Don't override fullurl when it's explicitly set
From: Fabiano Fid??ncio fiden...@redhat.com Fri Aug 2 17:01:44 2019 +0200
Date: Tue Aug 6 17:59:05 2019 -0400:
Git: 3009888a0ed200a4f472dd32239a7c5157fef391

acquireFile method receives an optional "fullurl" argument. In case it's
not passed, its value is set as the same value of the filename. However,
when fullurl is passed, it should be used and not overriden by the
filename, otherwise fetcher.acquireFile() will just bail.

Reviewed-by: Cole Robinson <crobi...@redhat.com>
Signed-off-by: Fabiano Fid??ncio <fiden...@redhat.com>

diff --git a/virtinst/install/urlfetcher.py b/virtinst/install/urlfetcher.py
index 07f8b5ea..6084bf01 100644
--- a/virtinst/install/urlfetcher.py
+++ b/virtinst/install/urlfetcher.py
@@ -411,7 +411,8 @@ class DirectFetcher(_URLFetcher):
         return filename
 
     def acquireFile(self, filename, fullurl=None):
-        fullurl = filename
+        if not fullurl:
+            fullurl = filename
         filename = os.path.basename(filename)
         fetcher = fetcherForURI(fullurl, self.scratchdir, self.meter, 
direct=True)
         return fetcher.acquireFile(filename, fullurl)  # pylint: 
disable=protected-access
++++++ 
3c6e8537-guest-fix-warning-message-when-machine-type-is-changed-for-secure-boot.patch
 ++++++
Subject: guest: fix warning message when machine type is changed for secure boot
From: Pavel Hrdina phrd...@redhat.com Mon Jul 8 10:44:43 2019 +0200
Date: Mon Jul 8 10:57:46 2019 +0200:
Git: 3c6e85375d0cd87dcf8ac70b41db0d899851338e

Introduced by commit <3586d1897>.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1727811

Signed-off-by: Pavel Hrdina <phrd...@redhat.com>

diff --git a/virtinst/guest.py b/virtinst/guest.py
index ef227d17..41357644 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -586,7 +586,8 @@ class Guest(XMLBuilder):
             self.os.loader_secure = True
             if self.os.machine and "q35" not in self.os.machine:
                 log.warning("Changing machine type from '%s' to 'q35' "
-                        "which is required for UEFI secure boot.")
+                        "which is required for UEFI secure boot.",
+                        self.os.machine)
                 self.os.machine = "q35"
 
     def disable_hyperv_for_uefi(self):
++++++ 
414ffa5e-virt-install-Use-minutes-instead-of-seconds-on-get_time_string.patch 
++++++
Subject: virt-install: Use minutes instead of seconds on get_time_string()
From: Fabiano Fid??ncio fiden...@redhat.com Thu Jul 25 14:09:53 2019 +0200
Date: Thu Jul 25 19:13:13 2019 -0400:
Git: 414ffa5ef82548d502a4de98d40228a68bdb29c1

get_time_string() currently uses self._wait_secs, while it should use
self._wait_mins, resulting on confusing messages when using `--wait`
option, as shown below:

fidencio@laerte ~/src/upstream/virt-manager $ ./virt-install --install fedora30 
--unattended --wait 20
 ...
Waiting 1200 minutes for installation to complete.

Reviewed-by: Cole Robinson <crobi...@redhat.com>
Signed-off-by: Fabiano Fid??ncio <fiden...@redhat.com>

diff --git a/virt-install b/virt-install
index af6c75bf..8efa4960 100755
--- a/virt-install
+++ b/virt-install
@@ -610,7 +610,7 @@ class WaitHandler:
         self._start_time = time.time()
 
     def get_time_string(self):
-        timestr = _(" %d minutes") % self._wait_secs
+        timestr = _(" %d minutes") % self._wait_mins
         if self._wait_forever:
             timestr = ""
         ret = _("Waiting%(time_string)s for installation to complete.") % {
++++++ 51d84c54-connection-Avoid-repeated-default-pool-creation-attempts.patch 
++++++
Subject: connection: Avoid repeated default pool creation attempts
From: Michael Weiser michael.wei...@gmx.de Fri Oct 25 21:27:18 2019 +0200
Date: Tue Nov 12 12:28:34 2019 -0500:
Git: 51d84c54cb63350145f4ad3a2adba17313e1f227

During startup virtinst.StoragePool.build_default_pool() tries to
determine whether the default storage pool already exists. Because
events have not yet been processed, the list of existing storage pools
is still empty. Therefore it seems as if it does not exist yet and
build_default_pool() falls back to creating it which causes an error
message from libvirtd in the system log:

libvirtd: operation failed: pool 'default' already exists with uuid.

Move default pool creation after event processing to avoid these
redundant creation attempts.

Signed-off-by: Michael Weiser <michael.wei...@gmx.de>

diff --git a/virtManager/connection.py b/virtManager/connection.py
index f6dc5f5b..e526d495 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -990,13 +990,6 @@ class vmmConnection(vmmGObject):
         log.debug("%s capabilities:\n%s",
                       self.get_uri(), self.caps.get_xml())
 
-        # Try to create the default storage pool
-        # We want this before events setup to save some needless polling
-        try:
-            virtinst.StoragePool.build_default_pool(self.get_backend())
-        except Exception as e:
-            log.debug("Building default pool failed: %s", str(e))
-
         self._add_conn_events()
 
         try:
@@ -1025,6 +1018,14 @@ class vmmConnection(vmmGObject):
         self._init_object_event = None
         self._init_object_count = None
 
+        # Try to create the default storage pool
+        # We need this after events setup so we can determine if the default
+        # pool already exists
+        try:
+            virtinst.StoragePool.build_default_pool(self.get_backend())
+        except Exception as e:
+            log.debug("Building default pool failed: %s", str(e))
+
     def _open_thread(self):
         ConnectError = None
         try:
++++++ 53245827-urlfetcher-Force-a-flush-after-writing-to-a-file.patch ++++++
Subject: urlfetcher: Force a flush after writing to a file
From: Fabiano Fid??ncio fiden...@redhat.com Mon Aug 5 13:47:25 2019 +0200
Date: Tue Aug 6 17:59:05 2019 -0400:
Git: 5324582747a57c5df1574ed99dbe20d3d0f65747

While downloading really small files, on some file systems, the files
may not be flushed on time for whatever reason they've been downloaded.

This issue was noticed after trying to perform unattended installations
and noticing that some files, particularly really small ones, where just
empty.

While the original issue would be fixed by doing the flush on
_HTTPURLFetcher::_write(), let's also force it on _URLFetcher::_write()
to do the same.

Reviewed-by: Cole Robinson <crobi...@redhat.com>
Signed-off-by: Fabiano Fid??ncio <fiden...@redhat.com>

diff --git a/virtinst/install/urlfetcher.py b/virtinst/install/urlfetcher.py
index e48c801c..07f8b5ea 100644
--- a/virtinst/install/urlfetcher.py
+++ b/virtinst/install/urlfetcher.py
@@ -156,6 +156,7 @@ class _URLFetcher(object):
             fileobj.write(buff)
             total += len(buff)
             self.meter.update(total)
+        fileobj.flush()
         return total
 
     def _grabber(self, url):
@@ -291,6 +292,7 @@ class _HTTPURLFetcher(_URLFetcher):
             fileobj.write(data)
             total += len(data)
             self.meter.update(total)
+        fileobj.flush()
         return total
 
 
++++++ 5573aeb4-createnet-Fix-XML-editor-error-when-dhcp-fields-are-empty.patch 
++++++
Subject: createnet: Fix XML editor error when dhcp fields are empty
From: Cole Robinson crobi...@redhat.com Wed Jan 29 18:43:58 2020 -0500
Date: Wed Jan 29 18:53:31 2020 -0500:
Git: 5573aeb44100bcabdc24ab1cd19ec96bb4cb9d62

We need to handle the case when ip == None

https://bugzilla.redhat.com/show_bug.cgi?id=1726586

Signed-off-by: Cole Robinson <crobi...@redhat.com>

--- virt-manager-2.2.1.orig/virtManager/createnet.py
+++ virt-manager-2.2.1/virtManager/createnet.py
@@ -414,31 +414,35 @@ class vmmCreateNetwork(vmmGObjectUI):
         if self.get_config_ipv4_enable():
             ip = self.get_config_ip4()
             ipobj = net.ips.add_new()
-            ipobj.address = str(ip.network_address + 1)
-            ipobj.netmask = str(ip.netmask)
+            if ip:
+                ipobj.address = str(ip.network_address + 1)
+                ipobj.netmask = str(ip.netmask)
 
             if self.get_config_dhcpv4_enable():
                 dhcpobj = ipobj.ranges.add_new()
-                dhcpobj.start = str(
-                    self.get_config_dhcpv4_start().network_address
-                )
-                dhcpobj.end = str(self.get_config_dhcpv4_end().network_address)
+                start = self.get_config_dhcpv4_start()
+                end = self.get_config_dhcpv4_end()
+                if start:
+                    dhcpobj.start = str(start.network_address)
+                if end:
+                    dhcpobj.end = str(end.network_address)
 
         if self.get_config_ipv6_enable():
             ip = self.get_config_ip6()
             ipobj = net.ips.add_new()
             ipobj.family = "ipv6"
-            ipobj.address = str(ip.network_address + 1)
-            ipobj.prefix = str(ip.prefixlen)
+            if ip:
+                ipobj.address = str(ip.network_address + 1)
+                ipobj.prefix = str(ip.prefixlen)
 
             if self.get_config_dhcpv6_enable():
                 dhcpobj = ipobj.ranges.add_new()
-                dhcpobj.start = str(
-                    self.get_config_dhcpv6_start().network_address
-                )
-                dhcpobj.end = str(
-                    self.get_config_dhcpv6_end().network_address
-                )
+                start = self.get_config_dhcpv6_start()
+                end = self.get_config_dhcpv6_end()
+                if start:
+                    dhcpobj.start = str(start.network_address)
+                if end:
+                    dhcpobj.end = str(end.network_address)
 
         return net
 
++++++ 651e5b6d-devices-video-Simplify-model-hvm-check.patch ++++++
Subject: devices: video: Simplify model hvm check
From: Cole Robinson crobi...@redhat.com Thu Oct 3 15:41:44 2019 -0400
Date: Thu Oct 3 15:41:44 2019 -0400:
Git: 651e5b6d753930a2e7536efa4e6d20f57b038e80

Signed-off-by: Cole Robinson <crobi...@redhat.com>

diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py
index 3d8ab939..3ebc561f 100644
--- a/virtinst/devices/video.py
+++ b/virtinst/devices/video.py
@@ -27,6 +27,8 @@ class DeviceVideo(Device):
 
     @staticmethod
     def default_model(guest):
+        if not guest.os.is_hvm():
+            return None
         if guest.os.is_pseries():
             return "vga"
         if guest.os.is_arm_machvirt() or guest.os.is_riscv_virt():
@@ -37,11 +39,9 @@ class DeviceVideo(Device):
             if guest.has_gl():
                 return "virtio"
             return "qxl"
-        if guest.os.is_hvm():
-            if guest.conn.is_qemu():
-                return "qxl"
-            return "vga"
-        return None
+        if guest.conn.is_qemu():
+            return "qxl"
+        return "vga"
 
     def set_defaults(self, guest):
         if not self.model:
++++++ 7e3fb3f2-graphics-Default-to-vga-instead-of-qxl-for-non-spice.patch 
++++++
Subject: graphics: Default to 'vga' instead of 'qxl' for non-spice
From: Cole Robinson crobi...@redhat.com Mon Aug 31 13:43:56 2020 -0400
Date: Mon Aug 31 13:43:56 2020 -0400:
Git: 7e3fb3f281835ba6779886a89b27376cc423ef94

qxl doesn't add anything for the VNC case, and qxl is more likely
to be compiled out of qemu since it is dependent on spice, so vga
is the safer default for getting a working config

https://bugzilla.redhat.com/show_bug.cgi?id=1833704

Signed-off-by: Cole Robinson <crobi...@redhat.com>

diff --git a/tests/cli-test-xml/compare/virt-install-x86_64-graphics.xml 
b/tests/cli-test-xml/compare/virt-install-x86_64-graphics.xml
index ea9b184f..c1b06ca1 100644
--- a/tests/cli-test-xml/compare/virt-install-x86_64-graphics.xml
+++ b/tests/cli-test-xml/compare/virt-install-x86_64-graphics.xml
@@ -48,7 +48,7 @@
     <input type="tablet" bus="usb"/>
     <graphics type="vnc" port="-1"/>
     <video>
-      <model type="qxl"/>
+      <model type="vga"/>
     </video>
     <memballoon model="virtio"/>
     <rng model="virtio">
diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py
index fcca91b6..f9383131 100644
--- a/virtinst/devices/video.py
+++ b/virtinst/devices/video.py
@@ -42,8 +42,6 @@ class DeviceVideo(Device):
         if (guest.is_uefi() and
             guest.lookup_domcaps().supports_video_bochs()):
             return "bochs"
-        if guest.conn.is_qemu():
-            return "qxl"
         return "vga"
 
     def set_defaults(self, guest):
++++++ 8f4c53ea-video-Prefer-bochs-when-its-supported..patch ++++++
Subject: video: Prefer "bochs" when it's supported.
From: Fabiano Fid??ncio fiden...@redhat.com Thu Oct 3 10:50:34 2019 +0200
Date: Fri Oct 4 11:17:10 2019 -0400:
Git: 8f4c53ea960459516794ba533060a176cc26f121

Preferring "bochs" display device is the way to go when dealing with a
Linux guest using UEFI and that's quite well described here:
https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/

https://bugzilla.redhat.com/show_bug.cgi?id=1753644

Signed-off-by: Fabiano Fid??ncio <fiden...@redhat.com>

diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py
index 3ebc561f..fcca91b6 100644
--- a/virtinst/devices/video.py
+++ b/virtinst/devices/video.py
@@ -39,6 +39,9 @@ class DeviceVideo(Device):
             if guest.has_gl():
                 return "virtio"
             return "qxl"
+        if (guest.is_uefi() and
+            guest.lookup_domcaps().supports_video_bochs()):
+            return "bochs"
         if guest.conn.is_qemu():
             return "qxl"
         return "vga"
++++++ 9465da41-urlfetcher-Deal-with-file-in-_LocalURLFetcher.patch ++++++
Subject: urlfetcher: Deal with 'file://' in _LocalURLFetcher()
From: Fabiano Fid??ncio fiden...@redhat.com Tue Sep 24 14:26:43 2019 +0200
Date: Wed Oct 2 11:58:34 2019 -0400:
Git: 9465da4174e778e7607908f18d74fd8aa2cba2fe

osinfo-db may contain files pointing to local paths, which will have the
format 'file:///usr/share/...'.

With the current code, virt-install would just bail as it doesn't
understand the 'file://' schema. Let's start using urllib (which is
already imported in the very same file) and parse the URL so both
'file:///usr/share/...' and '/usr/share/...' would work.

Reviewed-by: Cole Robinson <crobi...@redhat.com>
Signed-off-by: Fabiano Fid??ncio <fiden...@redhat.com>

diff --git a/virtinst/install/urlfetcher.py b/virtinst/install/urlfetcher.py
index 6084bf01..e52efc8e 100644
--- a/virtinst/install/urlfetcher.py
+++ b/virtinst/install/urlfetcher.py
@@ -365,11 +365,13 @@ class _LocalURLFetcher(_URLFetcher):
     For grabbing files from a local directory
     """
     def _hasFile(self, url):
-        return os.path.exists(url)
+        parsed = urllib.parse.urlparse(url)
+        return os.path.exists(parsed.path)
 
     def _grabber(self, url):
-        urlobj = open(url, "rb")
-        size = os.path.getsize(url)
+        parsed = urllib.parse.urlparse(url)
+        urlobj = open(parsed.path, "rb")
+        size = os.path.getsize(parsed.path)
         return urlobj, size
 
 
++++++ ae19d6d6-fix-resizing-of-spice-clients-with-guest-resizing-enabled.patch 
++++++
Subject: fix resizing of spice clients with guest resizing enabled
From: Florian Ludwig f.lud...@greyrook.com Wed Oct 9 11:18:53 2019 +0200
Date: Tue Nov 12 11:46:35 2019 -0500:
Git: ae19d6d6ec0b48085ce1c765fb2264e27fb51c63

Fixes 1414718

diff --git a/virtManager/details/console.py b/virtManager/details/console.py
index 8ef8631a..193e79eb 100644
--- a/virtManager/details/console.py
+++ b/virtManager/details/console.py
@@ -374,7 +374,10 @@ class vmmConsolePages(vmmGObjectUI):
         if is_resizeguest:
             # With resize guest, we don't want to maintain aspect ratio,
             # since the guest can resize to arbitrary resolutions.
-            self._viewer.console_set_size_request(req.width, req.height)
+            viewer_alloc = Gdk.Rectangle()
+            viewer_alloc.width = req.width
+            viewer_alloc.height = req.height
+            self._viewer.console_size_allocate(viewer_alloc)
             return
 
         if not is_scale:
++++++ d934d6f2-domcaps-Fix-check-for-uncached-security-features.patch ++++++
Subject: domcaps: Fix check for uncached security features
From: Cole Robinson crobi...@redhat.com Tue Nov 12 14:15:56 2019 -0500
Date: Tue Nov 12 14:17:21 2019 -0500:
Git: d934d6f266e1731a5b881bbb9ae4cd60acd7887e

We need to check against None, which is the initial value, otherwise
a host with none of the security features present will repeatedly poll
libvirt baseline APIs

Signed-off-by: Cole Robinson <crobi...@redhat.com>

diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index ea0ffd1f..34991ed7 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -296,7 +296,7 @@ class DomainCapabilities(XMLBuilder):
                 'virt-ssbd',
                 'md-clear']
 
-        if self._features:
+        if self._features is not None:
             return self._features
 
         self._features = []
++++++ d9736db9-addhardware-Add-bochs-display-to-the-video-list.patch ++++++
Subject: addhardware: Add "bochs" display to the video list
From: Fabiano Fid??ncio fiden...@redhat.com Wed Oct 2 10:45:28 2019 +0200
Date: Fri Oct 4 11:17:14 2019 -0400:
Git: d9736db9d983d01c03929de226365dbf56a791a3

https://bugzilla.redhat.com/show_bug.cgi?id=1753644

Signed-off-by: Fabiano Fid??ncio <fiden...@redhat.com>

diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 842eada1..881f0e02 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -663,7 +663,7 @@ class vmmAddHardware(vmmGObjectUI):
         if guest.conn.is_xen():
             return ["xen", "vga"]
         if guest.conn.is_qemu() or guest.conn.is_test():
-            return ["vga", "qxl", "virtio"]
+            return ["vga", "bochs", "qxl", "virtio"]
         return []
 
     @staticmethod
++++++ e8bf16b9-details-fix-detection-of-firmware-auto-selection.patch ++++++
Subject: details: fix detection of firmware auto-selection
From: Pavel Hrdina phrd...@redhat.com Tue Jul 21 12:33:56 2020 +0200
Date: Thu Aug 13 16:40:53 2020 +0200:
Git: e8bf16b983558010cc9645e09eb36117e9e4fba4

Commit <15a9502b7b7a263c4d66ff2b3f31c209f58fe0b4> fixed firmware
detection but incorrectly. It will always show only "UEFI" even if
the firmware auto-selection is not used because the function is_uefi()
checks both the old style and the new auto-selection.

We have to check only for the auto-selection option.

Signed-off-by: Pavel Hrdina <phrd...@redhat.com>

--- virt-manager-2.2.1.orig/virtManager/details/details.py
+++ virt-manager-2.2.1/virtManager/details/details.py
@@ -2017,7 +2017,7 @@ class vmmDetails(vmmGObjectUI):
 
         # Firmware
         domcaps = self.vm.get_domain_capabilities()
-        if self.vm.get_xmlobj().is_uefi():
+        if self.vm.get_xmlobj().os.firmware == "efi":
             firmware = 'UEFI'
         else:
             firmware = domcaps.label_for_firmware_path(
++++++ virt-install.desktop ++++++
[Desktop Entry]
X-SuSE-translate=true
X-SuSE-DocTeamID=ycc_xen
Type=Application
Categories=GTK;GNOME;System;Monitor;X-SuSE-YaST;X-SuSE-YaST-Virtualization;

X-KDE-ModuleType=Library
X-KDE-RootOnly=true
X-KDE-HasReadOnlyMode=false
X-SuSE-YaST-Call=virt-install

X-SuSE-YaST-Group=Virtualization
X-SuSE-YaST-Argument=
X-SuSE-YaST-RootOnly=true
X-SuSE-YaST-Geometry=
X-SuSE-YaST-SortKey=

Icon=virt-manager
Exec=/sbin/yast2 virt-install

Name=Create Virtual Machines for Xen and KVM
GenericName=Create Virtual Machines
X-KDE-SubstituteUID=true

++++++ virt-install.rb ++++++
# ------------------------------------------------------------------------------
# Copyright (c) 2013 Novell, Inc. All Rights Reserved.
#
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, contact Novell, Inc.
#
# To contact Novell about this file by physical or electronic mail, you may find
# current contact information at www.novell.com.
# ------------------------------------------------------------------------------
#

#
# File: clients/virt-install.ycp
# Package:      Installation of a virtual machine
# Summary:      Main VM installation YaST frontend for python based virt-install
# Authors:      Charles E. Arnold <carn...@suse.com>
#
# $Id$

module Yast
  class VirtinstallClient < Client
    def main
      textdomain "virt-install"

      Yast.import "UI"
      Yast.import "Popup"
      Yast.import "String"
      Yast.import "Arch"

      #===================================================================
      # Start virt-install (GUI) or vm-install if Text mode (commandline)
      #-------------------------------------------------------------------
      status = 0
      @details = {}

      Builtins.y2milestone("START HERE.")
      if UI.TextMode()
        Builtins.y2milestone("Running virt-install in text mode is not 
supported. Running vm-install instead in command line mode.")
        status = UI.RunInTerminal("/usr/bin/vm-install")
      else
        Builtins.y2milestone("Launching virt-manager to run virt-install in GUI 
mode.")
        if Arch.is_xen0 == false
          details = Convert.to_map(SCR.Execute(path(".target.bash_output"), 
"/usr/bin/virt-manager --connect=qemu:///system --show-domain-creator"))
        else
          details = Convert.to_map(SCR.Execute(path(".target.bash_output"), 
"/usr/bin/virt-manager --connect=xen:/// --show-domain-creator"))
        end
        status = Ops.get_integer(details, "exit", 0)
      end

      Builtins.y2milestone("virt-install finished with exit code: <%1>", status)
      if status == 0
        return :next
      else
        if Builtins.size(Ops.get_string(details, "stderr", "")) > 0
          Popup.ErrorDetails(_("Failed to start virt-install"), 
Convert.to_string(details, "stderr", ""))
        else
          Popup.Error(_("Failed to start virt-install"))
        end
      end

      nil
    end
  end
end

Yast::VirtinstallClient.new.main
++++++ virt-manager-supportconfig ++++++
#!/bin/bash
#############################################################
# Name:        Supportconfig Plugin for virt-manager
# Description: Gathers important troubleshooting information
#              about virt-manager
# Author:      Jim Fehlig <jfeh...@suse.com>
#############################################################

RCFILE="/usr/lib/supportconfig/resources/scplugin.rc"

VIRTMAN_LOG_DIR="/root/.cache/virt-manager"
VIRTMAN_LOG_FILES=""

if [ -s $RCFILE ]; then
    if ! source $RCFILE; then
        echo "ERROR: Initializing resource file: $RCFILE" >&2
        exit 1
    fi
fi

rpm_verify() {
    thisrpm="$1"
    local ret=0

    echo
    echo "#==[ Validating RPM ]=================================#"
    if rpm -q "$thisrpm" >/dev/null 2>&1; then
        echo "# rpm -V $thisrpm"

        if rpm -V "$thisrpm"; then
            echo "Status: Passed"
        else
            echo "Status: WARNING"
        fi
    else
        echo "package $thisrpm is not installed"
        ret=1
    fi
    echo
    return $ret
}

if ! rpm_verify virt-manager; then
    echo "Skipped"
    exit 0
fi
        
test -d $VIRTMAN_LOG_DIR && VIRTMAN_LOG_FILES="$(find -L $VIRTMAN_LOG_DIR/ 
-type f)"
plog_files 0 "$VIRTMAN_LOG_FILES"

echo "Done"

++++++ virtconv-python2-to-python3-conversion.patch ++++++
Index: virt-manager-2.2.0/virtconv/vmx.py
===================================================================
--- virt-manager-2.2.0.orig/virtconv/vmx.py
+++ virt-manager-2.2.0/virtconv/vmx.py
@@ -259,7 +259,7 @@ class vmx_parser(parser_class):
 
         def _find_keys(prefixes):
             ret = []
-            for key, value in config.items():
+            for key, value in list(config.items()):
                 for p in xmlutil.listify(prefixes):
                     if key.startswith(p):
                         ret.append((key, value))
++++++ virtinst-add-caasp-support.patch ++++++
References: bsc#1010060

Index: virt-manager-2.2.1/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.1/virtinst/install/urldetect.py
@@ -273,6 +273,12 @@ class _SUSEContent(object):
                         self.product_name.strip().rsplit(' ')[5][2])
             distro_version = sle_version
 
+        # SUSE Container as a Service Platform
+        if "Container" in self.product_name:
+            distro_version = self.product_name.strip().rsplit(' ')[6]
+        elif "CaaS" in self.product_name:
+            distro_version = self.product_name.strip().rsplit(' ')[3]
+
         return distro_version
 
 
@@ -550,6 +556,9 @@ class _SuseDistro(_RHELDistro):
             # Tumbleweed 8 digit date
             return "opensusetumbleweed"
 
+        if self._variant_prefix.startswith(("caasp")):
+            return self._variant_prefix + distro_version
+
         if int(version) < 10:
             return self._variant_prefix + "9"
 
@@ -622,6 +631,14 @@ class _OpensuseDistro(_SuseDistro):
     famregex = ".*openSUSE.*"
 
 
+class _CAASPDistro(_SuseDistro):
+    PRETTY_NAME = "SLES"
+    matching_distros = ["caasp"]
+    _variant_prefix = "caasp"
+    _suse_regex = [".*SUSE Container as a Service Platform*", ".*SUSE CaaS 
Platform*"]
+    famregex = ".*(SUSE Container as a Service Platform|SUSE CaaS Platform).*"
+
+
 class _OESDistro(_SuseDistro):
     PRETTY_NAME = "OES"
     matching_distros = ["oes"]
@@ -838,6 +855,7 @@ def _build_distro_list(osobj):
         _SLESDistro,
         _SLEDDistro,
         _OpensuseDistro,
+        _CAASPDistro,
         _OESDistro,
         _DebianDistro,
         _UbuntuDistro,
++++++ virtinst-add-pvh-support.patch ++++++
References: fate#326698 - Add pvh support to virt-manager
At this time support is disabled in this patch.

Index: virt-manager-2.2.1/virtManager/createvm.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/createvm.py
+++ virt-manager-2.2.1/virtManager/createvm.py
@@ -792,6 +792,9 @@ class vmmCreateVM(vmmGObjectUI):
         for guest in guests:
             if not guest.domains:
                 continue
+            # xenpvh is currently unsupported
+            if guest.os_type == "xenpvh":
+                continue
 
             gtype = guest.os_type
             dom = guest.domains[0]
Index: virt-manager-2.2.1/virtinst/domain/os.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/domain/os.py
+++ virt-manager-2.2.1/virtinst/domain/os.py
@@ -32,6 +32,8 @@ class DomainOs(XMLBuilder):
         return self.os_type == "hvm"
     def is_xenpv(self):
         return self.os_type in ["xen", "linux"]
+    def is_xenpvh(self):
+        return self.os_type in ["xenpvh", "linux"]
     def is_container(self):
         return self.os_type == "exe"
 
Index: virt-manager-2.2.1/virtinst/guest.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/guest.py
+++ virt-manager-2.2.1/virtinst/guest.py
@@ -824,7 +824,7 @@ class Guest(XMLBuilder):
 
         usb_tablet = False
         usb_keyboard = False
-        if self.os.is_x86() and not self.os.is_xenpv():
+        if self.os.is_x86() and not self.os.is_xenpv() and not 
self.os.is_xenpvh():
             usb_tablet = self.osinfo.supports_usbtablet()
         if (self.os.is_arm_machvirt() or
             self.os.is_riscv_virt() or
Index: virt-manager-2.2.1/virtManager/object/domain.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/object/domain.py
+++ virt-manager-2.2.1/virtManager/object/domain.py
@@ -1150,6 +1150,8 @@ class vmmDomain(vmmLibvirtObject):
         return self.get_xmlobj().os.is_xenpv()
     def is_hvm(self):
         return self.get_xmlobj().os.is_hvm()
+    def is_xenpvh(self):
+        return self.get_xmlobj().os.is_xenpvh()
 
     def get_uuid(self):
         if self._uuid is None:
Index: virt-manager-2.2.1/virtManager/connection.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/connection.py
+++ virt-manager-2.2.1/virtManager/connection.py
@@ -223,6 +223,8 @@ class vmmConnection(vmmGObject):
                 label = "xen (paravirt)"
             elif gtype == "hvm":
                 label = "xen (fullvirt)"
+            elif gtype == "xenpvh":
+                label = "xen (pvh - Technical Preview)"
         elif domtype == "test":
             if gtype == "xen":
                 label = "test (xen)"
++++++ virtinst-add-sle15-detection-support.patch ++++++
References: bsc#1054986

Index: virt-manager-2.2.1/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.1/virtinst/install/urldetect.py
@@ -586,6 +586,10 @@ class _SuseDistro(_RHELDistro):
         if re.search("openSUSE Tumbleweed", self.cache.treeinfo_name):
             return "opensusetumbleweed"
 
+        sp_version = False
+        if ' SP' in self.cache.treeinfo_version:
+            sp_version = True
+            self.cache.treeinfo_version = 
self.cache.treeinfo_version.replace(' SP', '.')
         version, update = self.cache.split_version()
         base = self._variant_prefix + str(version)
         while update >= 0:
@@ -593,7 +597,10 @@ class _SuseDistro(_RHELDistro):
             # SLE doesn't use '.0' for initial releases in
             # osinfo-db (sles11, sles12, etc)
             if update > 0 or not base.startswith('sle'):
-                tryvar += ".%s" % update
+                if sp_version:
+                    tryvar += "sp%s" % update
+                else:
+                    tryvar += ".%s" % update
             if OSDB.lookup_os(tryvar):
                 return tryvar
             update -= 1
@@ -607,6 +614,14 @@ class _SuseDistro(_RHELDistro):
         return var
 
 
+class _SLEDistro(_SuseDistro):
+    PRETTY_NAME = "SLE"
+    matching_distros = ["sle"]
+    _variant_prefix = "sle"
+    _suse_regex = ["SUSE Linux Enterprise$"]
+    famregex = "SUSE Linux Enterprise$"
+
+
 class _SLESDistro(_SuseDistro):
     PRETTY_NAME = "SLES"
     matching_distros = ["sles"]
@@ -852,6 +867,7 @@ def _build_distro_list(osobj):
         _FedoraDistro,
         _RHELDistro,
         _CentOSDistro,
+        _SLEDistro,
         _SLESDistro,
         _SLEDDistro,
         _OpensuseDistro,
++++++ virtinst-change-location-for-grub_xen.patch ++++++
References: fate#326960, bsc#1123942

Index: virt-manager-2.2.1/virtinst/install/installer.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/installer.py
+++ virt-manager-2.2.1/virtinst/install/installer.py
@@ -446,7 +446,10 @@ class Installer(object):
                 guest.bootloader = "pygrub"
             else:
                 guest.bootloader = None
-                self._treemedia_bootconfig = 
("/usr/lib/grub2/x86_64-xen/grub.xen", "", "")
+                if os.path.exists("/usr/share/grub2/x86_64-xen/grub.xen"):
+                    self._treemedia_bootconfig = 
("/usr/share/grub2/x86_64-xen/grub.xen", "", "")
+                else:
+                    self._treemedia_bootconfig = 
("/usr/lib/grub2/x86_64-xen/grub.xen", "", "")
                 log.debug("Using grub.xen to boot guest")
                 on_reboot_value = guest.on_reboot
                 self._alter_bootconfig(guest)
Index: virt-manager-2.2.1/virtManager/delete.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/delete.py
+++ virt-manager-2.2.1/virtManager/delete.py
@@ -246,7 +246,7 @@ def populate_storage_list(storage_list,
     diskdata.append(("dtb", vm.get_xmlobj().os.dtb, True, False, True))
 
     for target, path, ro, shared, is_media in diskdata:
-        if not path or path == "/usr/lib/grub2/x86_64-xen/grub.xen":
+        if not path or "grub.xen" in path:
             continue
 
         # There are a few pieces here
++++++ virtinst-default-xen-to-qcow2-format.patch ++++++
Reference: bnc#885380
Allow Xen based VMs to default to using qcow2
Index: virt-manager-2.2.0/virtinst/support.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/support.py
+++ virt-manager-2.2.0/virtinst/support.py
@@ -249,7 +249,7 @@ class SupportCache:
     # This is an arbitrary check to say whether it's a good idea to
     # default to qcow2. It might be fine for xen or qemu older than the 
versions
     # here, but until someone tests things I'm going to be a bit conservative.
-    conn_default_qcow2 = _make(hv_version={"qemu": "1.2.0", "test": 0})
+    conn_default_qcow2 = _make(hv_version={"qemu": "1.2.0", "all": 0})
     conn_autosocket = _make(hv_libvirt_version={"qemu": "1.0.6"})
     conn_pm_disable = _make(hv_version={"qemu": "1.2.0", "test": 0})
     conn_qcow2_lazy_refcounts = _make(
++++++ virtinst-detect-oes-distros.patch ++++++
Enhancement to correctly detect Open Enterprise Server media is
selected as the installation source.
Index: virt-manager-2.2.1/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.1/virtinst/install/urldetect.py
@@ -553,7 +553,7 @@ class _SuseDistro(_RHELDistro):
         if int(version) < 10:
             return self._variant_prefix + "9"
 
-        if str(self._variant_prefix).startswith(("sles", "sled")):
+        if str(self._variant_prefix).startswith(("sles", "sled", "oes")):
             sp_version = ""
             if len(distro_version.split('.', 1)) == 2:
                 sp_version = 'sp' + distro_version.split('.', 1)[1].strip()
@@ -622,6 +622,14 @@ class _OpensuseDistro(_SuseDistro):
     famregex = ".*openSUSE.*"
 
 
+class _OESDistro(_SuseDistro):
+    PRETTY_NAME = "OES"
+    matching_distros = ["oes"]
+    _variant_prefix = "oes"
+    _suse_regex = [".*Open Enterprise Server*"]
+    famregex = ".*Open Enterprise Server.*"
+
+
 class _DebianDistro(_DistroTree):
     # ex. http://ftp.egr.msu.edu/debian/dists/sarge/main/installer-i386/
     # daily builds: https://d-i.debian.org/daily-images/amd64/
@@ -830,6 +838,7 @@ def _build_distro_list(osobj):
         _SLESDistro,
         _SLEDDistro,
         _OpensuseDistro,
+        _OESDistro,
         _DebianDistro,
         _UbuntuDistro,
         _MageiaDistro,
++++++ virtinst-dont-use-special-copy-cpu-features.patch ++++++
References: bsc#1067018 - L3: KVM Guest creation failed - Property .cmt not 
found

Some hardware has the .cmt cpu feature but qemu doesn't support it. libvirt
includes it in the cpu capabilities read in by virt-manager. Using 'host-model'
was known to have issues in the past and so a copy method was set up to
manually copy cpu features one at a time (including the unsupported cmt flag).
This patch simply avoids the special copy feature when "Copy host CPU 
definition"
is set in the Preferences -> New VM -> CPU Default pop-up menu and falls
back to using 'host-model'.

It should be noted that selecting "Customize configuration before install"
and "CPUs" -> "Copy host CPU definition" also inserts 'host-model' so
this change mirrors what is already done there.

Index: virt-manager-2.2.0/virtinst/domain/cpu.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/domain/cpu.py
+++ virt-manager-2.2.0/virtinst/domain/cpu.py
@@ -89,12 +89,16 @@ class DomainCpu(XMLBuilder):
                 val = self.SPECIAL_MODE_HOST_MODEL
 
         if (val == self.SPECIAL_MODE_HOST_MODEL or
-            val == self.SPECIAL_MODE_HOST_PASSTHROUGH):
+            val == self.SPECIAL_MODE_HOST_PASSTHROUGH or
+            val == self.SPECIAL_MODE_HOST_COPY):
             self.model = None
             self.vendor = None
             self.model_fallback = None
             for f in self.features:
                 self.remove_child(f)
+            if val == self.SPECIAL_MODE_HOST_COPY:
+                val = self.SPECIAL_MODE_HOST_MODEL
+                self.match = "exact"
             self.mode = val
         elif val == self.SPECIAL_MODE_HOST_COPY:
             self.copy_host_cpu(guest)
++++++ virtinst-keep-install-iso-attached.patch ++++++
Older SLE guests have a two stage installation that need the ISO.
Newer SLE PV guests hang when a cdrom device is attached without
an ISO file.

Index: virt-manager-2.2.0/virtinst/install/installer.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/install/installer.py
+++ virt-manager-2.2.0/virtinst/install/installer.py
@@ -111,7 +111,8 @@ class Installer(object):
     def _remove_install_cdrom_media(self, guest):
         if not self._install_cdrom_device_added:
             return
-        if guest.osinfo.is_windows():
+        if (guest.osinfo.is_windows() or
+            guest.osinfo.name.startswith(("sles", "sled", "opensuse"))):
             # Keep media attached for windows which has a multi stage install
             return
         for disk in guest.devices.disk:
++++++ virtinst-keep-iso-for-xenpv.patch ++++++
References: bsc#1180897
Removing the cdrom iso file from the device prevents booting
with a qemu error.

--- virt-manager/virtinst/install/installer.py.orig     2021-01-25 
12:22:43.284220879 -0700
+++ virt-manager/virtinst/install/installer.py  2021-01-25 13:49:00.195386309 
-0700
@@ -117,8 +117,9 @@ class Installer(object):
             return
         for disk in guest.devices.disk:
             if disk.is_cdrom() and disk.path == self._cdrom_path():
-                disk.path = None
-                disk.sync_path_props()
+                if not guest.os.is_xenpv():
+                    disk.path = None
+                    disk.sync_path_props()
                 break
 
     def _add_unattended_install_cdrom_device(self, guest, location):
++++++ virtinst-media-detection.patch ++++++
When both the content file and .treeinfo file are missing from the media
look in the media.1/products and media.1/media files for information.
Caasp 4.0 has not content or .treeinfo file on the media

Index: virt-manager-2.2.0/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.0/virtinst/install/urldetect.py
@@ -488,8 +488,23 @@ class _SuseDistro(_RHELDistro):
             cache.checked_for_suse_content = True
             content_str = cache.acquire_file_content("content")
             if content_str is None:
-                return False
-
+                products_str = cache.acquire_file_content("media.1/products")
+                if products_str:
+                    products_str = products_str.replace('/', ' ,', 1)
+                    products_str = "DISTRO " + products_str.replace('-', ' ')
+                media_str = cache.acquire_file_content("media.1/media")
+                if media_str:
+                    media_arch = "x86_64"
+                    if 'aarch64' in media_str:
+                        media_arch = "aarch64"
+                    elif 'ppc64le' in media_str:
+                        media_arch = "ppc64le"
+                    elif 's390x' in media_str:
+                        media_arch = "s390x"
+                    media_str = 'BASEARCHS ' + media_arch
+                if products_str is None and media_str is None:
+                    return False
+                content_str = products_str + "\n" + media_str
             try:
                 cache.suse_content = _SUSEContent(content_str)
             except Exception as e:
++++++ virtinst-modify-gui-defaults.patch ++++++
Enhancement for the following GUI wizard installation option.
1) If Xen, leave 'Architecture options' expanded so users know PV
is the default
Index: virt-manager-2.2.1/virtManager/createvm.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/createvm.py
+++ virt-manager-2.2.1/virtManager/createvm.py
@@ -404,8 +404,20 @@ class vmmCreateVM(vmmGObjectUI):
         self.widget("method-local").set_active(True)
         self.widget("create-conn").set_active(-1)
         activeconn = self._populate_conn_list(urihint)
-        self.widget("arch-expander").set_expanded(False)
         self.widget("vz-virt-type-hvm").set_active(True)
+        # For Xen have the expander open so users can see PV is the default
+        if activeconn and activeconn.is_xen():
+            self.widget("arch-expander").set_expanded(True)
+        else:
+            self.widget("arch-expander").set_expanded(False)
+
+        # Default to Network install if host was installed that way
+        host_instsrc = getHostInstallSource()
+        if host_instsrc is not None and \
+           (host_instsrc.startswith('ftp:') or 
host_instsrc.startswith('http:') or \
+            host_instsrc.startswith('smb:') or 
host_instsrc.startswith('nfs:')):
+            self.widget("method-local").set_active(False)
+            self.widget("method-tree").set_active(True)
 
         if self._set_conn(activeconn) is False:
             return False
++++++ virtinst-osdict-get_supported.patch ++++++
Some distros are out of support for normal customers but continue
to be supported through LTSS contracts for others. Hence the EOL
date in the osinfo-db file may be past but we want the distro to
continue to show up in the list.

Index: virt-manager-2.2.0/virtinst/osdict.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/osdict.py
+++ virt-manager-2.2.0/virtinst/osdict.py
@@ -445,7 +445,7 @@ class _OsVariant(object):
 
         # If no EOL is present, assume EOL if release was > 5 years ago
         if rel is not None:
-            rel5 = _glib_to_datetime(rel) + datetime.timedelta(days=365 * 5)
+            rel5 = _glib_to_datetime(rel) + datetime.timedelta(days=365 * 10)
             return now > rel5
         return False
 
++++++ virtinst-pvgrub2-bootloader.patch ++++++
Reference: bnc#863821
grub.xen is required to boot PV VMs that use the BTRFS filesystem.
This patch forces the use of grub.xen (instead of using pygrub) for
suse distros SLE12GA, openSUSE 13.2, and newer.
Index: virt-manager-2.2.1/virtinst/install/installer.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/installer.py
+++ virt-manager-2.2.1/virtinst/install/installer.py
@@ -167,7 +167,8 @@ class Installer(object):
 
     def _alter_treemedia_bootconfig(self, guest):
         if not self._treemedia:
-            return
+            if not self._treemedia_bootconfig or "grub.xen" not in 
self._treemedia_bootconfig[0]:
+                return
 
         kernel, initrd, kernel_args = self._treemedia_bootconfig
         if kernel:
@@ -436,6 +437,20 @@ class Installer(object):
         install_xml = None
         if self.has_install_phase():
             install_xml = self._get_install_xml(guest, meter)
+        if (guest.os.is_xenpv() and
+            not guest.os.kernel):
+            os_ver = guest.osinfo.name
+            if guest.os.arch != 'x86_64' or os_ver.startswith("sles9") or \
+               os_ver.startswith("sles10") or os_ver.startswith("sled10") or \
+               os_ver.startswith("opensuse10") or 
os_ver.startswith("opensuse11"):
+                guest.bootloader = "pygrub"
+            else:
+                guest.bootloader = None
+                self._treemedia_bootconfig = 
("/usr/lib/grub2/x86_64-xen/grub.xen", "", "")
+                log.debug("Using grub.xen to boot guest")
+                on_reboot_value = guest.on_reboot
+                self._alter_bootconfig(guest)
+                guest.on_reboot = on_reboot_value
         final_xml = guest.get_xml()
 
         log.debug("Generated install XML: %s",
++++++ virtinst-python2-to-python3-conversion.patch ++++++
Index: virt-manager-2.2.1/virtinst/osdict.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/osdict.py
+++ virt-manager-2.2.1/virtinst/osdict.py
@@ -54,7 +54,7 @@ def _sort(tosort):
     distro_mappings = {}
     retlist = []
 
-    for key, osinfo in tosort.items():
+    for key, osinfo in list(tosort.items()):
         # Libosinfo has some duplicate version numbers here, so append .1
         # if there's a collision
         sortby = _sortby(osinfo)
Index: virt-manager-2.2.1/virtinst/install/installertreemedia.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/installertreemedia.py
+++ virt-manager-2.2.1/virtinst/install/installertreemedia.py
@@ -20,7 +20,7 @@ from ..osdict import OSDB
 (MEDIA_DIR,
  MEDIA_ISO,
  MEDIA_URL,
- MEDIA_KERNEL) = range(1, 5)
+ MEDIA_KERNEL) = list(range(1, 5))
 
 
 def _is_url(url):
Index: virt-manager-2.2.1/virtinst/xmlbuilder.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/xmlbuilder.py
+++ virt-manager-2.2.1/virtinst/xmlbuilder.py
@@ -661,7 +661,7 @@ class XMLBuilder(object):
         whenever child objects are added or removed
         """
         typecount = {}
-        for propname, xmlprop in self._all_child_props().items():
+        for propname, xmlprop in list(self._all_child_props().items()):
             for obj in xmlutil.listify(getattr(self, propname)):
                 idxstr = ""
                 if not xmlprop.is_single:
Index: virt-manager-2.2.1/virtinst/domcapabilities.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/domcapabilities.py
+++ virt-manager-2.2.1/virtinst/domcapabilities.py
@@ -218,7 +218,7 @@ class DomainCapabilities(XMLBuilder):
                 return _("BIOS")
             return _("None")
 
-        for arch, patterns in self._uefi_arch_patterns.items():
+        for arch, patterns in list(self._uefi_arch_patterns.items()):
             for pattern in patterns:
                 if re.match(pattern, path):
                     return (_("UEFI %(arch)s: %(path)s") %
Index: virt-manager-2.2.1/virtinst/devices/disk.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/devices/disk.py
+++ virt-manager-2.2.1/virtinst/devices/disk.py
@@ -269,7 +269,7 @@ class DeviceDisk(Device):
                 digit = 1
 
             seen_valid = True
-            gen_t += "%c" % (ord('a') + digit - 1)
+            gen_t += "%c" % int(ord('a') + digit - 1)
 
         return gen_t
 
@@ -879,11 +879,11 @@ class DeviceDisk(Device):
         def get_target():
             first_found = None
 
-            ran = range(maxnode)
+            ran = list(range(maxnode))
             if pref_ctrl is not None:
                 # We assume narrow SCSI bus and libvirt assigning 7
                 # (1-7, 8-14, etc.) devices per controller
-                ran = range(pref_ctrl * 7, (pref_ctrl + 1) * 7)
+                ran = list(range(pref_ctrl * 7, (pref_ctrl + 1) * 7))
 
             for i in ran:
                 postfix = self.num_to_target(i + 1)
Index: virt-manager-2.2.1/virtinst/pollhelpers.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/pollhelpers.py
+++ virt-manager-2.2.1/virtinst/pollhelpers.py
@@ -129,7 +129,7 @@ def fetch_pools(backend, origmap, build_
         for obj in objs:
             try:
                 obj.refresh(0)
-            except Exception, e:
+            except Exception as e:
                 pass
 
         return _new_poll_helper(origmap, name,
++++++ virtinst-refresh_before_fetch_pool.patch ++++++
Reference: bnc#887868
Refresh pools status before fetch_pools.

Currently, when connecting to hypervisor, if there are pools active
but in fact target path already deleted (or for other reasons the
pool is not working), libvirtd not refresh status yet, fetch_pools
will fail, that will cause "connecting to hypervisor" process
reporting error and exit. The whole connection work failed.

With the patch, always refresh pool status before fetch pools. Let
the libvirtd pool status reflect the reality, avoid the non-synced
status affects the hypervisor connection.

Signed-off-by: Chunyan Liu <cy...@suse.com>

Index: virt-manager-2.2.0/virtinst/pollhelpers.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/pollhelpers.py
+++ virt-manager-2.2.0/virtinst/pollhelpers.py
@@ -119,6 +119,19 @@ def fetch_pools(backend, origmap, build_
     name = "pool"
 
     if backend.support.conn_listallstoragepools() and not FORCE_OLD_POLL:
+
+        # Refresh pools before poll_helper. For those
+        # 'active' but target path not exist (or other reasons
+        # causing the pool not working), but libvirtd not
+        # refresh the status, this will make it refreshed
+        # and mark that pool as 'inactive'.
+        objs = backend.listAllStoragePools()
+        for obj in objs:
+            try:
+                obj.refresh(0)
+            except Exception, e:
+                pass
+
         return _new_poll_helper(origmap, name,
                                 backend.listAllStoragePools, build_func)
     else:
++++++ virtinst-s390x-disable-graphics.patch ++++++
Reference: bnc#869024
Disable graphics on s390x
Index: virt-manager-2.2.1/virtinst/guest.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/guest.py
+++ virt-manager-2.2.1/virtinst/guest.py
@@ -225,7 +225,10 @@ class Guest(XMLBuilder):
         self.skip_default_channel = False
         self.skip_default_sound = False
         self.skip_default_usbredir = False
-        self.skip_default_graphics = False
+        if self.os.is_s390x():
+            self.skip_default_graphics = True
+        else:
+            self.skip_default_graphics = False
         self.skip_default_rng = False
         self.disable_default_memballoon = False
         self.x86_cpu_default = self.cpu.SPECIAL_MODE_APP_DEFAULT
@@ -480,7 +483,7 @@ class Guest(XMLBuilder):
         if not os_support:
             return False
 
-        if self.os.is_x86():
+        if self.os.is_x86() or self.os.is_s390x():
             return True
 
         return False
@@ -864,7 +867,7 @@ class Guest(XMLBuilder):
         self.add_device(dev)
 
     def _add_default_video_device(self):
-        if self.os.is_container():
+        if self.os.is_container() or self.os.is_s390x():
             return
         if self.devices.video:
             return
++++++ virtinst-sap-detection.patch ++++++
Index: virt-manager-2.2.1/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.1/virtinst/install/urldetect.py
@@ -267,9 +267,16 @@ class _SUSEContent(object):
         distro_version = distro_version.strip()
 
         if "Enterprise" in self.product_name or "SLES" in self.product_name:
-            sle_version = self.product_name.strip().rsplit(' ')[4]
+            if " SAP " in self.product_name:
+                sle_version = self.product_name.strip().rsplit(' ')[7]
+            else:
+                sle_version = self.product_name.strip().rsplit(' ')[4]
             if len(self.product_name.strip().rsplit(' ')) > 5:
-                sle_version = (sle_version + '.' +
+                if " SAP " in self.product_name:
+                    sle_version = (sle_version + '.' +
+                        self.product_name.strip().rsplit(' ')[8][2])
+                else:
+                    sle_version = (sle_version + '.' +
                         self.product_name.strip().rsplit(' ')[5][2])
             distro_version = sle_version
 
@@ -579,7 +586,7 @@ class _SuseDistro(_RHELDistro):
         if self._variant_prefix.startswith(("caasp")):
             return self._variant_prefix + distro_version
 
-        if int(version) < 10:
+        if isinstance(version, int) and int(version) < 10:
             return self._variant_prefix + "9"
 
         if str(self._variant_prefix).startswith(("sles", "sled", "oes")):
++++++ virtinst-set-cache-mode-unsafe-for-install.patch ++++++
Set cache mode for target installation disk to unsafe for better
performance.
Index: virt-manager-2.2.1/virtinst/install/installer.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/installer.py
+++ virt-manager-2.2.1/virtinst/install/installer.py
@@ -422,11 +422,22 @@ class Installer(object):
                 guest.memory) = data
 
     def _get_install_xml(self, guest, meter):
+        # At install time set the target disk to 'unsafe' for
+        # better performance if the target is not a block device
+        saved_cache = "None"
+        if guest.devices.disk:
+            target_disk = guest.devices.disk[0]
+            saved_cache = target_disk.driver_cache
+            if target_disk.type != DeviceDisk.TYPE_BLOCK and 
target_disk.driver_io != "native":
+                target_disk.driver_cache = DeviceDisk.CACHE_MODE_UNSAFE
+
         data = self._prepare_get_install_xml(guest)
         try:
             self._alter_bootconfig(guest)
             self._alter_install_resources(guest, meter)
             ret = guest.get_xml()
+            if saved_cache != "None":
+                target_disk.driver_cache = saved_cache
             return ret
         finally:
             self._remove_install_cdrom_media(guest)
++++++ virtinst-set-default-nic.patch ++++++
References: bsc#1172356
Libvirt doesn't accept "Hypervisor default" as a model name

Index: virt-manager-2.2.1/virtinst/devices/interface.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/devices/interface.py
+++ virt-manager-2.2.1/virtinst/devices/interface.py
@@ -256,6 +256,9 @@ class DeviceInterface(Device):
             return "e1000e"
         if not guest.os.is_x86():
             return None
+        if guest.conn.is_xen() and guest.os.is_hvm():
+            # Let libvirt decide the default
+            return None
 
         prefs = ["e1000", "rtl8139", "ne2k_pci", "pcnet"]
         supported_models = guest.osinfo.supported_netmodels()
++++++ virtinst-set-qemu-emulator.patch ++++++
Use the correct qemu emulator based on the architecture.
We want to get away from using the old qemu-dm emulator
for Xen HVM guests so default to qemu-system-i386.
Index: virt-manager-2.2.1/virtinst/guest.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/guest.py
+++ virt-manager-2.2.1/virtinst/guest.py
@@ -740,6 +740,10 @@ class Guest(XMLBuilder):
         self._add_default_memballoon()
 
         self.clock.set_defaults(self)
+        if self.os.is_hvm() and self.type == "xen":
+            # Force not using Xen's old qemu-dm
+            if not self.emulator or "qemu-dm" in self.emulator:
+                self.emulator = "/usr/lib/xen/bin/qemu-system-i386"
         self.cpu.set_defaults(self)
         self.features.set_defaults(self)
         for seclabel in self.seclabels:
++++++ virtinst-smbios-unsupported-for-xenpv.patch ++++++
References: bsc#1180069

--- virt-manager-2.2.1/virtinst/guest.py.orig   2021-01-07 12:44:01.976882907 
-0700
+++ virt-manager-2.2.1/virtinst/guest.py        2021-01-07 12:45:08.128884483 
-0700
@@ -704,6 +704,8 @@ class Guest(XMLBuilder):
             self.type != "kvm"):
             log.warning("KVM acceleration not available, using '%s'",
                             self.type)
+        if self.os.is_xenpv() and self.os.smbios_mode is not None:
+            raise RuntimeError(_("The --sysinfo flag (smbios) is not supported 
for Xen PV guests."))
 
     def sync_vcpus_topology(self):
         """
++++++ virtinst-use-qemu-for-cdrom-device.patch ++++++
References: bsc#989639
When the device added is a cdrom device (/dev/sr0), don't use
"phy" as the driver name but instead use "qemu".

Index: virt-manager-2.2.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.2.0/virtinst/devices/disk.py
@@ -389,7 +389,8 @@ class DeviceDisk(Device):
         # Recommended xen defaults from here:
         # https://bugzilla.redhat.com/show_bug.cgi?id=1171550#c9
         # If type block, use name=phy. Otherwise do the same as qemu
-        if self.conn.is_xen() and self.type == self.TYPE_BLOCK:
+        if self.conn.is_xen() and self.type == self.TYPE_BLOCK and not \
+           self.is_cdrom():
             return self.DRIVER_NAME_PHY
         if self.conn.support.conn_disk_driver_name_qemu():
             return self.DRIVER_NAME_QEMU
++++++ virtinst-use-xenpae-kernel-for-32bit.patch ++++++
References: bsc#978173
The 32bit versions of the media contain a xenpae version along with
a non pae version. The sles10 sp4 32bit kernel will only boot para-
virtualized if the pae kernel is selected.
Note that sles12 and newer has no 32bit release.

Index: virt-manager-2.2.0/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.0/virtinst/install/urldetect.py
@@ -533,9 +533,14 @@ class _SuseDistro(_RHELDistro):
 
         if self.type == "xen":
             # Matches Opensuse > 10.2 and sles 10
-            self._kernel_paths.append(
-                ("boot/%s/vmlinuz-xen" % tree_arch,
-                 "boot/%s/initrd-xen" % tree_arch))
+            if tree_arch == "i386":
+                self._kernel_paths.append(
+                    ("boot/%s/vmlinuz-xenpae" % tree_arch,
+                     "boot/%s/initrd-xenpae" % tree_arch))
+            else:
+                self._kernel_paths.append(
+                    ("boot/%s/vmlinuz-xen" % tree_arch,
+                     "boot/%s/initrd-xen" % tree_arch))
 
         if str(self._os_variant).startswith(("sles11", "sled11")):
             if tree_arch == "s390x":
++++++ virtinst-vol-default-nocow.patch ++++++
Reference: fate#315125:
Set NOCOW flag to newly created volume by default, to solve performance
issue on btrfs.

Signed-off-by: Chunyan Liu <cy...@suse.com>

Index: virt-manager-2.2.1/virtinst/storage.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/storage.py
+++ virt-manager-2.2.1/virtinst/storage.py
@@ -548,6 +548,11 @@ class StorageVolume(_StorageObject):
         return self._pool_xml.get_disk_type()
     file_type = property(_get_vol_type)
 
+    def _nocow_default_cb(self):
+        return self.conn.check_support(
+            self.conn.conn_nocow)
+    nocow = XMLProperty("./target/nocow", is_bool=True)
+
 
     ##################
     # XML properties #
Index: virt-manager-2.2.1/virtinst/support.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/support.py
+++ virt-manager-2.2.1/virtinst/support.py
@@ -283,6 +283,7 @@ class SupportCache:
     conn_vnc_none_auth = _make(hv_version={"qemu": "2.9.0"})
     conn_device_boot_order = _make(hv_version={"qemu": 0, "test": 0})
     conn_riscv_virt_pci_default = _make(version="5.3.0", hv_version={"qemu": 
"4.0.0"})
+    conn_nocow = _make(version="1.2.18", hv_version={"qemu": "2.2.0", "test": 
0})
 
     # We choose qemu 2.11.0 as the first version to target for q35 default.
     # That's not really based on anything except reasonably modern at the
++++++ virtinst-xen-drive-type.patch ++++++
Reference: bnc#813082
Virt-manager on Xen doesn't fill in any type thereby defaulting to
'raw'. This patch will generate the correct XML on Xen.

Index: virt-manager-2.2.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.2.0/virtinst/devices/disk.py
@@ -406,6 +406,10 @@ class DeviceDisk(Device):
         https://lists.gnu.org/archive/html/qemu-devel/2008-04/msg00675.html
         """
         if self.driver_name != self.DRIVER_NAME_QEMU:
+            if self.driver_name and \
+               self.driver_name != self.DRIVER_NAME_PHY and \
+               self.type != 'file':
+                return self.type
             return None
 
         drvtype = self._storage_backend.get_driver_type()
++++++ virtinst-xenbus-disk-index-fix.patch ++++++
Reference: bnc#872789
This is an indexing problem created by virt-manager.  It knows not
to add two IDE disks of the same name (eg, 'hda' twice) or two Xen
disks of the same name (eg, 'xvda' twice) but with the different bus
types (ide vs xen) it added xvda with hda.  These disks were then
passed to qemu where it error'ed out with the disks having the same
index (in this case both are 0).

Index: virt-manager-2.2.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.2.0/virtinst/devices/disk.py
@@ -861,6 +861,17 @@ class DeviceDisk(Device):
         :returns: generated target
         """
         prefix, maxnode = self.get_target_prefix(skip_targets)
+        postfix_targets = []
+        if self.conn.is_xen():
+            prefixes = [ "hd", "xvd", "vd", "sd", "fd" ]
+            for x in skip_targets:
+                if x is None:
+                    continue
+                for p in prefixes:
+                    found = x.split(p,1)
+                    if found and len(found) == 2:
+                        postfix_targets.append(found[1])
+                        break
         skip_targets = [t for t in skip_targets if t and t.startswith(prefix)]
         skip_targets.sort()
 
@@ -874,7 +885,12 @@ class DeviceDisk(Device):
                 ran = range(pref_ctrl * 7, (pref_ctrl + 1) * 7)
 
             for i in ran:
-                gen_t = prefix + self.num_to_target(i + 1)
+                postfix = self.num_to_target(i + 1)
+                gen_t = prefix + postfix
+                if self.conn.is_xen() and postfix in postfix_targets:
+                    if gen_t in skip_targets:
+                        skip_targets.remove(gen_t)
+                    continue
                 if gen_t in skip_targets:
                     skip_targets.remove(gen_t)
                     continue
++++++ virtman-allow-creating-i686-vm.patch ++++++
References: bsc#919692
Because openSUSE repos combine 32 and 64 bit sources we need to
continue showing the 'Architecture' pop-up.
Index: virt-manager-2.2.1/virtManager/createvm.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/createvm.py
+++ virt-manager-2.2.1/virtManager/createvm.py
@@ -830,11 +830,6 @@ class vmmCreateVM(vmmGObjectUI):
         for guest in self.conn.caps.guests:
             if guest.os_type == self._capsinfo.os_type:
                 archs.append(guest.arch)
-
-        # Combine x86/i686 to avoid confusion
-        if (self.conn.caps.host.cpu.arch == "x86_64" and
-            "x86_64" in archs and "i686" in archs):
-            archs.remove("i686")
         archs.sort()
 
         prios = ["x86_64", "i686", "aarch64", "armv7l", "ppc64", "ppc64le",
++++++ virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch ++++++
Reference: bnc#875111
Steps to get a KVM VM in the crashed state:
1) Install a sles12 KVM VM
2) Manually edit the XML and add/modify <on_crash>preserve</on_crash>
3) In virt-manager add the panic device (Details->Add Hardware)
4) Edit the VM's /etc/default/grub file and remove the crashkernel information
   and then run grub2-mkconfig /boot/grub2/grub.cfg.
5) Start the VM and within the VM's terminal type "echo 'c' > 
/proc/sysrq-trigger"
Index: virt-manager-2.2.0/virtManager/manager.py
===================================================================
--- virt-manager-2.2.0.orig/virtManager/manager.py
+++ virt-manager-2.2.0/virtManager/manager.py
@@ -784,7 +784,7 @@ class vmmManager(vmmGObjectUI):
             show_pause = bool(vm and vm.is_unpauseable())
         else:
             show_pause = bool(vm and vm.is_pauseable())
-        show_shutdown = bool(vm and vm.is_stoppable())
+        show_shutdown = bool(vm and vm.is_destroyable())
 
         if vm and vm.managedsave_supported:
             self.change_run_text(vm.has_managed_save())
Index: virt-manager-2.2.0/virtManager/vmmenu.py
===================================================================
--- virt-manager-2.2.0.orig/virtManager/vmmenu.py
+++ virt-manager-2.2.0/virtManager/vmmenu.py
@@ -21,6 +21,7 @@ class _VMMenu(Gtk.Menu):
         self._parent = src
         self._current_vm_cb = current_vm_cb
         self._show_open = show_open
+        self._shutdown = None
 
         self._init_state()
 
@@ -84,6 +85,7 @@ class VMShutdownMenu(_VMMenu):
             name = getattr(child, "vmm_widget_name", None)
             if name in statemap:
                 child.set_sensitive(statemap[name])
+                child.set_visible(statemap[name])
 
             if name == "reset":
                 child.set_tooltip_text(None)
@@ -105,7 +107,8 @@ class VMActionMenu(_VMMenu):
         self._add_action(_("R_esume"), "resume", VMActionUI.resume,
                 Gtk.STOCK_MEDIA_PAUSE)
         s = self._add_action(_("_Shut Down"), "shutdown", None)
-        s.set_submenu(VMShutdownMenu(self._parent, self._current_vm_cb))
+        self._shutdown = VMShutdownMenu(self._parent, self._current_vm_cb)
+        s.set_submenu(self._shutdown)
 
         self.add(Gtk.SeparatorMenuItem())
         self._add_action(_("Clone..."), "clone",
@@ -125,7 +128,7 @@ class VMActionMenu(_VMMenu):
     def update_widget_states(self, vm):
         statemap = {
             "run": bool(vm and vm.is_runable()),
-            "shutdown": bool(vm and vm.is_stoppable()),
+            "shutdown": bool(vm and vm.is_destroyable()),
             "suspend": bool(vm and vm.is_stoppable()),
             "resume": bool(vm and vm.is_paused()),
             "migrate": bool(vm and vm.is_stoppable()),
@@ -142,6 +145,8 @@ class VMActionMenu(_VMMenu):
                 child.get_submenu().update_widget_states(vm)
             if name in statemap:
                 child.set_sensitive(statemap[name])
+                if name == "shutdown" and self._shutdown:
+                    self._shutdown.update_widget_states(vm)
             if name in vismap:
                 child.set_visible(vismap[name])
 
++++++ virtman-check-for-valid-display.patch ++++++
References: bnc#907958
Sanity check for those who forget '-X' on ssh and try to start virt-manager
Index: virt-manager-2.2.0/virt-manager
===================================================================
--- virt-manager-2.2.0.orig/virt-manager
+++ virt-manager-2.2.0/virt-manager
@@ -66,8 +66,11 @@ def _import_gtk(leftovers):
             print("gtk3 3.22.0 or later is required.")
             sys.exit(1)
 
-        # This will error if Gtk wasn't correctly initialized
-        Gtk.init()
+        if os.environ.has_key('DISPLAY') and os.environ['DISPLAY']:
+            # This will error if Gtk wasn't correctly initialized
+            Gtk.Window()
+        else:
+            raise Exception("Error starting virt-manager: No graphical display 
found")
         globals()["Gtk"] = Gtk
 
         # This ensures we can init gsettings correctly
++++++ virtman-desktop.patch ++++++
Index: virt-manager-2.0.0/data/virt-manager.desktop.in
===================================================================
--- virt-manager-2.0.0.orig/data/virt-manager.desktop.in
+++ virt-manager-2.0.0/data/virt-manager.desktop.in
@@ -1,8 +1,19 @@
 [Desktop Entry]
 _Name=Virtual Machine Manager
-_Comment=Manage virtual machines
+_Comment=Manage Virtual Machines for Xen and KVM
 Icon=virt-manager
-Exec=virt-manager
+Version=1.0
+Exec=/usr/bin/virt-manager
 Type=Application
 Terminal=false
-Categories=System;
+Encoding=UTF-8
+Categories=GTK;GNOME;System;Monitor;X-SuSE-YaST;X-SuSE-YaST-Virtualization;
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=false
+X-SuSE-YaST-Call=/usr/bin/virt-manager
+X-SuSE-YaST-Group=Virtualization
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
++++++ virtman-disallow-adding-floppy-disk.patch ++++++
References: bsc#1174176, bsc#1174139
Current libxl does not support adding a floppy. Code is included
in this patch anyways to correctly set up a bus if a floppy were
added.


Index: virt-manager-2.2.1/virtManager/addhardware.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/addhardware.py
+++ virt-manager-2.2.1/virtManager/addhardware.py
@@ -528,6 +528,9 @@ class vmmAddHardware(vmmGObjectUI):
             buses = domcaps.devices.disk.get_enum("bus").get_values()
         else:
             buses = vmmAddHardware.disk_old_recommended_buses(guest)
+        # libxl doesn't support floppy but request one from qemu anyways if 
specified
+        if guest.conn.is_xen() and devtype == "floppy":
+            buses.append("fdc")
 
         bus_map = {
             "disk": ["ide", "sata", "scsi", "sd", "usb", "virtio", "xen"],
@@ -539,7 +542,7 @@ class vmmAddHardware(vmmGObjectUI):
 
     @staticmethod
     def disk_pretty_bus(bus):
-        if bus in ["ide", "sata", "scsi", "usb", "sd"]:
+        if bus in ["ide", "sata", "scsi", "usb", "sd", "fdc"]:
             return bus.upper()
         if bus in ["xen"]:
             return bus.capitalize()
@@ -724,8 +727,9 @@ class vmmAddHardware(vmmGObjectUI):
                       "drive-harddisk", _("Disk device")])
         target_model.append([DeviceDisk.DEVICE_CDROM,
                       "media-optical", _("CDROM device")])
-        target_model.append([DeviceDisk.DEVICE_FLOPPY,
-                      "media-floppy", _("Floppy device")])
+        if not self.conn.is_xen():
+            target_model.append([DeviceDisk.DEVICE_FLOPPY,
+                          "media-floppy", _("Floppy device")])
         if self.conn.is_qemu() or self.conn.is_test():
             target_model.append([DeviceDisk.DEVICE_LUN,
                           "drive-harddisk", _("LUN Passthrough")])
++++++ virtman-dont-allow-grub.xen-to-be-deleted.patch ++++++
Reference: bnc#885094
grub.xen is required to boot Xen PV VMs using BTRFS. It belongs to
the grub2-x86_64-xen RPM and should never be deleted.
Index: virt-manager-2.0.0/virtManager/delete.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/delete.py
+++ virt-manager-2.0.0/virtManager/delete.py
@@ -246,7 +246,7 @@ def populate_storage_list(storage_list,
     diskdata.append(("dtb", vm.get_xmlobj().os.dtb, True, False, True))
 
     for target, path, ro, shared, is_media in diskdata:
-        if not path:
+        if not path or path == "/usr/lib/grub2/x86_64-xen/grub.xen":
             continue
 
         # There are a few pieces here
++++++ virtman-dont-specify-gtksource-version.patch ++++++
--- virt-manager-2.2.0/virtManager/xmleditor.py.orig    2019-06-25 
12:21:53.267971599 -0600
+++ virt-manager-2.2.0/virtManager/xmleditor.py 2019-06-25 12:22:20.854908884 
-0600
@@ -7,12 +7,12 @@ import gi
 from virtinst import log
 
 # We can use either gtksourceview3 or gtksourceview4
-try:
-    gi.require_version("GtkSource", "4")
-    log.debug("Using GtkSource 4")
-except ValueError:
-    gi.require_version("GtkSource", "3.0")
-    log.debug("Using GtkSource 3.0")
+#try:
+#    gi.require_version("GtkSource", "4")
+#    log.debug("Using GtkSource 4")
+#except ValueError:
+#    gi.require_version("GtkSource", "3.0")
+#    log.debug("Using GtkSource 3.0")
 from gi.repository import GtkSource
 
 from .lib import uiutil
++++++ virtman-dont-specify-vte-version.patch ++++++
Creates a problem for gobject-introspection identifying what
version of vte is really allowed. Vte 2.91 is installed on the
host but the RPM is built requiring 2.90.

Index: virt-manager-2.2.0/virtManager/details/serialcon.py
===================================================================
--- virt-manager-2.2.0.orig/virtManager/details/serialcon.py
+++ virt-manager-2.2.0/virtManager/details/serialcon.py
@@ -12,12 +12,12 @@ from gi.repository import Gtk
 from virtinst import log
 
 # We can use either 2.91 or 2.90. This is just to silence runtime warnings
-try:
-    gi.require_version("Vte", "2.91")
-    log.debug("Using VTE API 2.91")
-except ValueError:
-    gi.require_version("Vte", "2.90")
-    log.debug("Using VTE API 2.90")
+#try:
+#    gi.require_version("Vte", "2.91")
+#    log.debug("Using VTE API 2.91")
+#except ValueError:
+#    gi.require_version("Vte", "2.90")
+#    log.debug("Using VTE API 2.90")
 from gi.repository import Vte
 
 import libvirt
++++++ virtman-fix-env-script-interpreter.patch ++++++
--- virt-manager-2.1.0/virt-clone.orig  2019-02-04 10:40:20.390102363 -0700
+++ virt-manager-2.1.0/virt-clone       2019-02-04 10:40:41.122360052 -0700
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
 #
 # Copyright(c) FUJITSU Limited 2007.
 #
--- virt-manager-2.1.0/virt-convert.orig        2019-02-04 10:41:50.275219728 
-0700
+++ virt-manager-2.1.0/virt-convert     2019-02-04 10:41:55.563285476 -0700
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
 #
 # Copyright 2008, 2013, 2014  Red Hat, Inc.
 #
--- virt-manager-2.1.0/virt-install.orig        2019-02-04 10:41:17.258809255 
-0700
+++ virt-manager-2.1.0/virt-install     2019-02-04 10:41:22.370872807 -0700
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
 #
 # Copyright 2005-2014 Red Hat, Inc.
 #
--- virt-manager-2.1.0/virt-manager.orig        2019-02-04 10:41:02.902630789 
-0700
+++ virt-manager-2.1.0/virt-manager     2019-02-04 10:41:11.870742273 -0700
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
 #
 # Copyright (C) 2006, 2014 Red Hat, Inc.
 # Copyright (C) 2006 Daniel P. Berrange <berra...@redhat.com>
--- virt-manager-2.1.0/virt-xml.orig    2019-02-04 10:41:32.923003992 -0700
+++ virt-manager-2.1.0/virt-xml 2019-02-04 10:41:38.803077096 -0700
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
 #
 # Copyright 2013-2014 Red Hat, Inc.
 #
++++++ virtman-fix-restore-vm-menu-selection.patch ++++++
References: bsc#1138110
virt-manager no longer tracks the saved state but leaves it up to libvirt.
Libvirt returns libvirt.VIR_DOMAIN_PMSUSPENDED after a vm has been 'saved'.


Index: virt-manager-2.2.0/virtManager/object/domain.py
===================================================================
--- virt-manager-2.2.0.orig/virtManager/object/domain.py
+++ virt-manager-2.2.0/virtManager/object/domain.py
@@ -1454,7 +1454,8 @@ class vmmDomain(vmmLibvirtObject):
         return (self.is_stoppable() or
                 self.status() in [libvirt.VIR_DOMAIN_CRASHED])
     def is_runable(self):
-        return self.is_shutoff()
+        return self.status() in [libvirt.VIR_DOMAIN_SHUTOFF,
+                                 libvirt.VIR_DOMAIN_PMSUSPENDED]
     def is_pauseable(self):
         return self.status() in [libvirt.VIR_DOMAIN_RUNNING]
     def is_unpauseable(self):
++++++ virtman-increase-setKeepAlive-count.patch ++++++
References: bnc#892003
For very large memory VMs Xen takes a long time scrubbing memory
which causes the libvirt connection to timeout. Upstream was not
interested in making this a preferences option (4/11/2015)
Index: virt-manager-2.2.1/virtManager/connection.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/connection.py
+++ virt-manager-2.2.1/virtManager/connection.py
@@ -995,7 +995,7 @@ class vmmConnection(vmmGObject):
         self._add_conn_events()
 
         try:
-            self._backend.setKeepAlive(20, 1)
+            self._backend.setKeepAlive(20, 10)
         except Exception as e:
             if (not isinstance(e, AttributeError) and
                 not self.support.is_error_nosupport(e)):
++++++ virtman-keycombo.patch ++++++
Enhancement adding Send Keys for mostly NetWare and also Windows
Index: virt-manager-2.1.0/virtManager/details/console.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/details/console.py
+++ virt-manager-2.1.0/virtManager/details/console.py
@@ -114,6 +114,16 @@ def build_keycombo_menu(on_send_key_fn):
     make_item("Ctrl+Alt+_Backspace", ["Control_L", "Alt_L", "BackSpace"])
     make_item("Ctrl+Alt+_Delete", ["Control_L", "Alt_L", "Delete"])
     menu.add(Gtk.SeparatorMenuItem())
+    make_item("Ctrl+Scroll+Scroll", ["Control_L", "Scroll" + "Scroll"])
+    make_item("Alt+F_10", ["Alt_L", "F10"])
+    make_item("Alt+Tab", ["Alt_L", "Tab"])
+    make_item("Alt+Escape", ["Alt_L", "Escape"])
+    make_item("Ctrl+Escape", ["Control_L", "Escape"])
+    make_item("Ctrl+Alt+Escape", ["Control_L", "Alt_L", "Escape"])
+    make_item("Alt+Shift+Shift+Escape", ["Alt_R", "Shift_R", "Shift_L", 
"Escape"])
+    make_item("F_8", ["F8"])
+    make_item("F_10", ["F10"])
+    menu.add(Gtk.SeparatorMenuItem())
 
     for i in range(1, 13):
         make_item("Ctrl+Alt+F_%d" % i, ["Control_L", "Alt_L", "F%d" % i])
++++++ virtman-kvm.patch ++++++
/usr/bin/kvm doesn't exist on suse distros so check instead for
/usr/bin/qemu-system-x86_64
Index: virt-manager-2.2.0/virtManager/createconn.py
===================================================================
--- virt-manager-2.2.0.orig/virtManager/createconn.py
+++ virt-manager-2.2.0/virtManager/createconn.py
@@ -67,7 +67,7 @@ class vmmCreateConn(vmmGObjectUI):
 
         if (os.path.exists("/usr/bin/qemu") or
             os.path.exists("/usr/bin/qemu-kvm") or
-            os.path.exists("/usr/bin/kvm") or
+            os.path.exists("/usr/bin/qemu-system-x86_64") or
             os.path.exists("/usr/libexec/qemu-kvm") or
             glob.glob("/usr/bin/qemu-system-*")):
             return "qemu:///system"
++++++ virtman-load-stored-uris.patch ++++++
If booted Xen, don't try connecting to local qemu
Likewise if booted native, don't try connecting to local xen

Index: virt-manager-2.2.0/virtManager/connmanager.py
===================================================================
--- virt-manager-2.2.0.orig/virtManager/connmanager.py
+++ virt-manager-2.2.0/virtManager/connmanager.py
@@ -26,11 +26,17 @@ class vmmConnectionManager(vmmGObject):
 
     def __init__(self):
         vmmGObject.__init__(self)
+        from .createconn import vmmCreateConn
+        default_uri = vmmCreateConn.default_uri()
 
         self._conns = {}
 
         # Load URIs from gsettings
         for uri in self.config.get_conn_uris():
+            if uri == 'xen:///' or uri == 'qemu:///system':
+                if default_uri and default_uri != uri:
+                    log.debug("Skipping local connection %s because it is 
incompatible with the host", uri)
+                    continue
             self.add_conn(uri)
 
     def _cleanup(self):
++++++ virtman-python2-to-python3-conversion.patch ++++++
Index: virt-manager-2.2.1/virt-manager
===================================================================
--- virt-manager-2.2.1.orig/virt-manager
+++ virt-manager-2.2.1/virt-manager
@@ -66,7 +66,7 @@ def _import_gtk(leftovers):
             print("gtk3 3.22.0 or later is required.")
             sys.exit(1)
 
-        if os.environ.has_key('DISPLAY') and os.environ['DISPLAY']:
+        if 'DISPLAY' in os.environ and os.environ['DISPLAY']:
             # This will error if Gtk wasn't correctly initialized
             Gtk.Window()
         else:
Index: virt-manager-2.2.1/virtManager/details/console.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/details/console.py
+++ virt-manager-2.2.1/virtManager/details/console.py
@@ -21,7 +21,7 @@ from ..vmwindow import DETAILS_PAGE_CONS
 (_CONSOLE_PAGE_UNAVAILABLE,
  _CONSOLE_PAGE_AUTHENTICATE,
  _CONSOLE_PAGE_SERIAL,
- _CONSOLE_PAGE_VIEWER) = range(4)
+ _CONSOLE_PAGE_VIEWER) = list(range(4))
 
 
 class _TimedRevealer(vmmGObject):
Index: virt-manager-2.2.1/virtManager/connection.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/connection.py
+++ virt-manager-2.2.1/virtManager/connection.py
@@ -159,7 +159,7 @@ class vmmConnection(vmmGObject):
 
     (_STATE_DISCONNECTED,
      _STATE_CONNECTING,
-     _STATE_ACTIVE) = range(1, 4)
+     _STATE_ACTIVE) = list(range(1, 4))
 
     def __init__(self, uri):
         self._uri = uri
Index: virt-manager-2.2.1/virtManager/addhardware.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/addhardware.py
+++ virt-manager-2.2.1/virtManager/addhardware.py
@@ -44,7 +44,7 @@ from .xmleditor import vmmXMLEditor
  PAGE_TPM,
  PAGE_RNG,
  PAGE_PANIC,
- PAGE_VSOCK) = range(17)
+ PAGE_VSOCK) = list(range(17))
 
 
 def _build_combo(combo, values, default_value=None, sort=True):
Index: virt-manager-2.2.1/virtManager/details/snapshots.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/details/snapshots.py
+++ virt-manager-2.2.1/virtManager/details/snapshots.py
@@ -55,7 +55,7 @@ def _make_screenshot_pixbuf(mime, sdata)
 
 
 def _mime_to_ext(val, reverse=False):
-    for m, e in mimemap.items():
+    for m, e in list(mimemap.items()):
         if val == m and not reverse:
             return e
         if val == e and reverse:
Index: virt-manager-2.2.1/virtManager/engine.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/engine.py
+++ virt-manager-2.2.1/virtManager/engine.py
@@ -22,7 +22,7 @@ from .lib.inspection import vmmInspectio
 from .systray import vmmSystray
 
 (PRIO_HIGH,
- PRIO_LOW) = range(1, 3)
+ PRIO_LOW) = list(range(1, 3))
 
 
 def _show_startup_error(fn):
Index: virt-manager-2.2.1/virtManager/device/mediacombo.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/device/mediacombo.py
+++ virt-manager-2.2.1/virtManager/device/mediacombo.py
@@ -22,7 +22,7 @@ class vmmMediaCombo(vmmGObjectUI):
     (MEDIA_FIELD_PATH,
     MEDIA_FIELD_LABEL,
     MEDIA_FIELD_HAS_MEDIA,
-    MEDIA_FIELD_KEY) = range(MEDIA_FIELDS_NUM)
+    MEDIA_FIELD_KEY) = list(range(MEDIA_FIELDS_NUM))
 
     def __init__(self, conn, builder, topwin):
         vmmGObjectUI.__init__(self, None, None, builder=builder, topwin=topwin)
Index: virt-manager-2.2.1/virtManager/manager.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/manager.py
+++ virt-manager-2.2.1/virtManager/manager.py
@@ -33,7 +33,7 @@ ROW_IS_CONN_CONNECTED,
 ROW_IS_VM,
 ROW_IS_VM_RUNNING,
 ROW_COLOR,
-ROW_INSPECTION_OS_ICON) = range(11)
+ROW_INSPECTION_OS_ICON) = list(range(11))
 
 # Columns in the tree view
 (COL_NAME,
@@ -41,7 +41,7 @@ COL_GUEST_CPU,
 COL_HOST_CPU,
 COL_MEM,
 COL_DISK,
-COL_NETWORK) = range(6)
+COL_NETWORK) = list(range(6))
 
 
 def _style_get_prop(widget, propname):
Index: virt-manager-2.2.1/virtManager/device/addstorage.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/device/addstorage.py
+++ virt-manager-2.2.1/virtManager/device/addstorage.py
@@ -108,7 +108,7 @@ class vmmAddStorage(vmmGObjectUI):
         errmsg = _("Errors were encountered changing permissions for the "
                    "following directories:")
         details = ""
-        for p, error in errors.items():
+        for p, error in list(errors.items()):
             if p not in broken_paths:
                 continue
             details += "%s : %s\n" % (p, error)
Index: virt-manager-2.2.1/virtManager/details/details.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/details/details.py
+++ virt-manager-2.2.1/virtManager/details/details.py
@@ -104,7 +104,7 @@ from ..xmleditor import vmmXMLEditor
 
  EDIT_FS,
 
- EDIT_HOSTDEV_ROMBAR) = range(1, 59)
+ EDIT_HOSTDEV_ROMBAR) = list(range(1, 59))
 
 
 # Columns in hw list model
@@ -112,7 +112,7 @@ from ..xmleditor import vmmXMLEditor
  HW_LIST_COL_ICON_NAME,
  HW_LIST_COL_TYPE,
  HW_LIST_COL_DEVICE,
- HW_LIST_COL_KEY) = range(5)
+ HW_LIST_COL_KEY) = list(range(5))
 
 # Types for the hw list model: numbers specify what order they will be listed
 (HW_LIST_TYPE_GENERAL,
@@ -137,7 +137,7 @@ from ..xmleditor import vmmXMLEditor
  HW_LIST_TYPE_TPM,
  HW_LIST_TYPE_RNG,
  HW_LIST_TYPE_PANIC,
- HW_LIST_TYPE_VSOCK) = range(23)
+ HW_LIST_TYPE_VSOCK) = list(range(23))
 
 remove_pages = [HW_LIST_TYPE_NIC, HW_LIST_TYPE_INPUT,
                 HW_LIST_TYPE_GRAPHICS, HW_LIST_TYPE_SOUND, HW_LIST_TYPE_CHAR,
@@ -152,7 +152,7 @@ remove_pages = [HW_LIST_TYPE_NIC, HW_LIS
  BOOT_LABEL,
  BOOT_ICON,
  BOOT_ACTIVE,
- BOOT_CAN_SELECT) = range(5)
+ BOOT_CAN_SELECT) = list(range(5))
 
 
 def _calculate_disk_bus_index(disklist):
Index: virt-manager-2.2.1/virtManager/createvm.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/createvm.py
+++ virt-manager-2.2.1/virtManager/createvm.py
@@ -40,7 +40,7 @@ DEFAULT_MEM = 1024
  PAGE_INSTALL,
  PAGE_MEM,
  PAGE_STORAGE,
- PAGE_FINISH) = range(5)
+ PAGE_FINISH) = list(range(5))
 
 (INSTALL_PAGE_ISO,
  INSTALL_PAGE_URL,
@@ -48,13 +48,13 @@ DEFAULT_MEM = 1024
  INSTALL_PAGE_IMPORT,
  INSTALL_PAGE_CONTAINER_APP,
  INSTALL_PAGE_CONTAINER_OS,
- INSTALL_PAGE_VZ_TEMPLATE) = range(7)
+ INSTALL_PAGE_VZ_TEMPLATE) = list(range(7))
 
 # Column numbers for os type/version list models
 (OS_COL_ID,
  OS_COL_LABEL,
  OS_COL_IS_SEP,
- OS_COL_IS_SHOW_ALL) = range(4)
+ OS_COL_IS_SHOW_ALL) = list(range(4))
 
 
 #####################
@@ -2123,7 +2123,7 @@ class vmmCreateVM(vmmGObjectUI):
                 'insecure': self._get_config_oscontainer_isecure,
                 'root_password': self._get_config_oscontainer_root_password,
             }
-            for key, getter in bootstrap_arg_keys.items():
+            for key, getter in list(bootstrap_arg_keys.items()):
                 bootstrap_args[key] = getter()
 
         parentobj = self._customize_window or self
Index: virt-manager-2.2.1/virtManager/preferences.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/preferences.py
+++ virt-manager-2.2.1/virtManager/preferences.py
@@ -129,7 +129,7 @@ class vmmPreferences(vmmGObjectUI):
         }
         model.append([-1, _("System default (%s)") %
             vals[self.config.default_console_resizeguest]])
-        for key, val in vals.items():
+        for key, val in list(vals.items()):
             model.append([key, val])
         combo.set_model(model)
         uiutil.init_combo_text_column(combo, 1)
Index: virt-manager-2.2.1/virtManager/migrate.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/migrate.py
+++ virt-manager-2.2.1/virtManager/migrate.py
@@ -23,7 +23,7 @@ from .object.domain import vmmDomain
 NUM_COLS = 3
 (COL_LABEL,
  COL_URI,
- COL_CAN_MIGRATE) = range(NUM_COLS)
+ COL_CAN_MIGRATE) = list(range(NUM_COLS))
 
 
 class vmmMigrateDialog(vmmGObjectUI):
Index: virt-manager-2.2.1/virtManager/hoststorage.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/hoststorage.py
+++ virt-manager-2.2.1/virtManager/hoststorage.py
@@ -32,13 +32,13 @@ VOL_NUM_COLUMNS = 7
  VOL_COLUMN_SIZESTR,
  VOL_COLUMN_FORMAT,
  VOL_COLUMN_INUSEBY,
- VOL_COLUMN_SENSITIVE) = range(VOL_NUM_COLUMNS)
+ VOL_COLUMN_SENSITIVE) = list(range(VOL_NUM_COLUMNS))
 
 POOL_NUM_COLUMNS = 4
 (POOL_COLUMN_CONNKEY,
  POOL_COLUMN_LABEL,
  POOL_COLUMN_ISACTIVE,
- POOL_COLUMN_PERCENT) = range(POOL_NUM_COLUMNS)
+ POOL_COLUMN_PERCENT) = list(range(POOL_NUM_COLUMNS))
 
 ICON_RUNNING = "state_running"
 ICON_SHUTOFF = "state_shutoff"
++++++ virtman-register-delete-event-for-details-dialog.patch ++++++
References: bsc#1071825
Running under python3 the delete-event as defined in details.ui and connected
in details.py does not get called when the top right (x) button on the dialog
is clicked. It appears that even though this code is unchanged and works on 
python2,
it is not recognized as a top level dialog on python3 and therefore we 
explicitly
need to set the connection event. Not getting the event to cleanup leaves us in 
a
bad state for when the details dialog is reopened.

Index: virt-manager-2.2.0/virtManager/vmwindow.py
===================================================================
--- virt-manager-2.2.0.orig/virtManager/vmwindow.py
+++ virt-manager-2.2.0/virtManager/vmwindow.py
@@ -141,6 +141,9 @@ class vmmVMWindow(vmmGObjectUI):
                 self.console.details_auth_login),
         })
 
+        # Make sure the delete event is properly registered for the details 
dialog
+        self.topwin.connect("delete-event", self._window_delete_event)
+
         # Deliberately keep all this after signal connection
         self.vm.connect("state-changed", self.refresh_vm_state)
         self.vm.connect("resources-sampled", self.refresh_resources)
++++++ virtman-show-suse-install-repos.patch ++++++
Enhancement that gets installation repos from zypper.
These locations are then presented as potential installation
sources when creating a VM.
Index: virt-manager-2.2.1/virtManager/createvm.py
===================================================================
--- virt-manager-2.2.1.orig/virtManager/createvm.py
+++ virt-manager-2.2.1/virtManager/createvm.py
@@ -99,6 +99,70 @@ def is_virt_bootstrap_installed():
     return pkgutil.find_loader('virtBootstrap') is not None
 
 
+################################################
+# Helpers for using SUSE installation location #
+################################################
+
+import subprocess
+from subprocess import Popen, PIPE
+
+_host_repo_url = None
+
+def getHostInstallSource():
+    global _host_repo_url
+    if _host_repo_url is not None:
+        return _host_repo_url
+    if os.geteuid() != 0:
+        return None
+
+    (_,zypper_output) = lookupZypperRepos()
+    if len(zypper_output):
+        _host_repo_url = zypper_output[0]
+        return _host_repo_url
+    return None
+
+def lookupZypperRepos(dom0_inst_source=None):
+    try:
+        env = os.environ.copy()
+        env['LC_ALL'] = 'C'
+        cmd = ['/usr/bin/zypper', 'lr', '-u', '-P', '-E']
+        p = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE, env=env)
+        stdout, stderr = p.communicate()
+        zypper_output = stdout.decode()
+        zypper_list = zypper_output.split("\n")
+        zypper_header = [x.strip(' ') for x in zypper_list[0].split("|")]
+        uri_index = zypper_header.index("URI")
+    except:
+        inst_source = []
+        if dom0_inst_source:
+            inst_source = [dom0_inst_source]
+        return (0, inst_source)
+
+    index_dom0 = -1
+    number_of_sources = 0
+    zypper_output = []
+    for repo in zypper_list:
+        repo = [x.strip(' ') for x in repo.split("|")]
+        if len(repo) >= uri_index:
+            str = repo[uri_index]
+            if str.startswith('ftp://') or str.startswith('http://') or 
str.startswith('nfs://') or str.startswith('smb://'):
+                if str not in zypper_output:
+                    zypper_output.append(str)
+                    if dom0_inst_source is not None and str == 
dom0_inst_source:
+                        index_dom0 = number_of_sources
+                    number_of_sources += 1
+
+    if index_dom0 == -1 and dom0_inst_source:
+        index_dom0 = 0
+        zypper_output.insert(0, dom0_inst_source)
+    return (index_dom0, zypper_output)
+
+def getInstallRepos():
+    if os.geteuid() != 0:
+        return (0, [])
+    return lookupZypperRepos(getHostInstallSource())
+
+
 ##############
 # Main class #
 ##############
@@ -368,7 +432,13 @@ class vmmCreateVM(vmmGObjectUI):
         self.widget("install-url-entry").set_text("")
         self.widget("install-url-options").set_expanded(False)
         urlmodel = self.widget("install-url-combo").get_model()
-        _populate_media_model(urlmodel, self.config.get_media_urls())
+        urllist = self.config.get_media_urls()
+        (index, inst_repos) = getInstallRepos()
+        for u in urllist:
+            if u in inst_repos:
+                inst_repos.remove(u)
+        media_urllist = urllist + inst_repos
+        _populate_media_model(urlmodel, media_urllist)
 
         # Install import
         self.widget("install-import-entry").set_text("")
++++++ virttests-python2-to-python3-conversion.patch ++++++
Index: virt-manager-2.2.0/tests/clitest.py
===================================================================
--- virt-manager-2.2.0.orig/tests/clitest.py
+++ virt-manager-2.2.0/tests/clitest.py
@@ -300,7 +300,7 @@ class Command(object):
 
     def _run(self):
         conn = None
-        for idx in reversed(range(len(self.argv))):
+        for idx in reversed(list(range(len(self.argv)))):
             if self.argv[idx] == "--connect":
                 conn = utils.URIs.openconn(self.argv[idx + 1])
                 break
Index: virt-manager-2.2.0/tests/test_inject.py
===================================================================
--- virt-manager-2.2.0.orig/tests/test_inject.py
+++ virt-manager-2.2.0/tests/test_inject.py
@@ -15,7 +15,7 @@ FEDORA_URL = "http://dl.fedoraproject.or
 
 (WARN_RHEL5,
  WARN_DEBIAN,
- WARN_FEDORA) = range(1, 4)
+ WARN_FEDORA) = list(range(1, 4))
 
 
 def prompt():
@@ -117,7 +117,7 @@ def _make_tests():
         return lambda s: _test_distro(_d)
 
     idx = 0
-    for dname, dobj in _alldistros.items():
+    for dname, dobj in list(_alldistros.items()):
         idx += 1
         setattr(InjectTests, "testInitrd%.3d_%s" %
                 (idx, dname.replace("-", "_")), _make_check_cb(dobj))

Reply via email to