- Update to virt-manager 1.5.0 (bsc#1027942)

virt-manager-1.5.0.tar.bz2
  * python3 prep work (Radostin Stoyanov, Cole Robinson, Cédric Bosdonnat)
  * Switch –location ISO to use isoinfo (Andrew Wong)
  * virt-install: add –cpu numa distance handling (Menno Lageman)
  * virt-install: fix –disk for rbd volumes with auth (Rauno Väli)
  * virt-install: add –cputune vcpupin handling (Wim ten Have)
  * details ui: Showing attached scsi devices per controller (Lin Ma)
  * network ui: Show details about SR-IOV VF pool (Lin Ma)
  * Greatly expand UI test suite coverage
- Dropped patches
  0001-Improve-container-image-url-example.patch
  0001-py3-store-exception-variables-for-use-outside-except.patch
  0002-create-wizard-fix-alignment-in-os-container-page.patch
  0003-oscontainer-ask-root-password-in-the-wizard.patch
  0004-Harmonize-invisible_char-values.patch
  083dfcc8-Show-details-about-the-network-of-SR-IOV-VF-pool.patch
  08a58d61-pycodestyle-remove-description-of-fixed-errors.patch
  0c6bcb09-fix-bytes-string-mess-in-serial-console.patch
  0e812e3c-dont-skip-authentication-for-listen-type-none-with-fixed-QEMU.patch
  23aaf852-network-Set-bridge-name-to-None-instead-of-blank.patch
  2d276ebe-progress-dont-overwrite-format.patch
  2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch
  374a3779-urlfetcher-write-test-file-as-binary-content.patch
  37ea5207-replace-StandardError-with-Exception.patch
  3b769643-dont-add-URI-into-params-for-tunneled-migration.patch
  3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch
  44de92b7-use-reload-from-imp-module.patch
  63fce081-pycodestyle-Use-isinstance-for-type-checking.patch
  67122615-python2to3-division-compatability.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=406
This commit is contained in:
Charles Arnold 2018-02-07 16:59:50 +00:00 committed by Git OBS Bridge
parent a962c4a1c4
commit c085d819a8
74 changed files with 402 additions and 4249 deletions

View File

@ -1,28 +0,0 @@
From b567947b82bb175c3f6234a3b059a2141c70a805 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cedric.bosdonnat@free.fr>
Date: Tue, 12 Dec 2017 17:12:34 +0100
Subject: [PATCH 1/3] Improve container image url example
Replace the docker://fedora example by a string that shows more of the
possible values, like how to specify a user or server. While at it,
the image name is no distro agnostic.
---
ui/create.ui | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/create.ui b/ui/create.ui
index dd50cdf0..142a7356 100644
--- a/ui/create.ui
+++ b/ui/create.ui
@@ -1776,7 +1776,7 @@ connections is not yet supported.&lt;/small&gt;</property>
<child internal-child="entry">
<object class="GtkEntry" id="install-oscontainer-source-url-entry">
<property name="can_focus">True</property>
- <property name="placeholder_text" translatable="yes">docker://fedora</property>
+ <property name="placeholder_text" translatable="yes">docker://srv:1234/myimg:tag</property>
</object>
</child>
</object>
--
2.15.1

View File

@ -1,30 +0,0 @@
From d4b7853b17bd24e0d15a6887b877a627da361589 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
Date: Wed, 20 Dec 2017 09:38:18 +0100
Subject: [virt-manager][PATCH] py3: store exception variables for use outside
except
In python3 exceptions aren't defined outside the except block. Leading
to 'UnboundLocalError: local variable 'e' referenced before assignment'
errors.
To work around this, store the local variable into one that will have a
longer life.
---
virtManager/connection.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: virt-manager-1.4.3/virtManager/connection.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/connection.py
+++ virt-manager-1.4.3/virtManager/connection.py
@@ -1441,7 +1441,8 @@ class vmmConnection(vmmGObject):
self._tick(*args, **kwargs)
except KeyboardInterrupt:
raise
- except Exception as e:
+ except Exception as err:
+ e = err
pass
if e is None:

View File

@ -1,442 +0,0 @@
From 1e5437158dc83069d84cb27503414306a25d7264 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
Date: Wed, 13 Dec 2017 15:49:50 +0100
Subject: [PATCH 2/3] create wizard: fix alignment in os container page
The checkbox to create the root FS should be aligned with the label of
the root FS folder.
---
ui/create.ui | 317 +++++++++++++++++++++++++++++++----------------------------
1 file changed, 166 insertions(+), 151 deletions(-)
diff --git a/ui/create.ui b/ui/create.ui
index 142a7356..ae9d47d3 100644
--- a/ui/create.ui
+++ b/ui/create.ui
@@ -1600,11 +1600,13 @@ User shouldn't see this.</property>
<object class="GtkAlignment" id="alignment27">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="valign">start</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="vbox21">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="valign">start</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
@@ -1651,107 +1653,180 @@ User shouldn't see this.</property>
<property name="position">0</property>
</packing>
</child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="install-oscontainer">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkBox" id="install-oscontainer-notsupport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkBox" id="install-oscontainer-notsupport">
+ <object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkImage" id="image3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-dialog-warning</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label46">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">&lt;small&gt;The OS directory tree must already exist. To enable OS directory tree creation,
+ <property name="stock">gtk-dialog-warning</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label46">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">&lt;small&gt;The OS directory tree must already exist. To enable OS directory tree creation,
please install &lt;a href="https://github.com/virt-manager/virt-bootstrap"&gt;virt-bootrap&lt;/a&gt;&lt;/small&gt;</property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="install-oscontainer-notsupport-conn">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkImage" id="image8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-dialog-warning</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">&lt;small&gt;The OS directory tree must already exist. Creating an OS directory tree for remote
+connections is not yet supported.&lt;/small&gt;</property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="install-oscontainer-bootstrap">
+ <property name="label" translatable="yes">Create OS directory tree from container image</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_install_container_source_toggle" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="install-oscontainer-source">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">10</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
- <object class="GtkBox" id="install-oscontainer-notsupport-conn">
+ <object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
<child>
- <object class="GtkImage" id="image8">
+ <object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-dialog-warning</property>
+ <property name="label" translatable="yes">Source URI:</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkComboBox" id="install-oscontainer-source-url-combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">&lt;small&gt;The OS directory tree must already exist. Creating an OS directory tree for remote
-connections is not yet supported.&lt;/small&gt;</property>
- <property name="use_markup">True</property>
+ <property name="hexpand">True</property>
+ <property name="has_entry">True</property>
+ <child internal-child="entry">
+ <object class="GtkEntry" id="install-oscontainer-source-url-entry">
+ <property name="can_focus">True</property>
+ <property name="placeholder_text" translatable="yes">docker://srv:1234/myimg:tag</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="install-oscontainer-bootstrap">
- <property name="label" translatable="yes">Create OS directory tree from container image</property>
+ <object class="GtkCheckButton" id="install-oscontainer-source-insecure">
+ <property name="label" translatable="yes">Do not verify TLS certificates of registry</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_install_container_source_toggle" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkBox" id="install-oscontainer-source">
+ <object class="GtkExpander" id="install-oscontainer-auth-options">
<property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">False</property>
- <property name="border_width">10</property>
- <property name="orientation">vertical</property>
- <property name="spacing">10</property>
+ <property name="can_focus">True</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
@@ -1760,7 +1835,8 @@ connections is not yet supported.&lt;/small&gt;</property>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Source URI:</property>
+ <property name="margin_right">10</property>
+ <property name="label" translatable="yes">Username:</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -1768,129 +1844,68 @@ connections is not yet supported.&lt;/small&gt;</property>
</packing>
</child>
<child>
- <object class="GtkComboBox" id="install-oscontainer-source-url-combo">
+ <object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="has_entry">True</property>
- <child internal-child="entry">
- <object class="GtkEntry" id="install-oscontainer-source-url-entry">
- <property name="can_focus">True</property>
- <property name="placeholder_text" translatable="yes">docker://srv:1234/myimg:tag</property>
- </object>
- </child>
+ <property name="margin_right">10</property>
+ <property name="label" translatable="yes">Password:</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="install-oscontainer-source-insecure">
- <property name="label" translatable="yes">Do not verify TLS certificates of registry</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkExpander" id="install-oscontainer-auth-options">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
<child>
- <object class="GtkGrid">
+ <object class="GtkEntry" id="install-oscontainer-source-user">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_right">10</property>
- <property name="label" translatable="yes">Username:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_right">10</property>
- <property name="label" translatable="yes">Password:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="install-oscontainer-source-user">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="install-oscontainer-source-passwd">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="invisible_char">*</property>
- <property name="input_purpose">password</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
</child>
- <child type="label">
- <object class="GtkLabel">
+ <child>
+ <object class="GtkEntry" id="install-oscontainer-source-passwd">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Credentials for accessing the source registry</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">*</property>
+ <property name="input_purpose">password</property>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Credentials for accessing the source registry</property>
+ </object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
--
2.15.1

View File

@ -1,120 +0,0 @@
From 7fb94b1bec19cb01243b6f50483a7ae4ba5b4b76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
Date: Thu, 14 Dec 2017 08:49:53 +0100
Subject: [PATCH 3/3] oscontainer: ask root password in the wizard
When creating a new root file system out of an downloaded image,
the root password is likely to be changed. Add a field for this
in the new guest wizard.
---
ui/create.ui | 36 ++++++++++++++++++++++++++++++++++++
virtManager/create.py | 14 ++++++++++++--
2 files changed, 48 insertions(+), 2 deletions(-)
Index: virt-manager-1.4.3/ui/create.ui
===================================================================
--- virt-manager-1.4.3.orig/ui/create.ui
+++ virt-manager-1.4.3/ui/create.ui
@@ -1901,6 +1901,42 @@ connections is not yet supported.&lt;/sm
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkBox" id="install-oscontainer-rootpw-box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Root password:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="install-oscontainer-rootpw">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">True</property>
Index: virt-manager-1.4.3/virtManager/create.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/create.py
+++ virt-manager-1.4.3/virtManager/create.py
@@ -465,6 +465,7 @@ class vmmCreate(vmmGObjectUI):
self.widget("install-oscontainer-source-insecure").set_active(False)
self.widget("install-oscontainer-bootstrap").set_active(False)
self.widget("install-oscontainer-auth-options").set_expanded(False)
+ self.widget("install-oscontainer-rootpw").set_text("")
src_model = (self.widget("install-oscontainer-source-url-combo")
.get_model())
_populate_media_model(src_model, self.config.get_container_urls())
@@ -701,7 +702,8 @@ class vmmCreate(vmmGObjectUI):
"install-oscontainer-notsupport-conn": not is_local,
"install-oscontainer-notsupport": not vb_installed,
"install-oscontainer-bootstrap": vb_enabled,
- "install-oscontainer-source": vb_enabled
+ "install-oscontainer-source": vb_enabled,
+ "install-oscontainer-rootpw-box": vb_enabled
}
for w in oscontainer_widget_conf:
self.widget(w).set_visible(oscontainer_widget_conf[w])
@@ -1329,6 +1331,10 @@ class vmmCreate(vmmGObjectUI):
return self.widget("install-oscontainer-source-insecure").get_active()
+ def _get_config_oscontainer_root_password(self):
+ return self.widget("install-oscontainer-rootpw").get_text()
+
+
def _should_skip_disk_page(self):
return self._get_config_install_page() in [INSTALL_PAGE_IMPORT,
INSTALL_PAGE_CONTAINER_APP,
@@ -1732,6 +1738,7 @@ class vmmCreate(vmmGObjectUI):
def _container_source_toggle(self, ignore):
enable_src = self.widget("install-oscontainer-bootstrap").get_active()
self.widget("install-oscontainer-source").set_sensitive(enable_src)
+ self.widget("install-oscontainer-rootpw-box").set_sensitive(enable_src)
# Auto-generate a path if not specified
if enable_src and not self.widget("install-oscontainer-fs").get_text():
@@ -2577,7 +2584,8 @@ class vmmCreate(vmmGObjectUI):
'dest': self.widget("install-oscontainer-fs").get_text,
'user': self._get_config_oscontainer_source_username,
'passwd': self._get_config_oscontainer_source_password,
- 'insecure': self._get_config_oscontainer_isecure
+ 'insecure': self._get_config_oscontainer_isecure,
+ 'root_password': self._get_config_oscontainer_root_password,
}
for key, getter in list(bootstrap_arg_keys.items()):
bootstrap_args[key] = getter()
@@ -2733,6 +2741,8 @@ class vmmCreate(vmmGObjectUI):
if bootstrap_args['user'] and bootstrap_args['passwd']:
kwargs['username'] = bootstrap_args['user']
kwargs['password'] = bootstrap_args['passwd']
+ if bootstrap_args['root_password']:
+ kwargs['root_password'] = bootstrap_args['root_password']
logging.debug('Start container bootstrap')
try:
virtBootstrap.bootstrap(**kwargs)

View File

@ -1,73 +0,0 @@
From 697b86a84a2bfd267a30c765b19ba550a55d85c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
Date: Thu, 14 Dec 2017 09:02:30 +0100
Subject: [PATCH] Harmonize invisible_char values
To be consistent across the UI, change the few remaining different
invisible_char values to match the most common one.
---
ui/addhardware.ui | 2 +-
ui/create.ui | 4 ++--
ui/migrate.ui | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/ui/addhardware.ui b/ui/addhardware.ui
index eb476dab..44b23068 100644
--- a/ui/addhardware.ui
+++ b/ui/addhardware.ui
@@ -1290,7 +1290,7 @@
<object class="GtkEntry" id="usbredir-host">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">•</property>
+ <property name="invisible_char">●</property>
</object>
<packing>
<property name="expand">True</property>
diff --git a/ui/create.ui b/ui/create.ui
index ea92756d..1749ff35 100644
--- a/ui/create.ui
+++ b/ui/create.ui
@@ -1039,7 +1039,7 @@ bar</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
- <property name="invisible_char">•</property>
+ <property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -1870,7 +1870,7 @@ connections is not yet supported.&lt;/small&gt;</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
- <property name="invisible_char">*</property>
+ <property name="invisible_char">●</property>
<property name="input_purpose">password</property>
</object>
<packing>
diff --git a/ui/migrate.ui b/ui/migrate.ui
index 943ecb9e..4a98d509 100644
--- a/ui/migrate.ui
+++ b/ui/migrate.ui
@@ -266,7 +266,7 @@
<object class="GtkSpinButton" id="migrate-port">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">•</property>
+ <property name="invisible_char">●</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">adjustment1</property>
</object>
@@ -303,7 +303,7 @@
<object class="GtkEntry" id="migrate-address">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">•</property>
+ <property name="invisible_char">●</property>
</object>
<packing>
<property name="expand">False</property>
--
2.15.1

View File

@ -1,226 +0,0 @@
Subject: host: Show details about the network of SR-IOV VF pool
From: Lin Ma lma@suse.com Fri Sep 22 19:39:10 2017 +0800
Date: Mon Oct 9 10:22:48 2017 +0200:
Git: 083dfcc8ec9e684052c999b79bb3508a5e9d3c03
Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/ui/host.ui b/ui/host.ui
index 2e5ea496..f5ea3905 100644
--- a/ui/host.ui
+++ b/ui/host.ui
@@ -1117,6 +1117,108 @@
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkExpander" id="net-sriov-expander">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkBox" id="net-sriov-box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkGrid" id="pf-table">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">5</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="pf-name">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label">label</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="pf-name-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Physical Function:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="vf-scroll-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Virtual Functions:</property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="vf-scroll">
+ <property name="height_request">144</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="vf-list">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="vf-selection"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="net-sriov-expander-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">&lt;b&gt;_SR-IOV information&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/virtManager/host.py b/virtManager/host.py
index 84e8865c..560bc0a6 100644
--- a/virtManager/host.py
+++ b/virtManager/host.py
@@ -24,6 +24,7 @@ from gi.repository import GObject
from gi.repository import Gtk
from virtinst import Interface
+from virtinst import NodeDevice
from virtinst import util
from . import uiutil
@@ -167,6 +168,20 @@ class vmmHost(vmmGObjectUI):
self.widget("net-list").append_column(netCol)
netListModel.set_sort_column_id(1, Gtk.SortType.ASCENDING)
+ # Virtual Function list
+ # [vf-name]
+ vf_list = self.widget("vf-list")
+ vf_list_model = Gtk.ListStore(str)
+ vf_list.set_model(vf_list_model)
+ vf_list.set_headers_visible(False)
+
+ vfTextCol = Gtk.TreeViewColumn()
+ vf_txt = Gtk.CellRendererText()
+ vfTextCol.pack_start(vf_txt, True)
+ vfTextCol.add_attribute(vf_txt, 'text', 0)
+ vf_list.append_column(vfTextCol)
+
+
def init_storage_state(self):
self.storagelist = vmmStorageList(self.conn, self.builder, self.topwin)
self.widget("storage-align").add(self.storagelist.top_box)
@@ -398,6 +413,7 @@ class vmmHost(vmmGObjectUI):
return
logging.debug("Stopping network '%s'", net.get_name())
+ self.widget("vf-list").get_model().clear()
vmmAsyncJob.simple_async_noshow(net.stop, [], self,
_("Error stopping network '%s'") % net.get_name())
@@ -613,6 +629,35 @@ class vmmHost(vmmGObjectUI):
self.widget("qos-outbound-peak").set_text(qos.outbound_peak or "")
self.widget("qos-outbound-burst").set_text(qos.outbound_burst or "")
+ def _populate_sriov_state(self, net):
+ (is_vf_pool, pf_name, vfs) = net.get_sriov_vf_networks()
+
+ self.widget("net-sriov-expander").set_visible(is_vf_pool)
+ if not pf_name:
+ self.widget("pf-name").set_text("N/A")
+ return
+
+ self.widget("pf-name").set_text(pf_name)
+
+ vf_list_model = self.widget("vf-list").get_model()
+ vf_list_model.clear()
+ for vf in vfs:
+ addrStr = "%x:%x:%x.%x" % (vf.domain, vf.bus, vf.slot, vf.function)
+ pcidev = NodeDevice.lookupNodedevFromString(self.conn.get_backend(),
+ addrStr)
+
+ vf_name = None
+
+ netdevs = self.conn.filter_nodedevs("net")
+ for netdev in netdevs:
+ logging.debug(netdev.xmlobj.parent)
+ if pcidev.name == netdev.xmlobj.parent:
+ vf_name = netdev.xmlobj.interface
+ break
+
+ vf_list_model.append([vf_name or addrStr])
+
+
def populate_net_state(self, net):
active = net.is_active()
@@ -642,6 +687,7 @@ class vmmHost(vmmGObjectUI):
self._populate_net_ipv4_state(net)
self._populate_net_ipv6_state(net)
self._populate_qos_state(net)
+ self._populate_sriov_state(net)
def reset_net_state(self):
diff --git a/virtManager/network.py b/virtManager/network.py
index cb260497..4c937e0e 100644
--- a/virtManager/network.py
+++ b/virtManager/network.py
@@ -182,3 +182,15 @@ class vmmNetwork(vmmLibvirtObject):
def get_ipv6_network(self):
ret = self._get_network("ipv6")
return ret + [self._get_static_route("ipv6")]
+
+ def get_sriov_vf_networks(self):
+ xmlobj = self.get_xmlobj()
+ pf_name = None
+ vfs = None
+ ret = False
+ if xmlobj.forward.mode == "hostdev":
+ ret = True
+ if xmlobj.forward.pf:
+ pf_name = xmlobj.forward.pf[0].dev
+ vfs = xmlobj.forward.vfs
+ return (ret, pf_name, vfs)

View File

@ -1,26 +0,0 @@
Subject: pycodestyle: Remove description of fixed errors
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:42 2017 +0100
Date: Fri Oct 20 11:49:14 2017 -0400:
Git: 08a58d61450def03e840afe66c63998fc75211be
diff --git a/tests/pycodestyle.cfg b/tests/pycodestyle.cfg
index 38584d81..4ba9cf60 100644
--- a/tests/pycodestyle.cfg
+++ b/tests/pycodestyle.cfg
@@ -6,7 +6,6 @@ format = pylint
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
-# E121: Continuation line under-indented for hanging indent
# E122: Continuation line missing indentation or outdented
# E123: Closing bracket does not match indentation of opening
# bracket's line
@@ -23,7 +22,6 @@ format = pylint
# E306: Expected 1 blank line before a nested definition
# E402: Module level import not at top of file
# E501: Line too long (82 > 79 characters)
-# E722: Do not use bare except, specify exception instead
# E741: Do not use variables named l, O, or I

View File

@ -1,39 +0,0 @@
Subject: python3: fix bytes/string mess in serial console
From: Cédric Bosdonnat cbosdonnat@suse.com Wed Dec 13 12:08:50 2017 +0100
Date: Wed Dec 20 16:09:35 2017 -0500:
Git: 0c6bcb09176d683e0e7de7623a1a215937c60aa8
Add a few encode() and decode() to convert between libvirt stream
functions expecting bytes arrays and Vte callbacks providing strings.
diff --git a/virtManager/serialcon.py b/virtManager/serialcon.py
index 7caf6db..21ab8ae 100644
--- a/virtManager/serialcon.py
+++ b/virtManager/serialcon.py
@@ -149,7 +149,7 @@ class LibvirtConsoleConnection(ConsoleConnection):
self.stream = None
- self.streamToTerminal = ""
+ self.streamToTerminal = b""
self.terminalToStream = ""
def _event_on_stream(self, stream, events, opaque):
@@ -187,7 +187,7 @@ class LibvirtConsoleConnection(ConsoleConnection):
self.terminalToStream):
try:
- done = self.stream.send(self.terminalToStream)
+ done = self.stream.send(self.terminalToStream.encode())
except Exception:
logging.exception("Error sending stream data")
self.close()
@@ -262,7 +262,7 @@ class LibvirtConsoleConnection(ConsoleConnection):
return
terminal.feed(self.streamToTerminal)
- self.streamToTerminal = ""
+ self.streamToTerminal = b""
class vmmSerialConsole(vmmGObject):

View File

@ -1,42 +0,0 @@
Subject: vnc: don't skip authentication for listen type none with fixed QEMU
From: Pavel Hrdina phrdina@redhat.com Tue Jan 16 09:30:50 2018 +0100
Date: Tue Jan 16 09:42:11 2018 +0100:
Git: 0e812e3c423787ac0392f9c083d20a5ca7d0ed8c
This was fixed by commit <fa03cb7fd21> in QEMU.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1445239
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtManager/domain.py b/virtManager/domain.py
index 183a56c..1134a43 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -1198,11 +1198,11 @@ class vmmDomain(vmmLibvirtObject):
flags = 0
# Ugly workaround for VNC bug where the display cannot be opened
- # if the listen type is "none". When this gets fixed in QEMU
- # we should skip auth only for broken QEMUs.
+ # if the listen type is "none". This bug was fixed in QEMU-2.9.0.
graphics = self.get_graphics_devices()[0]
if (graphics.type == "vnc" and
- graphics.get_first_listen_type() == "none"):
+ graphics.get_first_listen_type() == "none" and
+ not self.conn.SUPPORT_CONN_VNC_NONE_AUTH):
flags = libvirt.VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH
return self._backend.openGraphicsFD(0, flags)
diff --git a/virtinst/support.py b/virtinst/support.py
index 115c9b1..c27dd50 100644
--- a/virtinst/support.py
+++ b/virtinst/support.py
@@ -325,6 +325,7 @@ SUPPORT_CONN_RNG_URANDOM = _make(version="1.3.4")
SUPPORT_CONN_USB3_PORTS = _make(version="1.3.5")
SUPPORT_CONN_MACHVIRT_PCI_DEFAULT = _make(version="3.0.0")
SUPPORT_CONN_QEMU_XHCI = _make(version="3.3.0")
+SUPPORT_CONN_VNC_NONE_AUTH = _make(hv_version={"qemu": "2.9.0"})
# This is for disk <driver name=qemu>. xen supports this, but it's

View File

@ -1,23 +0,0 @@
Subject: network: Set bridge name to None instead of blank
From: Lin Ma lma@suse.com Thu Oct 19 16:56:42 2017 +0800
Date: Thu Oct 19 18:09:19 2017 -0400:
Git: 23aaf8527d63f4565661e0d582bb88af839d4dce
Trigger libvirt error if user leaves 'net-bridge-name' GtkEntry
blank when specifying shared device name.
Signed-off-by: Lin Ma <lma@suse.com>
diff --git a/virtManager/netlist.py b/virtManager/netlist.py
index 772e988d..4f1e991a 100644
--- a/virtManager/netlist.py
+++ b/virtManager/netlist.py
@@ -314,7 +314,7 @@ class vmmNetworkList(vmmGObjectUI):
if net_check_bridge and bridge_entry:
net_type = virtinst.VirtualNetworkInterface.TYPE_BRIDGE
- net_src = bridge_entry.get_text()
+ net_src = bridge_entry.get_text() or None
mode = None
if self.widget("net-source-mode").is_visible():

View File

@ -1,30 +0,0 @@
Subject: progress: Don't overwrite "format"
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:44 2017 +0100
Date: Fri Oct 20 11:49:14 2017 -0400:
Git: 2d276ebed84ba9f468243989d219940883cf72ad
Do not overwrite built-in format. [1]
https://docs.python.org/2/library/functions.html#format
diff --git a/virtinst/progress.py b/virtinst/progress.py
index 05114ed4..2b070540 100644
--- a/virtinst/progress.py
+++ b/virtinst/progress.py
@@ -484,12 +484,12 @@ def format_number(number, SI=0, space=' '):
if isinstance(number, int) or isinstance(number, long):
# it's an int or a long, which means it didn't get divided,
# which means it's already short enough
- format = '%i%s%s'
+ fmt = '%i%s%s'
elif number < 9.95:
# must use 9.95 for proper sizing. For example, 9.99 will be
# rounded to 10.0 with the .1f format string (which is too long)
- format = '%.1f%s%s'
+ fmt = '%.1f%s%s'
else:
- format = '%.0f%s%s'
+ fmt = '%.0f%s%s'
- return(format % (float(number or 0), space, symbols[depth]))
+ return(fmt % (float(number or 0), space, symbols[depth]))

View File

@ -1,43 +0,0 @@
Subject: addhardware: Correctly calculate virtio-scsi controller index
From: Lin Ma lma@suse.com Mon Nov 6 20:52:07 2017 +0800
Date: Wed Nov 22 16:50:33 2017 -0500:
Git: 2eb455c97f1afda33a4b1c87adb2721fac9d9b5f
Because sata, usb and scsi use same device prefix: sd*, They will be
included into occupied list while we add virtio-scsi disks, This is
wrong and may cause adding additional virtio-scsi controller.
How to reproduce:
1. fresh install a qemu guest.
2. add 6 virtual USB disks.
3. add disk A on scsi bus.
(then a virtio-scsi controller 0 will be added automatically)
4. add disk B on scsi bus.
5. observe.
Expected:
disk A and disk B should be connected to virtio-scsi controller 0 because
controller 0 has enough available slots.
Actual:
disk A was connected to virtio-scsi controller 0.
An additional virtio-scsi controller 1 was added and disk B was connected
to it because virt-manager thought the virtio-scsi controller 0 doesn't
have available slot.
Signed-off-by: Lin Ma <lma@suse.com>
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 4a962e6..e563fe6 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1456,7 +1456,8 @@ class vmmAddHardware(vmmGObjectUI):
# Save occupied places per controller
occupied = {}
for d in used_disks:
- if d.get_target_prefix() == disk.get_target_prefix():
+ if (d.get_target_prefix() == disk.get_target_prefix() and
+ d.bus == "scsi"):
num = virtinst.VirtualDisk.target_to_num(d.target)
idx = num // 7
if idx not in occupied:

View File

@ -1,22 +0,0 @@
Subject: urlfetcher: Write test file as binary content
From: Cole Robinson crobinso@redhat.com Sat Oct 21 19:33:30 2017 -0400
Date: Sat Oct 21 19:41:33 2017 -0400:
Git: 374a3779c402b931554aea06c42a9dcb49c35406
Triggers an test_ui error otherwise:
TypeError: write() argument must be str, not bytes
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index a45c6383..5dae424c 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -155,7 +155,7 @@ class _URLFetcher(object):
# pylint: disable=redefined-variable-type
if "VIRTINST_TEST_SUITE" in os.environ:
fn = os.path.join("/tmp", prefix)
- fileobj = open(fn, "w")
+ fileobj = open(fn, "wb")
else:
fileobj = tempfile.NamedTemporaryFile(
dir=self.scratchdir, prefix=prefix, delete=False)

View File

@ -1,28 +0,0 @@
Subject: Replace 'StandardError' with 'Exception'
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:36:01 2017 +0100
Date: Fri Oct 20 13:18:31 2017 -0400:
Git: 37ea520773bc7339e114915daac1ca1a8a0334bd
Python 2 has an exception class called StandardError that has
been removed in Python 3. Use Exception instead. [1]
[1] http://python3porting.com/differences.html#standarderror
diff --git a/virtconv/ovf.py b/virtconv/ovf.py
index 3ba21313..16ec5681 100644
--- a/virtconv/ovf.py
+++ b/virtconv/ovf.py
@@ -269,10 +269,9 @@ def _import_file(doc, ctx, conn, input_file):
if not bool_val(env_node.prop("required")):
continue
- raise StandardError(_("OVF section '%s' is listed as "
- "required, but parser doesn't know "
- "how to handle it.") %
- env_node.name)
+ raise Exception(_("OVF section '%s' is listed as "
+ "required, but parser doesn't know "
+ "how to handle it.") % env_node.name)
disk_buses = {}
for node in ctx.xpathEval(vhbase % DEVICE_IDE_BUS):

View File

@ -1,22 +0,0 @@
Subject: domain: don't add URI into params for tunneled migration
From: Pavel Hrdina phrdina@redhat.com Tue Oct 3 12:24:39 2017 +0200
Date: Tue Oct 3 12:24:39 2017 +0200:
Git: 3b769643657f906dc2b53c568d7fe748155d9b2b
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1456185
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtManager/domain.py b/virtManager/domain.py
index 6fb54bc..724f83f 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -1596,7 +1596,7 @@ class vmmDomain(vmmLibvirtObject):
start_job_progress_thread(self, meter, _("Migrating domain"))
params = {}
- if dest_uri:
+ if dest_uri and not tunnel:
params[libvirt.VIR_MIGRATE_PARAM_URI] = dest_uri
if tunnel:

View File

@ -1,24 +0,0 @@
Subject: addhardware: Don't allow panic option where it isn't supported
From: Cole Robinson crobinso@redhat.com Fri Oct 27 09:47:38 2017 +0200
Date: Fri Oct 27 09:47:38 2017 +0200:
Git: 3be78d1f3f1a3925b3bf04f0ffded21715bcf9e9
Like aarch64, basically any arch that doesn't have an explicit panic
model
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 3793006c..cd82cd3e 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -404,8 +404,9 @@ class vmmAddHardware(vmmGObjectUI):
True, None)
add_hw_option(_("RNG"), "system-run", PAGE_RNG, True, None)
add_hw_option(_("Panic Notifier"), "system-run", PAGE_PANIC,
- self.conn.check_support(self.conn.SUPPORT_CONN_PANIC_DEVICE),
- _("Not supported for this hypervisor/libvirt combination."))
+ self.conn.check_support(self.conn.SUPPORT_CONN_PANIC_DEVICE) and
+ virtinst.VirtualPanicDevice.get_models(self.vm.get_xmlobj().os),
+ _("Not supported for this hypervisor/libvirt/arch combination."))
def _reset_state(self):
# Storage init

View File

@ -1,24 +0,0 @@
Subject: Use reload() from imp module
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:56 2017 +0100
Date: Fri Oct 20 13:18:31 2017 -0400:
Git: 44de92b772dcb264a75832a46d4cf85e21799316
In Python 3 the reload() function [1] has been moved in the imp
module. [2]
[1] https://docs.python.org/2/library/functions.html#reload
[2] https://docs.python.org/3/library/importlib.html#importlib.reload
diff --git a/tests/__init__.py b/tests/__init__.py
index 19b5d3e9..bea21d85 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -28,7 +28,7 @@ os.environ["VIRTINST_TEST_URL_DIR"] = os.path.abspath(
# pylint: disable=wrong-import-position
from virtcli import cliconfig
# This sets all the cli bits back to their defaults
-reload(cliconfig)
+imp.reload(cliconfig)
from tests import utils

View File

@ -1,316 +0,0 @@
Subject: pycodestyle: Use isinstance() for type checking
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:41 2017 +0100
Date: Fri Oct 20 11:49:13 2017 -0400:
Git: 63fce081ed1e4edf44077546d98b4fcdb3f4884c
This is E721 in pycodestyle [1]:
"do not compare types, use isinstance()"
The main differece between "type() is" and "isinstance()" is that
isinstance() supports inheritance. [1]
This can be seen in the example below:
>>> type(True) is int
False
>>> isinstance(True, int)
True
As we can see in python 'bool' a subclass of 'int'.
[1] https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
[2] https://docs.python.org/2/library/functions.html#isinstance
diff --git a/tests/clitest.py b/tests/clitest.py
index 7e9e6684..bdc1b448 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -201,7 +201,7 @@ class Command(object):
if conn is None:
raise RuntimeError("skip check is not None, but conn is None")
- if type(check) is str:
+ if isinstance(check, str):
# pylint: disable=protected-access
if support._check_version(conn, check):
return
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 70da9220..0f7e20db 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -1088,7 +1088,7 @@ class vmmConnection(vmmGObject):
try:
self._backend.setKeepAlive(20, 1)
except Exception as e:
- if (type(e) is not AttributeError and
+ if (not isinstance(e, AttributeError) and
not util.is_error_nosupport(e)):
raise
logging.debug("Connection doesn't support KeepAlive, "
diff --git a/virtManager/create.py b/virtManager/create.py
index c695b2b2..1fbc65ef 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -1692,7 +1692,7 @@ class vmmCreate(vmmGObjectUI):
else:
def callback(ignore, text):
widget = cbwidget
- if type(cbwidget) is str:
+ if isinstance(cbwidget, str):
widget = self.widget(cbwidget)
widget.set_text(text)
diff --git a/virtManager/details.py b/virtManager/details.py
index e74ea5f7..aeac7fd3 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -1520,7 +1520,7 @@ class vmmDetails(vmmGObjectUI):
# On Fedora 19, ret is (bool, str)
# Someday the bindings might be fixed to just return the str, try
# and future proof it a bit
- if type(ret) is tuple and len(ret) >= 2:
+ if isinstance(ret, tuple) and len(ret) >= 2:
ret = ret[1]
# F24 rawhide, ret[1] is a named tuple with a 'buffer' element...
if hasattr(ret, "buffer"):
@@ -3218,7 +3218,7 @@ class vmmDetails(vmmGObjectUI):
olddev = hw_list_model[i][HW_LIST_COL_DEVICE]
# Existing device, don't remove it
- if type(olddev) is str or olddev in currentDevices:
+ if isinstance(olddev, str) or olddev in currentDevices:
continue
hw_list_model.remove(_iter)
diff --git a/virtManager/domain.py b/virtManager/domain.py
index 724f83fd..1b278815 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -83,7 +83,7 @@ def compare_device(origdev, newdev, idx):
if id(origdev) == id(newdev):
return True
- if type(origdev) is not type(newdev):
+ if not isinstance(origdev, type(newdev)):
return False
for devprop in devprops[origdev.virtual_device_type]:
diff --git a/virtManager/error.py b/virtManager/error.py
index 1de6c8b1..1a8fae5a 100644
--- a/virtManager/error.py
+++ b/virtManager/error.py
@@ -275,7 +275,7 @@ class vmmErrorDialog(vmmGObject):
if _type is not None:
pattern = _type
name = None
- if type(_type) is tuple:
+ if isinstance(_type, tuple):
pattern = _type[0]
name = _type[1]
diff --git a/virtManager/module_trace.py b/virtManager/module_trace.py
index 8d600f4e..ff76504f 100644
--- a/virtManager/module_trace.py
+++ b/virtManager/module_trace.py
@@ -83,7 +83,7 @@ def wrap_class(classobj):
for name in dir(classobj):
obj = getattr(classobj, name)
- if type(obj) is MethodType:
+ if isinstance(obj, MethodType):
wrap_method(classobj, obj)
@@ -92,7 +92,7 @@ def wrap_module(module, regex=None):
if regex and not re.match(regex, name):
continue
obj = getattr(module, name)
- if type(obj) is FunctionType:
+ if isinstance(obj, FunctionType):
wrap_func(module, obj)
- if type(obj) is ClassType or type(obj) is type:
+ if isinstance(obj, (ClassType, type)):
wrap_class(obj)
diff --git a/virtManager/packageutils.py b/virtManager/packageutils.py
index 37f96c38..153cc55b 100644
--- a/virtManager/packageutils.py
+++ b/virtManager/packageutils.py
@@ -38,7 +38,7 @@ def check_packagekit(parent, errbox, packages):
if not packages:
logging.debug("No PackageKit packages to search for.")
return
- if type(packages) is not list:
+ if not isinstance(packages, list):
packages = [packages]
logging.debug("PackageKit check/install for packages=%s", packages)
diff --git a/virtManager/uiutil.py b/virtManager/uiutil.py
index 2965c51b..d07c2a1e 100644
--- a/virtManager/uiutil.py
+++ b/virtManager/uiutil.py
@@ -155,7 +155,7 @@ def set_grid_row_visible(child, visible):
based on UI interraction
"""
parent = child.get_parent()
- if type(parent) is not Gtk.Grid:
+ if not isinstance(parent, Gtk.Grid):
raise RuntimeError("Programming error, parent must be grid, "
"not %s" % type(parent))
diff --git a/virtManager/viewers.py b/virtManager/viewers.py
index 80bdb083..df164f59 100644
--- a/virtManager/viewers.py
+++ b/virtManager/viewers.py
@@ -614,7 +614,7 @@ class SpiceViewer(Viewer):
GObject.GObject.connect(channel, "open-fd",
self._channel_open_fd_request)
- if (type(channel) == SpiceClientGLib.MainChannel and
+ if (isinstance(channel, SpiceClientGLib.MainChannel) and
not self._main_channel):
self._main_channel = channel
hid = self._main_channel.connect_after("channel-event",
diff --git a/virtconv/ovf.py b/virtconv/ovf.py
index 0a770c98..3ba21313 100644
--- a/virtconv/ovf.py
+++ b/virtconv/ovf.py
@@ -151,7 +151,7 @@ def _import_file(doc, ctx, conn, input_file):
ret = ctx.xpathEval(path)
result = None
if ret is not None:
- if type(ret) == list:
+ if isinstance(ret, list):
if len(ret) >= 1:
result = ret[0].content
else:
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 17a2e70f..1b86cad5 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1002,7 +1002,7 @@ def _parse_optstr_to_dict(optstr, virtargs, remove_first):
virtarg.is_list):
optdict[cliname] = []
- if type(optdict.get(cliname)) is list:
+ if isinstance(optdict.get(cliname), list):
optdict[cliname].append(val)
else:
optdict[cliname] = val
@@ -2591,7 +2591,7 @@ class _ParserChar(VirtCLIParser):
stub_none = False
def support_check(self, inst, virtarg):
- if type(virtarg.attrname) is not str:
+ if not isinstance(virtarg.attrname, str):
return
if not inst.supports_property(virtarg.attrname):
raise ValueError(_("%(devtype)s type '%(chartype)s' does not "
diff --git a/virtinst/cloner.py b/virtinst/cloner.py
index 72642f60..7345bdad 100644
--- a/virtinst/cloner.py
+++ b/virtinst/cloner.py
@@ -88,7 +88,7 @@ class Cloner(object):
doc="Original guest name.")
def set_original_xml(self, val):
- if type(val) is not str:
+ if not isinstance(val, str):
raise ValueError(_("Original xml must be a string."))
self._original_xml = val
self._original_guest = Guest(self.conn,
@@ -214,7 +214,7 @@ class Cloner(object):
"(not Cloner.preserve)")
def set_force_target(self, dev):
- if type(dev) is list:
+ if isinstance(dev, list):
self._force_target = dev[:]
else:
self._force_target.append(dev)
@@ -225,7 +225,7 @@ class Cloner(object):
"despite Cloner's recommendation.")
def set_skip_target(self, dev):
- if type(dev) is list:
+ if isinstance(dev, list):
self._skip_target = dev[:]
else:
self._skip_target.append(dev)
@@ -237,7 +237,7 @@ class Cloner(object):
"takes precedence over force_target.")
def set_clone_policy(self, policy_list):
- if type(policy_list) != list:
+ if not isinstance(policy_list, list):
raise ValueError(_("Cloning policy must be a list of rules."))
self._clone_policy = policy_list
def get_clone_policy(self):
diff --git a/virtinst/progress.py b/virtinst/progress.py
index e9a243b1..d73d4292 100644
--- a/virtinst/progress.py
+++ b/virtinst/progress.py
@@ -482,7 +482,7 @@ def format_number(number, SI=0, space=' '):
depth = depth + 1
number = number / step
- if type(number) == type(1) or type(number) == type(long(1)):
+ if isinstance(number, int) or isinstance(number, long):
# it's an int or a long, which means it didn't get divided,
# which means it's already short enough
format = '%i%s%s'
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index 2dc7a726..c57c9e10 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -1351,7 +1351,7 @@ class ALTLinuxDistro(Distro):
def _build_distro_list():
allstores = []
for obj in globals().values():
- if type(obj) is type and issubclass(obj, Distro) and obj.name:
+ if isinstance(obj, type) and issubclass(obj, Distro) and obj.name:
allstores.append(obj)
seen_urldistro = []
diff --git a/virtinst/util.py b/virtinst/util.py
index 495a0841..2a7bc4d3 100644
--- a/virtinst/util.py
+++ b/virtinst/util.py
@@ -30,7 +30,7 @@ import libvirt
def listify(l):
if l is None:
return []
- elif type(l) != list:
+ elif not isinstance(l, list):
return [l]
else:
return l
@@ -61,7 +61,7 @@ def libvirt_collision(collision_cb, val):
def validate_uuid(val):
- if type(val) is not str:
+ if not isinstance(val, str):
raise ValueError(_("UUID must be a string."))
form = re.match("[a-fA-F0-9]{8}[-]([a-fA-F0-9]{4}[-]){3}[a-fA-F0-9]{12}$",
@@ -99,7 +99,7 @@ def validate_macaddr(val):
if val is None:
return
- if type(val) is not str:
+ if not isinstance(val, str):
raise ValueError(_("MAC address must be a string."))
form = re.match("^([0-9a-fA-F]{1,2}:){5}[0-9a-fA-F]{1,2}$", val)
diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py
index 9e234e9f..550fea86 100644
--- a/virtinst/xmlbuilder.py
+++ b/virtinst/xmlbuilder.py
@@ -886,7 +886,7 @@ class XMLBuilder(object):
# XMLChildProperty stores a list in propstore, which dict shallow
# copy won't fix for us.
for name, value in ret._propstore.items():
- if type(value) is not list:
+ if not isinstance(value, list):
continue
ret._propstore[name] = [obj.copy() for obj in ret._propstore[name]]

View File

@ -1,344 +0,0 @@
Subject: Python 2/3 division compatability
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:55 2017 +0100
Date: Sat Jan 27 15:30:17 2018 -0500:
Git: 6712261510953f9c729624dded29bfffd32f88e6
In Python 2 the classic devision of integers returns an integer
but in Python 3 it might return float.
Example:
- Python 2: - Python 3:
>>> 9 / 4 >>> 9 / 4
2 2.25
>>> 9 // 4 >>> 9 // 4
2 2
>>> 9 / 4.0 >>> 9 / 4.0
2.25 2.25
>>> 9 // 4.0 >>> 9 // 4.0
2.0 2.0
For more info see: https://www.python.org/dev/peps/pep-0238/
Index: virt-manager-1.4.3/virtManager/console.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/console.py
+++ virt-manager-1.4.3/virtManager/console.py
@@ -399,12 +399,12 @@ class vmmConsolePages(vmmGObjectUI):
if align_ratio > desktop_ratio:
desktop_w = int(req.height * desktop_ratio)
desktop_h = req.height
- dx = (req.width - desktop_w) / 2
+ dx = (req.width - desktop_w) // 2
else:
desktop_w = req.width
- desktop_h = int(req.width / desktop_ratio)
- dy = (req.height - desktop_h) / 2
+ desktop_h = int(req.width // desktop_ratio)
+ dy = (req.height - desktop_h) // 2
viewer_alloc = Gdk.Rectangle()
viewer_alloc.x = dx
Index: virt-manager-1.4.3/virtManager/create.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/create.py
+++ virt-manager-1.4.3/virtManager/create.py
@@ -691,7 +691,7 @@ class vmmCreate(vmmGObjectUI):
{'maxmem': _pretty_memory(memory)})
mem_label = ("<span size='small' color='#484848'>%s</span>" %
mem_label)
- self.widget("mem").set_range(50, memory / 1024)
+ self.widget("mem").set_range(50, memory // 1024)
self.widget("phys-mem-label").set_markup(mem_label)
# CPU
@@ -2142,7 +2142,7 @@ class vmmCreate(vmmGObjectUI):
# Change the default values suggested to the user.
ram_size = DEFAULT_MEM
if res and res.get("ram") > 0:
- ram_size = res["ram"] / (1024 ** 2)
+ ram_size = res["ram"] // (1024 ** 2)
self.widget("mem").set_value(ram_size)
n_cpus = 1
@@ -2151,7 +2151,7 @@ class vmmCreate(vmmGObjectUI):
self.widget("cpus").set_value(n_cpus)
if res and res.get("storage"):
- storage_size = int(res["storage"]) / (1024 ** 3)
+ storage_size = int(res["storage"]) // (1024 ** 3)
self._addstorage.widget("storage-size").set_value(storage_size)
# Validation passed, store the install path (if there is one) in
Index: virt-manager-1.4.3/virtManager/createnet.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/createnet.py
+++ virt-manager-1.4.3/virtManager/createnet.py
@@ -627,7 +627,7 @@ class vmmCreateNetwork(vmmGObjectUI):
valid_ip = (ip.numhosts >= 8 and ip.is_private)
gateway = (ip.prefixlen != 32 and str(ip.network + 1) or "")
info = (ip.is_private and _("Private") or _("Other/Public"))
- start = int(ip.numhosts / 2)
+ start = int(ip.numhosts // 2)
end = int(ip.numhosts - 2)
src.modify_bg(Gtk.StateType.NORMAL, valid_ip and _green or _red)
Index: virt-manager-1.4.3/virtManager/details.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/details.py
+++ virt-manager-1.4.3/virtManager/details.py
@@ -2584,7 +2584,7 @@ class vmmDetails(vmmGObjectUI):
def refresh_config_memory(self):
host_mem_widget = self.widget("state-host-memory")
- host_mem = self.vm.conn.host_memory_size() / 1024
+ host_mem = self.vm.conn.host_memory_size() // 1024
vm_cur_mem = self.vm.get_memory() / 1024.0
vm_max_mem = self.vm.maximum_memory() / 1024.0
@@ -2965,7 +2965,7 @@ class vmmDetails(vmmGObjectUI):
ram = vid.vram
heads = vid.heads
try:
- ramlabel = ram and "%d MiB" % (int(ram) / 1024) or "-"
+ ramlabel = ram and "%d MiB" % (int(ram) // 1024) or "-"
except Exception:
ramlabel = "-"
Index: virt-manager-1.4.3/virtManager/domain.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/domain.py
+++ virt-manager-1.4.3/virtManager/domain.py
@@ -1984,7 +1984,7 @@ class vmmDomain(vmmLibvirtObject):
except libvirt.libvirtError as err:
logging.error("Error reading mem stats: %s", err)
- pcentCurrMem = (curmem / float(totalmem)) * 100
+ pcentCurrMem = (curmem // float(totalmem)) * 100
pcentCurrMem = max(0.0, min(pcentCurrMem, 100.0))
return pcentCurrMem, curmem
@@ -2033,10 +2033,10 @@ class vmmDomain(vmmLibvirtObject):
"cpuGuestPercent": pcentGuestCpu,
"curmem": curmem,
"currMemPercent": pcentCurrMem,
- "diskRdKiB": rdBytes / 1024,
- "diskWrKiB": wrBytes / 1024,
- "netRxKiB": rxBytes / 1024,
- "netTxKiB": txBytes / 1024,
+ "diskRdKiB": rdBytes // 1024,
+ "diskWrKiB": wrBytes // 1024,
+ "netRxKiB": rxBytes // 1024,
+ "netTxKiB": txBytes // 1024,
}
for r in ["diskRd", "diskWr", "netRx", "netTx"]:
Index: virt-manager-1.4.3/virtManager/fsdetails.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/fsdetails.py
+++ virt-manager-1.4.3/virtManager/fsdetails.py
@@ -190,7 +190,7 @@ class vmmFSDetails(vmmGObjectUI):
if dev.type != VirtualFilesystem.TYPE_RAM:
self.widget("fs-source").set_text(dev.source)
else:
- self.widget("fs-ram-source-spin").set_value(int(dev.source) / 1024)
+ self.widget("fs-ram-source-spin").set_value(int(dev.source) // 1024)
self.widget("fs-target").set_text(dev.target or "")
self.widget("fs-readonly").set_active(dev.readonly)
Index: virt-manager-1.4.3/virtManager/graphwidgets.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/graphwidgets.py
+++ virt-manager-1.4.3/virtManager/graphwidgets.py
@@ -150,7 +150,7 @@ class CellRendererSparkline(Gtk.CellRend
graph_width = (cell_area.width - (GRAPH_PAD * 2))
graph_height = (cell_area.height - (GRAPH_PAD * 2))
- pixels_per_point = (graph_width / max(1, len(self.data_array) - 1))
+ pixels_per_point = (graph_width // max(1, len(self.data_array) - 1))
# Graph width needs to be some multiple of the amount of data points
# we have
@@ -316,7 +316,7 @@ class Sparkline(Gtk.DrawingArea):
w = window.get_width()
h = window.get_height()
- points_per_set = (len(self.data_array) / self.num_sets)
+ points_per_set = (len(self.data_array) // self.num_sets)
pixels_per_point = (float(w) /
(float((points_per_set - 1) or 1)))
@@ -330,9 +330,9 @@ class Sparkline(Gtk.DrawingArea):
max_ticks = 4
for index in range(1, max_ticks):
Gtk.render_line(ctx, cr, 1,
- (h / max_ticks) * index,
+ (h // max_ticks) * index,
w - 2,
- (h / max_ticks) * index)
+ (h // max_ticks) * index)
# Foreground-color graphics context
# This draws the black border
Index: virt-manager-1.4.3/virtManager/manager.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/manager.py
+++ virt-manager-1.4.3/virtManager/manager.py
@@ -1067,7 +1067,7 @@ class vmmManager(vmmGObjectUI):
return
d1, d2 = obj.disk_io_vectors(GRAPH_LEN, self.max_disk_rate)
- data = [(x + y) / 2 for x, y in zip(d1, d2)]
+ data = [(x + y) // 2 for x, y in zip(d1, d2)]
cell.set_property('data_array', data)
def network_traffic_img(self, column_ignore, cell, model, _iter, data):
@@ -1076,5 +1076,5 @@ class vmmManager(vmmGObjectUI):
return
d1, d2 = obj.network_traffic_vectors(GRAPH_LEN, self.max_net_rate)
- data = [(x + y) / 2 for x, y in zip(d1, d2)]
+ data = [(x + y) // 2 for x, y in zip(d1, d2)]
cell.set_property('data_array', data)
Index: virt-manager-1.4.3/virtManager/storagelist.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/storagelist.py
+++ virt-manager-1.4.3/virtManager/storagelist.py
@@ -415,7 +415,7 @@ class vmmStorageList(vmmGObjectUI):
model.clear()
vadj = self.widget("vol-scroll").get_vadjustment()
- vscroll_percent = vadj.get_value() / max(vadj.get_upper(), 1)
+ vscroll_percent = vadj.get_value() // max(vadj.get_upper(), 1)
for vol in vols:
key = vol.get_connkey()
Index: virt-manager-1.4.3/virtinst/cpu.py
===================================================================
--- virt-manager-1.4.3.orig/virtinst/cpu.py
+++ virt-manager-1.4.3/virtinst/cpu.py
@@ -175,18 +175,18 @@ class CPU(XMLBuilder):
vcpus = int(vcpus or 0)
if not self.sockets:
if not self.cores:
- self.sockets = vcpus / self.threads
+ self.sockets = vcpus // self.threads
else:
- self.sockets = vcpus / self.cores
+ self.sockets = vcpus // self.cores
if not self.cores:
if not self.threads:
- self.cores = vcpus / self.sockets
+ self.cores = vcpus // self.sockets
else:
- self.cores = vcpus / (self.sockets * self.threads)
+ self.cores = vcpus // (self.sockets * self.threads)
if not self.threads:
- self.threads = vcpus / (self.sockets * self.cores)
+ self.threads = vcpus // (self.sockets * self.cores)
return
Index: virt-manager-1.4.3/virtinst/devicedisk.py
===================================================================
--- virt-manager-1.4.3.orig/virtinst/devicedisk.py
+++ virt-manager-1.4.3/virtinst/devicedisk.py
@@ -430,7 +430,7 @@ class VirtualDisk(VirtualDevice):
"""
digits = []
for factor in range(0, 3):
- amt = (num % (26 ** (factor + 1))) / (26 ** factor)
+ amt = (num % (26 ** (factor + 1))) // (26 ** factor)
if amt == 0 and num >= (26 ** (factor + 1)):
amt = 26
num -= amt
Index: virt-manager-1.4.3/virtinst/diskbackend.py
===================================================================
--- virt-manager-1.4.3.orig/virtinst/diskbackend.py
+++ virt-manager-1.4.3/virtinst/diskbackend.py
@@ -404,7 +404,7 @@ class CloneStorageCreator(_StorageCreato
if msg:
msg += (_(" %d M requested > %d M available") %
- ((need / (1024 * 1024)), (avail / (1024 * 1024))))
+ ((need // (1024 * 1024)), (avail // (1024 * 1024))))
return (ret, msg)
def create(self, progresscb):
Index: virt-manager-1.4.3/virtinst/progress.py
===================================================================
--- virt-manager-1.4.3.orig/virtinst/progress.py
+++ virt-manager-1.4.3/virtinst/progress.py
@@ -79,7 +79,7 @@ class TerminalLine:
a number of different elements (default=2). """
if self._llen < fixed:
return 0
- return (self._llen - fixed) / elements
+ return (self._llen - fixed) // elements
def add(self, element, full_len=None):
""" If there is room left in the line, above min_len, add element.
@@ -249,7 +249,7 @@ class TextMeter(BaseMeter):
sofar_size = None
if _text_meter_total_size:
sofar_size = _text_meter_sofar_size + amount_read
- sofar_pc = (sofar_size * 100) / _text_meter_total_size
+ sofar_pc = (sofar_size * 100) // _text_meter_total_size
# Include text + ui_rate in minimal
tl = TerminalLine(8, 8+1+8)
@@ -385,7 +385,7 @@ class RateEstimator:
(can be None for unknown transfer size)"""
if self.total is None: return None
elif self.total == 0: return 1.0
- else: return float(self.last_amount_read)/self.total
+ else: return float(self.last_amount_read) / self.total
#########################################################################
# support methods
@@ -432,7 +432,7 @@ class RateEstimator:
"""
if rt < 0: return 0.0
- shift = int(math.log(rt/start_time)/math.log(2))
+ shift = int(math.log(rt / start_time) / math.log(2))
rt = int(rt)
if shift <= 0: return rt
return float(int(rt) >> shift << shift)
@@ -446,10 +446,10 @@ def format_time(seconds, use_hours=0):
return 'Infinite'
else:
seconds = int(seconds)
- minutes = seconds / 60
+ minutes = seconds // 60
seconds = seconds % 60
if use_hours:
- hours = minutes / 60
+ hours = minutes // 60
minutes = minutes % 60
return '%02i:%02i:%02i' % (hours, minutes, seconds)
else:
Index: virt-manager-1.4.3/virtinst/storage.py
===================================================================
--- virt-manager-1.4.3.orig/virtinst/storage.py
+++ virt-manager-1.4.3/virtinst/storage.py
@@ -904,13 +904,13 @@ class StorageVolume(_StorageObject):
return (True, _("There is not enough free space on the storage "
"pool to create the volume. "
"(%d M requested allocation > %d M available)") %
- ((self.allocation / (1024 * 1024)),
- (avail / (1024 * 1024))))
+ ((self.allocation // (1024 * 1024)),
+ (avail // (1024 * 1024))))
elif self.capacity > avail:
return (False, _("The requested volume capacity will exceed the "
"available pool space when the volume is fully "
"allocated. "
"(%d M requested capacity > %d M available)") %
- ((self.capacity / (1024 * 1024)),
- (avail / (1024 * 1024))))
+ ((self.capacity // (1024 * 1024)),
+ (avail // (1024 * 1024))))
return (False, "")

View File

@ -1,54 +0,0 @@
Subject: Import reduce() from functools module
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:59 2017 +0100
Date: Fri Oct 20 13:18:31 2017 -0400:
Git: 69c84bea474c3563975c1f2bfe160a436def020a
The built-in function reduce() [1] has been moved in the functools
module [2] [3].
[1] https://docs.python.org/2/library/functions.html#reduce
[2] https://docs.python.org/3/library/functools.html#functools.reduce
[3] https://docs.python.org/2/library/functools.html#functools.reduce
diff --git a/virtManager/host.py b/virtManager/host.py
index 560bc0a6..2f22642b 100644
--- a/virtManager/host.py
+++ b/virtManager/host.py
@@ -18,6 +18,7 @@
# MA 02110-1301 USA.
#
+import functools
import logging
from gi.repository import GObject
@@ -931,7 +932,7 @@ class vmmHost(vmmGObjectUI):
addrstr = "-"
if ipv6[2]:
- addrstr = reduce(lambda x, y: x + "\n" + y, ipv6[2])
+ addrstr = functools.reduce(lambda x, y: x + "\n" + y, ipv6[2])
self.widget("interface-ipv6-mode").set_text(mode)
self.widget("interface-ipv6-address").set_text(addrstr)
diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py
index 7f825b86..b00b1889 100644
--- a/virtManager/sshtunnels.py
+++ b/virtManager/sshtunnels.py
@@ -17,6 +17,7 @@
# MA 02110-1301 USA.
#
+import functools
import logging
import os
import Queue
@@ -261,7 +262,7 @@ def _make_ssh_command(ginfo):
argv.append("sh -c")
argv.append("'%s'" % nc_cmd)
- argv_str = reduce(lambda x, y: x + " " + y, argv[1:])
+ argv_str = functools.reduce(lambda x, y: x + " " + y, argv[1:])
logging.debug("Pre-generated ssh command for ginfo: %s", argv_str)
return argv

View File

@ -1,83 +0,0 @@
Subject: network: add support for parsing/formatting SR-IOV VFs
From: Lin Ma lma@suse.com Fri Sep 22 19:39:09 2017 +0800
Date: Mon Oct 9 10:22:48 2017 +0200:
Git: 6dfc4de125022c43cb6e60e2f9e0c395ece159d6
Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/tests/xmlparse-xml/network-vf-pool-in.xml b/tests/xmlparse-xml/network-vf-pool-in.xml
index 821aa075..542757de 100644
--- a/tests/xmlparse-xml/network-vf-pool-in.xml
+++ b/tests/xmlparse-xml/network-vf-pool-in.xml
@@ -1,5 +1,7 @@
<network>
<name>passthrough</name>
<forward mode="hostdev" managed="yes">
+ <pf dev="eth3"/>
+ <address type="pci" domain="0x0000" bus="0x03" slot="0x10" function="0x0"/>
</forward>
</network>
diff --git a/tests/xmlparse-xml/network-vf-pool-out.xml b/tests/xmlparse-xml/network-vf-pool-out.xml
index 62a73050..83644118 100644
--- a/tests/xmlparse-xml/network-vf-pool-out.xml
+++ b/tests/xmlparse-xml/network-vf-pool-out.xml
@@ -2,5 +2,6 @@
<name>new-foo</name>
<forward mode="hostdev" managed="yes">
<pf dev="eth3"/>
+ <address type="pci" domain="0x0000" bus="0x03" slot="0x10" function="0x0"/>
</forward>
</network>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index cc29eadc..1cceebce 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -1332,11 +1332,16 @@ class XMLParseTest(unittest.TestCase):
check("mode", "hostdev")
check("managed", "yes")
- r = net.forward.add_pf()
- r.dev = "eth3"
- check = self._make_checker(r)
+ check = self._make_checker(net.forward.pf[0])
check("dev", "eth3")
+ check = self._make_checker(net.forward.vfs[0])
+ check("type", "pci")
+ check("domain", 0x0000)
+ check("bus", 0x03)
+ check("slot", 0x10)
+ check("function", 0x0)
+
utils.diff_compare(net.get_xml_config(), outfile)
utils.test_create(conn, net.get_xml_config(), "networkDefineXML")
diff --git a/virtinst/network.py b/virtinst/network.py
index 183b0e3a..1cc71118 100644
--- a/virtinst/network.py
+++ b/virtinst/network.py
@@ -77,6 +77,15 @@ class _NetworkForwardPf(XMLBuilder):
dev = XMLProperty("./@dev")
+class _NetworkForwardAddress(XMLBuilder):
+ _XML_ROOT_NAME = "address"
+ type = XMLProperty("./@type")
+ domain = XMLProperty("./@domain", is_int=True)
+ bus = XMLProperty("./@bus", is_int=True)
+ slot = XMLProperty("./@slot", is_int=True)
+ function = XMLProperty("./@function", is_int=True)
+
+
class _NetworkForward(XMLBuilder):
_XML_ROOT_NAME = "forward"
@@ -84,6 +93,7 @@ class _NetworkForward(XMLBuilder):
dev = XMLProperty("./@dev")
managed = XMLProperty("./@managed")
pf = XMLChildProperty(_NetworkForwardPf)
+ vfs = XMLChildProperty(_NetworkForwardAddress)
def add_pf(self):
r = _NetworkForwardPf(self.conn)

View File

@ -1,34 +0,0 @@
Subject: diskbackend: get a proper size of existing block device while cloning
From: Pavel Hrdina phrdina@redhat.com Tue Oct 3 16:59:13 2017 +0200
Date: Thu Oct 19 09:12:05 2017 +0200:
Git: 6e6f59e7abfd85b2a53554b7d091e553585e85c8
We cannot use os.statvfs() if the clone disk is a block device because
it gets stats about filesystem which in this case is "devtmpfs" mounted
as "/dev".
As a workaround we can seek to the end of the block device to get
the actual size.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1450908
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtinst/diskbackend.py b/virtinst/diskbackend.py
index de745f4d..a08a23e5 100644
--- a/virtinst/diskbackend.py
+++ b/virtinst/diskbackend.py
@@ -387,8 +387,11 @@ class CloneStorageCreator(_StorageCreator):
def is_size_conflict(self):
ret = False
msg = None
- vfs = os.statvfs(os.path.dirname(self._path))
- avail = vfs[statvfs.F_FRSIZE] * vfs[statvfs.F_BAVAIL]
+ if self.get_dev_type() == "block":
+ avail = _stat_disk(self._path)[1]
+ else:
+ vfs = os.statvfs(os.path.dirname(self._path))
+ avail = vfs[statvfs.F_FRSIZE] * vfs[statvfs.F_BAVAIL]
need = long(self._size * 1024 * 1024 * 1024)
if need > avail:
if self._sparse:

View File

@ -1,19 +0,0 @@
Subject: systray: Remove redundant variable assignment
From: Radostin Stoyanov rstoyanov1@gmail.com Thu Oct 26 12:00:06 2017 +0100
Date: Fri Oct 27 10:10:08 2017 +0200:
Git: 73de82852405c85b568f9f6293db60ce8f6a85c6
The explicit assignment of "name" is unnecessary.
diff --git a/virtManager/systray.py b/virtManager/systray.py
index aa62df0a..9011038f 100644
--- a/virtManager/systray.py
+++ b/virtManager/systray.py
@@ -275,7 +275,6 @@ class vmmSystray(vmmGObject):
return
for i, name in enumerate(vm_names):
- name = vm_names[i]
connkey = vm_mappings[name]
if connkey in self.conn_vm_menuitems[uri]:
vm_item = self.conn_vm_menuitems[uri][connkey]

View File

@ -1,139 +0,0 @@
Subject: Replace StringIO with io.(StringIO or BytesIO)
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:50 2017 +0100
Date: Fri Oct 20 13:18:31 2017 -0400:
Git: 75210ed37c0c5de569de73e04488808a2521a011
StringIO and cStringIO modules no longer exists in Python 3. [1]
Use either io.StringIO [2] for text or io.BytesIO [3] for bytes.
[1] http://docs.python.org/3.0/whatsnew/3.0.html
[2] https://docs.python.org/3/library/io.html#text-i-o
[3] https://docs.python.org/3/library/io.html#binary-i-o
diff --git a/tests/clitest.py b/tests/clitest.py
index bdc1b44..cf140a9 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -16,6 +16,7 @@
# MA 02110-1301 USA.
import atexit
+import io
import logging
import os
import shlex
@@ -23,7 +24,6 @@ import shutil
import sys
import traceback
import unittest
-import StringIO
from virtinst import support
@@ -144,7 +144,7 @@ class Command(object):
oldstdin = sys.stdin
oldargv = sys.argv
try:
- out = StringIO.StringIO()
+ out = io.BytesIO()
sys.stdout = out
sys.stderr = out
sys.argv = self.argv
diff --git a/tests/virtconvtest.py b/tests/virtconvtest.py
index f804883..3afb392 100644
--- a/tests/virtconvtest.py
+++ b/tests/virtconvtest.py
@@ -18,8 +18,8 @@
from __future__ import print_function
import glob
+import io
import os
-import StringIO
import unittest
from virtconv import VirtConverter
@@ -32,7 +32,7 @@ out_dir = base_dir + "libvirt_output"
class TestVirtConv(unittest.TestCase):
def _convert_helper(self, infile, outfile, in_type, disk_format):
- outbuf = StringIO.StringIO()
+ outbuf = io.BytesIO()
def print_cb(msg):
print(msg, file=outbuf)
diff --git a/virtManager/create.py b/virtManager/create.py
index 8b4d75d..5629396 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -18,10 +18,10 @@
# MA 02110-1301 USA.
#
+import io
import logging
import pkgutil
import os
-import cStringIO
import threading
import time
@@ -2633,7 +2633,7 @@ class vmmCreate(vmmGObjectUI):
return True
# Use string buffer to store log messages
- log_stream = cStringIO.StringIO()
+ log_stream = io.StringIO()
# Get virt-bootstrap logger
vbLogger = logging.getLogger('virtBootstrap')
diff --git a/virtManager/snapshots.py b/virtManager/snapshots.py
index eeb1a9f..0d905e3 100644
--- a/virtManager/snapshots.py
+++ b/virtManager/snapshots.py
@@ -20,9 +20,9 @@
import datetime
import glob
+import io
import logging
import os
-import StringIO
from gi.repository import Gdk
from gi.repository import GdkPixbuf
@@ -394,7 +394,7 @@ class vmmSnapshotPage(vmmGObjectUI):
flags = 0
mime = self.vm.get_backend().screenshot(stream, screen, flags)
- ret = StringIO.StringIO()
+ ret = io.StringIO()
def _write_cb(_stream, data, userdata):
ignore = stream
ignore = userdata
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index c57c9e1..ebc5c7a 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -21,11 +21,11 @@
import ConfigParser
import ftplib
+import io
import logging
import os
import re
import stat
-import StringIO
import subprocess
import tempfile
import urllib2
@@ -169,7 +169,7 @@ class _URLFetcher(object):
"""
Grab the passed filename from self.location and return it as a string
"""
- fileobj = StringIO.StringIO()
+ fileobj = io.StringIO()
self._grabURL(filename, fileobj)
return fileobj.getvalue()

View File

@ -1,458 +0,0 @@
Subject: pycodestyle: fix all E125 warnings
From: Chen Hanxiao chenhanxiao@gmail.com Wed Sep 20 15:36:27 2017 +0800
Date: Sat Oct 21 23:26:16 2017 +0800:
Git: 7f1b4cee822855f683b8f38f38c6b1483911a5a5
Fix all E125:
Continuation line with same indent as next logical line
Also remove ignore options of E125
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
diff --git a/tests/pycodestyle.cfg b/tests/pycodestyle.cfg
index 4ba9cf60..a2ccb552 100644
--- a/tests/pycodestyle.cfg
+++ b/tests/pycodestyle.cfg
@@ -9,7 +9,6 @@ format = pylint
# E122: Continuation line missing indentation or outdented
# E123: Closing bracket does not match indentation of opening
# bracket's line
-# E125: Continuation line with same indent as next logical line
# E126: Continuation line over-indented for hanging indent
# E127: Continuation line over-indented for visual indent
# E128: Continuation line under-indented for visual indent
@@ -25,4 +24,4 @@ format = pylint
# E741: Do not use variables named l, O, or I
-ignore = E122, E123, E125, E126, E127, E128, E129, E221, E241, E301, E303, E305, E306, E402, E501, E741
+ignore = E122, E123, E126, E127, E128, E129, E221, E241, E301, E303, E305, E306, E402, E501, E741
diff --git a/virt-xml b/virt-xml
index 59d6c4fe..750498b6 100755
--- a/virt-xml
+++ b/virt-xml
@@ -256,7 +256,7 @@ def setup_device(dev):
def define_changes(conn, inactive_xmlobj, devs, action, confirm):
if confirm:
if not prompt_yes_or_no(
- _("Define '%s' with the changed XML?") % inactive_xmlobj.name):
+ _("Define '%s' with the changed XML?") % inactive_xmlobj.name):
return False
if action == "hotplug":
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 0f7e20db..c98fff3d 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -539,13 +539,13 @@ class vmmConnection(vmmGObject):
inact = 0
if self.check_support(
- self._backend.SUPPORT_DOMAIN_XML_INACTIVE, vm):
+ self._backend.SUPPORT_DOMAIN_XML_INACTIVE, vm):
inact = libvirt.VIR_DOMAIN_XML_INACTIVE
else:
logging.debug("Domain XML inactive flag not supported.")
if self.check_support(
- self._backend.SUPPORT_DOMAIN_XML_SECURE, vm):
+ self._backend.SUPPORT_DOMAIN_XML_SECURE, vm):
inact |= libvirt.VIR_DOMAIN_XML_SECURE
act = libvirt.VIR_DOMAIN_XML_SECURE
else:
@@ -563,7 +563,7 @@ class vmmConnection(vmmGObject):
inact = 0
if self.check_support(
- self._backend.SUPPORT_INTERFACE_XML_INACTIVE, iface):
+ self._backend.SUPPORT_INTERFACE_XML_INACTIVE, iface):
inact = libvirt.VIR_INTERFACE_XML_INACTIVE
else:
logging.debug("Interface XML inactive flag not supported.")
diff --git a/virtManager/details.py b/virtManager/details.py
index aeac7fd3..a51f5623 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -1129,12 +1129,12 @@ class vmmDetails(vmmGObjectUI):
return False
if not self.err.chkbox_helper(
- self.config.get_confirm_unapplied,
- self.config.set_confirm_unapplied,
- text1=(_("There are unapplied changes. Would you like to apply "
- "them now?")),
- chktext=_("Don't warn me again."),
- default=False):
+ self.config.get_confirm_unapplied,
+ self.config.set_confirm_unapplied,
+ text1=(_("There are unapplied changes. Would you like to apply "
+ "them now?")),
+ chktext=_("Don't warn me again."),
+ default=False):
return False
return not self.config_apply(row=row)
@@ -2275,8 +2275,8 @@ class vmmDetails(vmmGObjectUI):
logging.debug("Removing device: %s", devobj)
if not self.err.chkbox_helper(self.config.get_confirm_removedev,
- self.config.set_confirm_removedev,
- text1=(_("Are you sure you want to remove this device?"))):
+ self.config.set_confirm_removedev,
+ text1=(_("Are you sure you want to remove this device?"))):
return
# Define the change
diff --git a/virtManager/domain.py b/virtManager/domain.py
index 1b278815..a1f59e38 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -500,7 +500,7 @@ class vmmDomain(vmmLibvirtObject):
def snapshots_supported(self):
if not self.conn.check_support(
- self.conn.SUPPORT_DOMAIN_LIST_SNAPSHOTS, self._backend):
+ self.conn.SUPPORT_DOMAIN_LIST_SNAPSHOTS, self._backend):
return _("Libvirt connection does not support snapshots.")
if self.list_snapshots():
@@ -644,8 +644,8 @@ class vmmDomain(vmmLibvirtObject):
self._redefine_xmlobj(xmlobj)
def define_cpu(self, vcpus=_SENTINEL, maxvcpus=_SENTINEL,
- model=_SENTINEL, sockets=_SENTINEL,
- cores=_SENTINEL, threads=_SENTINEL):
+ model=_SENTINEL, sockets=_SENTINEL,
+ cores=_SENTINEL, threads=_SENTINEL):
guest = self._make_xmlobj_to_define()
if vcpus != _SENTINEL:
@@ -675,8 +675,8 @@ class vmmDomain(vmmLibvirtObject):
self._redefine_xmlobj(guest)
def define_overview(self, machine=_SENTINEL, description=_SENTINEL,
- title=_SENTINEL, idmap_list=_SENTINEL, loader=_SENTINEL,
- nvram=_SENTINEL):
+ title=_SENTINEL, idmap_list=_SENTINEL, loader=_SENTINEL,
+ nvram=_SENTINEL):
guest = self._make_xmlobj_to_define()
if machine != _SENTINEL:
guest.os.machine = machine
@@ -720,8 +720,8 @@ class vmmDomain(vmmLibvirtObject):
self._redefine_xmlobj(guest)
def define_boot(self, boot_order=_SENTINEL, boot_menu=_SENTINEL,
- kernel=_SENTINEL, initrd=_SENTINEL, dtb=_SENTINEL,
- kernel_args=_SENTINEL, init=_SENTINEL, initargs=_SENTINEL):
+ kernel=_SENTINEL, initrd=_SENTINEL, dtb=_SENTINEL,
+ kernel_args=_SENTINEL, init=_SENTINEL, initargs=_SENTINEL):
guest = self._make_xmlobj_to_define()
def _change_boot_order():
@@ -776,10 +776,10 @@ class vmmDomain(vmmLibvirtObject):
######################
def define_disk(self, devobj, do_hotplug,
- path=_SENTINEL, readonly=_SENTINEL, serial=_SENTINEL,
- shareable=_SENTINEL, removable=_SENTINEL, cache=_SENTINEL,
- io=_SENTINEL, driver_type=_SENTINEL, bus=_SENTINEL, addrstr=_SENTINEL,
- sgio=_SENTINEL):
+ path=_SENTINEL, readonly=_SENTINEL, serial=_SENTINEL,
+ shareable=_SENTINEL, removable=_SENTINEL, cache=_SENTINEL,
+ io=_SENTINEL, driver_type=_SENTINEL, bus=_SENTINEL, addrstr=_SENTINEL,
+ sgio=_SENTINEL):
xmlobj = self._make_xmlobj_to_define()
editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
if not editdev:
@@ -844,11 +844,11 @@ class vmmDomain(vmmLibvirtObject):
self._redefine_xmlobj(xmlobj)
def define_network(self, devobj, do_hotplug,
- ntype=_SENTINEL, source=_SENTINEL,
- mode=_SENTINEL, model=_SENTINEL, addrstr=_SENTINEL,
- vtype=_SENTINEL, managerid=_SENTINEL, typeid=_SENTINEL,
- typeidversion=_SENTINEL, instanceid=_SENTINEL,
- portgroup=_SENTINEL, macaddr=_SENTINEL):
+ ntype=_SENTINEL, source=_SENTINEL,
+ mode=_SENTINEL, model=_SENTINEL, addrstr=_SENTINEL,
+ vtype=_SENTINEL, managerid=_SENTINEL, typeid=_SENTINEL,
+ typeidversion=_SENTINEL, instanceid=_SENTINEL,
+ portgroup=_SENTINEL, macaddr=_SENTINEL):
xmlobj = self._make_xmlobj_to_define()
editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
if not editdev:
@@ -884,9 +884,9 @@ class vmmDomain(vmmLibvirtObject):
self._redefine_xmlobj(xmlobj)
def define_graphics(self, devobj, do_hotplug,
- listen=_SENTINEL, addr=_SENTINEL, port=_SENTINEL, tlsport=_SENTINEL,
- passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL,
- gl=_SENTINEL, rendernode=_SENTINEL):
+ listen=_SENTINEL, addr=_SENTINEL, port=_SENTINEL, tlsport=_SENTINEL,
+ passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL,
+ gl=_SENTINEL, rendernode=_SENTINEL):
xmlobj = self._make_xmlobj_to_define()
editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
if not editdev:
@@ -964,7 +964,7 @@ class vmmDomain(vmmLibvirtObject):
self._redefine_xmlobj(xmlobj)
def define_watchdog(self, devobj, do_hotplug,
- model=_SENTINEL, action=_SENTINEL):
+ model=_SENTINEL, action=_SENTINEL):
xmlobj = self._make_xmlobj_to_define()
editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
if not editdev:
@@ -1109,7 +1109,7 @@ class vmmDomain(vmmLibvirtObject):
self._backend.updateDeviceFlags(xml, flags)
def hotplug(self, vcpus=_SENTINEL, memory=_SENTINEL, maxmem=_SENTINEL,
- description=_SENTINEL, title=_SENTINEL, device=_SENTINEL):
+ description=_SENTINEL, title=_SENTINEL, device=_SENTINEL):
if not self.is_active():
return
@@ -1570,7 +1570,7 @@ class vmmDomain(vmmLibvirtObject):
def migrate(self, destconn, dest_uri=None,
- tunnel=False, unsafe=False, temporary=False, meter=None):
+ tunnel=False, unsafe=False, temporary=False, meter=None):
self._install_abort = True
flags = 0
diff --git a/virtManager/engine.py b/virtManager/engine.py
index 537d1c91..d8f86e38 100644
--- a/virtManager/engine.py
+++ b/virtManager/engine.py
@@ -1075,8 +1075,8 @@ class vmmEngine(vmmGObject):
vm = conn.get_vm(connkey)
if not src.err.chkbox_helper(self.config.get_confirm_poweroff,
- self.config.set_confirm_poweroff,
- text1=_("Are you sure you want to save '%s'?") % vm.get_name()):
+ self.config.set_confirm_poweroff,
+ text1=_("Are you sure you want to save '%s'?") % vm.get_name()):
return
_cancel_cb = None
diff --git a/virtManager/netlist.py b/virtManager/netlist.py
index 0bb17965..bd53af56 100644
--- a/virtManager/netlist.py
+++ b/virtManager/netlist.py
@@ -129,7 +129,7 @@ class vmmNetworkList(vmmGObjectUI):
return ret
def _build_source_row(self, nettype, source_name,
- label, is_sensitive, is_running, manual_bridge=False, key=None):
+ label, is_sensitive, is_running, manual_bridge=False, key=None):
return [nettype, source_name, label,
is_sensitive, is_running, manual_bridge,
key]
diff --git a/virtManager/viewers.py b/virtManager/viewers.py
index df164f59..07a7435f 100644
--- a/virtManager/viewers.py
+++ b/virtManager/viewers.py
@@ -625,7 +625,7 @@ class SpiceViewer(Viewer):
self._main_channel_hids.append(hid)
elif (type(channel) == SpiceClientGLib.DisplayChannel and
- not self._display):
+ not self._display):
channel_id = channel.get_property("channel-id")
if channel_id != 0:
@@ -640,7 +640,7 @@ class SpiceViewer(Viewer):
elif (type(channel) in [SpiceClientGLib.PlaybackChannel,
SpiceClientGLib.RecordChannel] and
- not self._audio):
+ not self._audio):
self._audio = SpiceClientGLib.Audio.get(self._spice_session, None)
def _agent_connected_cb(self, src, val):
diff --git a/virtManager/vmmenu.py b/virtManager/vmmenu.py
index bb233609..153c8524 100644
--- a/virtManager/vmmenu.py
+++ b/virtManager/vmmenu.py
@@ -96,7 +96,7 @@ class VMShutdownMenu(_VMMenu):
if name == "reset":
child.set_tooltip_text(None)
if vm and not vm.conn.check_support(
- vm.conn.SUPPORT_CONN_DOMAIN_RESET):
+ vm.conn.SUPPORT_CONN_DOMAIN_RESET):
child.set_tooltip_text(_("Hypervisor does not support "
"domain reset."))
child.set_sensitive(False)
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 2d1c33e5..cfe5ff07 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -486,8 +486,8 @@ def get_console_cb(guest):
gtype = gdevs[0].type
if gtype not in ["default",
- VirtualGraphics.TYPE_VNC,
- VirtualGraphics.TYPE_SPICE]:
+ VirtualGraphics.TYPE_VNC,
+ VirtualGraphics.TYPE_SPICE]:
logging.debug("No viewer to launch for graphics type '%s'", gtype)
return
diff --git a/virtinst/devicegraphics.py b/virtinst/devicegraphics.py
index dc6919e9..ffba36d9 100644
--- a/virtinst/devicegraphics.py
+++ b/virtinst/devicegraphics.py
@@ -242,7 +242,7 @@ class VirtualGraphics(VirtualDevice):
self.socket = None
if self.conn.check_support(
- self.conn.SUPPORT_CONN_GRAPHICS_LISTEN_NONE):
+ self.conn.SUPPORT_CONN_GRAPHICS_LISTEN_NONE):
obj = self.add_listen()
obj.type = "none"
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index 3629afe1..be2281a6 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -81,7 +81,7 @@ class DomainCapabilities(XMLBuilder):
def build_from_params(conn, emulator, arch, machine, hvtype):
xml = None
if conn.check_support(
- conn.SUPPORT_CONN_DOMAIN_CAPABILITIES):
+ conn.SUPPORT_CONN_DOMAIN_CAPABILITIES):
try:
xml = conn.getDomainCapabilities(emulator, arch,
machine, hvtype)
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 143a36f2..eaf83ffc 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -690,7 +690,7 @@ class Guest(XMLBuilder):
if usb2:
if not self.conn.check_support(
- self.conn.SUPPORT_CONN_DEFAULT_USB2):
+ self.conn.SUPPORT_CONN_DEFAULT_USB2):
return
for dev in VirtualController.get_usb2_controllers(self.conn):
self.add_device(dev)
@@ -830,7 +830,7 @@ class Guest(XMLBuilder):
if not self.os.is_x86():
return
if not self.conn.check_support(
- self.conn.SUPPORT_CONN_ADVANCED_CLOCK):
+ self.conn.SUPPORT_CONN_ADVANCED_CLOCK):
return
# Set clock policy that maps to qemu options:
diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index 429f8005..c173554b 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -300,7 +300,7 @@ class _OsVariant(object):
########################
def _is_related_to(self, related_os_list, os=None,
- check_derives=True, check_upgrades=True, check_clones=True):
+ check_derives=True, check_upgrades=True, check_clones=True):
os = os or self._os
if not os:
return False
diff --git a/virtinst/pollhelpers.py b/virtinst/pollhelpers.py
index fd156bb9..64cdb32c 100644
--- a/virtinst/pollhelpers.py
+++ b/virtinst/pollhelpers.py
@@ -115,7 +115,7 @@ def fetch_nets(backend, origmap, build_func):
name = "network"
if backend.check_support(
- backend.SUPPORT_CONN_LISTALLNETWORKS) and not FORCE_OLD_POLL:
+ backend.SUPPORT_CONN_LISTALLNETWORKS) and not FORCE_OLD_POLL:
return _new_poll_helper(origmap, name,
backend.listAllNetworks, build_func)
else:
@@ -132,7 +132,7 @@ def fetch_pools(backend, origmap, build_func):
name = "pool"
if backend.check_support(
- backend.SUPPORT_CONN_LISTALLSTORAGEPOOLS) and not FORCE_OLD_POLL:
+ backend.SUPPORT_CONN_LISTALLSTORAGEPOOLS) and not FORCE_OLD_POLL:
return _new_poll_helper(origmap, name,
backend.listAllStoragePools, build_func)
else:
@@ -149,7 +149,7 @@ def fetch_volumes(backend, pool, origmap, build_func):
name = "volume"
if backend.check_support(
- backend.SUPPORT_POOL_LISTALLVOLUMES, pool) and not FORCE_OLD_POLL:
+ backend.SUPPORT_POOL_LISTALLVOLUMES, pool) and not FORCE_OLD_POLL:
return _new_poll_helper(origmap, name,
pool.listAllVolumes, build_func)
else:
@@ -166,7 +166,7 @@ def fetch_interfaces(backend, origmap, build_func):
name = "interface"
if backend.check_support(
- backend.SUPPORT_CONN_LISTALLINTERFACES) and not FORCE_OLD_POLL:
+ backend.SUPPORT_CONN_LISTALLINTERFACES) and not FORCE_OLD_POLL:
return _new_poll_helper(origmap, name,
backend.listAllInterfaces, build_func)
else:
@@ -182,7 +182,7 @@ def fetch_interfaces(backend, origmap, build_func):
def fetch_nodedevs(backend, origmap, build_func):
name = "nodedev"
if backend.check_support(
- backend.SUPPORT_CONN_LISTALLDEVICES) and not FORCE_OLD_POLL:
+ backend.SUPPORT_CONN_LISTALLDEVICES) and not FORCE_OLD_POLL:
return _new_poll_helper(origmap, name,
backend.listAllDevices, build_func)
else:
@@ -278,7 +278,7 @@ def _old_fetch_vms(backend, origmap, build_func):
def fetch_vms(backend, origmap, build_func):
name = "domain"
if backend.check_support(
- backend.SUPPORT_CONN_LISTALLDOMAINS):
+ backend.SUPPORT_CONN_LISTALLDOMAINS):
return _new_poll_helper(origmap, name,
backend.listAllDomains, build_func)
else:
diff --git a/virtinst/storage.py b/virtinst/storage.py
index 3f1bd9f5..254e7ff6 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -375,8 +375,8 @@ class StoragePool(_StorageObject):
elif self.type == StoragePool.TYPE_GLUSTER:
srcname = "gv0"
elif ("target_path" in self._propstore and
- self.target_path and
- self.target_path.startswith(_DEFAULT_LVM_TARGET_BASE)):
+ self.target_path and
+ self.target_path.startswith(_DEFAULT_LVM_TARGET_BASE)):
# If there is a target path, parse it for an expected VG
# location, and pull the name from there
vg = self.target_path[len(_DEFAULT_LVM_TARGET_BASE):]
@@ -642,7 +642,7 @@ class StorageVolume(_StorageObject):
raise ValueError(_("input_vol must be a virStorageVol"))
if not self.conn.check_support(
- self.conn.SUPPORT_POOL_CREATEVOLFROM, self.pool):
+ self.conn.SUPPORT_POOL_CREATEVOLFROM, self.pool):
raise ValueError(_("Creating storage from an existing volume is"
" not supported by this libvirt version."))
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index ebc5c7a4..a45c6383 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -448,7 +448,7 @@ def _distroFromSUSEContent(fetcher, arch, vmtype=None):
dclass = GenericDistro
if distribution:
if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
- re.match(".*SUSE SLES*", distribution[1]):
+ re.match(".*SUSE SLES*", distribution[1]):
dclass = SLESDistro
if distro_version is None:
distro_version = _parse_sle_distribution(distribution)

View File

@ -1,43 +0,0 @@
Subject: addhardware: Fix virtio-scsi controller target calculation
From: Cole Robinson crobinso@redhat.com Wed Nov 22 14:58:12 2017 -0500
Date: Wed Nov 22 16:50:33 2017 -0500:
Git: 7fc7e94f211676b9a958662cb93edf770f23273c
More details here: https://www.redhat.com/archives/virt-tools-list/2017-November/msg00014.html
Reported-by: Lin Ma <lma@suse.com>
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index cd82cd3..4a962e6 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -20,7 +20,6 @@
import logging
import traceback
-import collections
from gi.repository import Gtk
from gi.repository import Gdk
@@ -1455,13 +1454,18 @@ class vmmAddHardware(vmmGObjectUI):
if x.model == controller_model]
# Save occupied places per controller
- occupied = collections.defaultdict(int)
+ occupied = {}
for d in used_disks:
if d.get_target_prefix() == disk.get_target_prefix():
num = virtinst.VirtualDisk.target_to_num(d.target)
- occupied[num / 7] += 1
+ idx = num // 7
+ if idx not in occupied:
+ occupied[idx] = []
+ if d.target not in occupied[idx]:
+ occupied[idx].append(d.target)
+
for c in ctrls_scsi:
- if occupied[c.index] < 7:
+ if c.index not in occupied or len(occupied[c.index]) < 7:
controller = c
break
else:

View File

@ -1,19 +0,0 @@
Subject: cli: Fix OrderedDict mutated during iteration on python3
From: Cole Robinson crobinso@redhat.com Fri Oct 20 15:09:01 2017 -0400
Date: Fri Oct 20 16:13:04 2017 -0400:
Git: 91c0669cf621b199ece533ac756bd346900a1474
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 1b86cad5..086aa0e0 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1482,7 +1482,7 @@ class ParserCPU(VirtCLIParser):
def _parse(self, inst):
# Convert +feature, -feature into expected format
- for key, value in self.optdict.items():
+ for key, value in list(self.optdict.items()):
policy = None
if value or len(key) == 1:
continue

View File

@ -1,23 +0,0 @@
Subject: systray: Use APPLICATION_STATUS for appindicator
From: Cole Robinson crobinso@redhat.com Wed Oct 18 18:50:42 2017 -0400
Date: Wed Oct 18 19:14:17 2017 -0400:
Git: 9617d1267dfb283b6a13762f7c03d391b644db84
Not OTHER, as the reporter points out this shouldn't be used, and
causes issues on KDE
https://bugzilla.redhat.com/show_bug.cgi?id=1501173
diff --git a/virtManager/systray.py b/virtManager/systray.py
index bbe5119c..ff550738 100644
--- a/virtManager/systray.py
+++ b/virtManager/systray.py
@@ -139,7 +139,7 @@ class vmmSystray(vmmGObject):
# pylint: disable=maybe-no-member
self.systray_icon = AppIndicator3.Indicator.new("virt-manager",
"virt-manager",
- AppIndicator3.IndicatorCategory.OTHER)
+ AppIndicator3.IndicatorCategory.APPLICATION_STATUS)
self.systray_icon.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
self.systray_icon.set_menu(self.systray_menu)

View File

@ -1,215 +0,0 @@
Subject: cli: Make _VirtCLIArgument instantiation less crazy
From: Cole Robinson crobinso@redhat.com Fri Oct 20 16:47:56 2017 -0400
Date: Fri Oct 20 17:07:19 2017 -0400:
Git: 999dbb3665fb1cf7d6466dc53583a020b644e522
Motivation is that the other way had changed behavior with python3
which breaks things
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 086aa0e0..2d1c33e5 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -805,10 +805,10 @@ def _set_attribute(obj, attr, val): # pylint: disable=unused-argument
exec("obj." + attr + " = val ") # pylint: disable=exec-used
-class _VirtCLIArgument(object):
+class _VirtCLIArgumentStatic(object):
"""
- A single subargument passed to compound command lines like --disk,
- --network, etc.
+ Helper class to hold all of the static data we need for knowing
+ how to parse a cli subargument, like --disk path=, or --network mac=.
@attrname: The virtinst API attribute name the cliargument maps to.
If this is a virtinst object method, it will be called.
@@ -838,66 +838,64 @@ class _VirtCLIArgument(object):
VirtualDisk has multiple seclabel children, this provides a hook
to lookup the specified child object.
"""
- attrname = None
- cliname = None
- cb = None
- can_comma = None
- ignore_default = False
- aliases = None
- is_list = False
- is_onoff = False
- lookup_cb = None
- is_novalue = False
- find_inst_cb = None
-
- @staticmethod
- def make_arg(attrname, cliname, **kwargs):
- """
- Generates a new VirtCLIArgument class with the passed static
- values. Initialize it later with the actual command line and value.
- kwargs can be any of the
- """
- class VirtAddArg(_VirtCLIArgument):
- pass
-
- VirtAddArg.attrname = attrname
- VirtAddArg.cliname = cliname
- for key, val in kwargs.items():
- # getattr for validation
- getattr(VirtAddArg, key)
- setattr(VirtAddArg, key, val)
- return VirtAddArg
-
- @classmethod
- def match_name(cls, cliname):
+ def __init__(self, attrname, cliname,
+ cb=None, can_comma=None,
+ ignore_default=False, aliases=None,
+ is_list=False, is_onoff=False,
+ lookup_cb=None, is_novalue=False,
+ find_inst_cb=None):
+ self.attrname = attrname
+ self.cliname = cliname
+ self.cb = cb
+ self.can_comma = can_comma
+ self.ignore_default = ignore_default
+ self.aliases = aliases
+ self.is_list = is_list
+ self.is_onoff = is_onoff
+ self.lookup_cb = lookup_cb
+ self.is_novalue = is_novalue
+ self.find_inst_cb = find_inst_cb
+
+ def match_name(self, cliname):
"""
Return True if the passed argument name matches this
VirtCLIArgument. So for an option like --foo bar=X, this
checks if we are the parser for 'bar'
"""
- for argname in [cls.cliname] + util.listify(cls.aliases):
+ for argname in [self.cliname] + util.listify(self.aliases):
if re.match("^%s$" % argname, cliname):
return True
return False
- def __init__(self, key, val):
+class _VirtCLIArgument(object):
+ """
+ A class that combines the static parsing data _VirtCLIArgumentStatic
+ with actual values passed on the command line.
+ """
+
+ def __init__(self, virtarg, key, val):
"""
Instantiate a VirtCLIArgument with the actual key=val pair
from the command line.
"""
# Sanitize the value
if val is None:
- if not self.is_novalue:
+ if not virtarg.is_novalue:
raise RuntimeError("Option '%s' had no value set." % key)
val = ""
if val == "":
val = None
- if self.is_onoff:
+ if virtarg.is_onoff:
val = _on_off_convert(key, val)
self.val = val
self.key = key
+ self._virtarg = virtarg
+
+ # For convenience
+ self.attrname = virtarg.attrname
+ self.cliname = virtarg.cliname
def parse_param(self, parser, inst, support_cb):
"""
@@ -909,12 +907,12 @@ class _VirtCLIArgument(object):
"""
if support_cb:
support_cb(inst, self)
- if self.val == "default" and self.ignore_default:
+ if self.val == "default" and self._virtarg.ignore_default:
return
- if self.find_inst_cb:
- inst = self.find_inst_cb(parser, # pylint: disable=not-callable
- inst, self.val, self, True)
+ if self._virtarg.find_inst_cb:
+ inst = self._virtarg.find_inst_cb(parser,
+ inst, self.val, self, True)
try:
if self.attrname:
@@ -923,9 +921,8 @@ class _VirtCLIArgument(object):
raise RuntimeError("programming error: obj=%s does not have "
"member=%s" % (inst, self.attrname))
- if self.cb:
- self.cb(parser, inst, # pylint: disable=not-callable
- self.val, self)
+ if self._virtarg.cb:
+ self._virtarg.cb(parser, inst, self.val, self)
else:
_set_attribute(inst, self.attrname, self.val)
@@ -938,22 +935,22 @@ class _VirtCLIArgument(object):
instantiated with key=device val=floppy, so return
'inst.device == floppy'
"""
- if not self.attrname and not self.lookup_cb:
+ if not self.attrname and not self._virtarg.lookup_cb:
raise RuntimeError(
_("Don't know how to match device type '%(device_type)s' "
"property '%(property_name)s'") %
{"device_type": getattr(inst, "virtual_device_type", ""),
"property_name": self.key})
- if self.find_inst_cb:
- inst = self.find_inst_cb(parser, # pylint: disable=not-callable
- inst, self.val, self, False)
+ if self._virtarg.find_inst_cb:
+ inst = self._virtarg.find_inst_cb(parser,
+ inst, self.val, self, False)
if not inst:
return False
- if self.lookup_cb:
- return self.lookup_cb(parser, # pylint: disable=not-callable
- inst, self.val, self)
+ if self._virtarg.lookup_cb:
+ return self._virtarg.lookup_cb(parser,
+ inst, self.val, self)
else:
return eval( # pylint: disable=eval-used
"inst." + self.attrname) == self.val
@@ -1095,9 +1092,9 @@ class VirtCLIParser(object):
Add a VirtCLIArgument for this class.
"""
if not cls._virtargs:
- cls._virtargs = [_VirtCLIArgument.make_arg(
+ cls._virtargs = [_VirtCLIArgumentStatic(
None, "clearxml", cb=cls._clearxml_cb, is_onoff=True)]
- cls._virtargs.append(_VirtCLIArgument.make_arg(*args, **kwargs))
+ cls._virtargs.append(_VirtCLIArgumentStatic(*args, **kwargs))
@classmethod
def print_introspection(cls):
@@ -1147,10 +1144,12 @@ class VirtCLIParser(object):
VirtCLIArguments to actually interact with
"""
ret = []
- for param in self._virtargs:
- for key in optdict.keys():
- if param.match_name(key):
- ret.append(param(key, optdict.pop(key)))
+ for virtargstatic in self._virtargs:
+ for key in list(optdict.keys()):
+ if virtargstatic.match_name(key):
+ arginst = _VirtCLIArgument(virtargstatic,
+ key, optdict.pop(key))
+ ret.append(arginst)
return ret
def _check_leftover_opts(self, optdict):

View File

@ -1,30 +0,0 @@
Subject: virtinst: ignore comments in keymap conf files
From: Jim Fehlig jfehlig@suse.com Wed Oct 11 15:13:26 2017 -0600
Date: Wed Oct 18 17:46:41 2017 -0400:
Git: 9a9f9ecd2c1f03665809009ad6cfde937b09adaa
On a host system with keyboard configured to en-US, it was noticed
that virt-install created install XML with keymap='de'. The host
system did not have /etc/vconsole.conf, so /etc/sysconfig/keyboard
was the next file to check, which contained the following
KEYTABLE=""
Currently the parsing code does not ignore comments and incorrectly
parsed a 'de' keymap. Fix by ignoring any lines that start with '#'
after trimming whitespace.
diff --git a/virtinst/hostkeymap.py b/virtinst/hostkeymap.py
index 71503730..87a80ef6 100644
--- a/virtinst/hostkeymap.py
+++ b/virtinst/hostkeymap.py
@@ -71,6 +71,9 @@ def _sysconfig_keyboard(f):
s = f.readline()
if s == "":
break
+ s = s.strip()
+ if s.startswith("#"):
+ continue
if (re.search("KEYMAP", s) is not None or
re.search("KEYTABLE", s) is not None or
(re.search("KEYBOARD", s) is not None and

View File

@ -1,49 +0,0 @@
Subject: Do not compare between None and int
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:54 2017 +0100
Date: Fri Oct 20 13:18:31 2017 -0400:
Git: a2bcd6c43a77b03693d11d231e8c0a7b0609889b
In Python 2 comparison between int and None is allowed but in
Pyhton 3 it is not.
Example:
Pyhton 2
>>> None > 0
False
Python 3
>>> None > 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '>' not supported between instances of 'NoneType' and 'int'
diff --git a/tests/utils.py b/tests/utils.py
index 7397d369..e9072bf4 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -181,7 +181,7 @@ def diff_compare(actual_out, filename=None, expect_out=None):
diff = "".join(difflib.unified_diff(expect_out.splitlines(1),
actual_out.splitlines(1),
- fromfile=filename,
+ fromfile=filename or '',
tofile="Generated Output"))
if diff:
raise AssertionError("Conversion outputs did not match.\n%s" % diff)
diff --git a/virtinst/support.py b/virtinst/support.py
index 19160fba..6b0489a5 100644
--- a/virtinst/support.py
+++ b/virtinst/support.py
@@ -187,7 +187,8 @@ class _SupportCheck(object):
actual_hv_version = conn.conn_version()
# Check that local libvirt version is sufficient
- if _version_str_to_int(self.version) > actual_libvirt_version:
+ v = _version_str_to_int(self.version)
+ if v and (v > actual_libvirt_version):
return False
if self.hv_version:

View File

@ -1,24 +0,0 @@
Subject: baseclass: Fix UI file loading on py3
From: Cole Robinson crobinso@redhat.com Wed Dec 20 16:04:36 2017 -0500
Date: Wed Dec 20 16:04:36 2017 -0500:
Git: b5b2433ad5578767abd2552e3c635c939511db83
We were passing in a unicode string object, but add_from_string
depends on knowing binary length. This caused signals to not
be registered which broke reopening the details window
Just switch to add_from_file to sidestep the issue
diff --git a/virtManager/baseclass.py b/virtManager/baseclass.py
index f8bff2b..c2f1ecd 100644
--- a/virtManager/baseclass.py
+++ b/virtManager/baseclass.py
@@ -220,7 +220,7 @@ class vmmGObjectUI(vmmGObject):
self.builder = Gtk.Builder()
self.builder.set_translation_domain("virt-manager")
- self.builder.add_from_string(open(uifile).read())
+ self.builder.add_from_file(uifile)
if not topwin:
self.topwin = self.widget(windowname)

View File

@ -1,37 +0,0 @@
Subject: xmlnsqemu: Order XML output like libvirt does
From: Cole Robinson crobinso@redhat.com Fri Oct 20 15:26:03 2017 -0400
Date: Fri Oct 20 16:13:04 2017 -0400:
Git: b8fa0c6b6769663837079084b6ff93da243d52a1
args before env
diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index 87855238..2873a65b 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -386,12 +386,12 @@
</panic>
</devices>
<qemu:commandline>
- <qemu:env name="DISPLAY" value=":0.1"/>
<qemu:arg value="-display"/>
<qemu:arg value="gtk,gl=on"/>
<qemu:arg value="-device"/>
<qemu:arg value="vfio-pci,addr=05.0,sysfsdev=/sys/class/mdev_bus/0000:00:02.0/f321853c-c584-4a6b-b99a-3eee22a3919c"/>
<qemu:arg value="-set"/>
<qemu:arg value="device.video0.driver=virtio-vga"/>
+ <qemu:env name="DISPLAY" value=":0.1"/>
</qemu:commandline>
</domain>
diff --git a/virtinst/xmlnsqemu.py b/virtinst/xmlnsqemu.py
index 28259bf2..5213e5d1 100644
--- a/virtinst/xmlnsqemu.py
+++ b/virtinst/xmlnsqemu.py
@@ -37,6 +37,7 @@ class XMLNSQemu(XMLBuilder):
Class for generating <qemu:commandline> XML
"""
_XML_ROOT_NAME = "qemu:commandline"
+ _XML_PROP_ORDER = ["args", "envs"]
args = XMLChildProperty(_XMLNSQemuArg)
def add_arg(self, value):

View File

@ -1,47 +0,0 @@
Subject: delete: undefine only persistent domain
From: Pavel Hrdina phrdina@redhat.com Fri Nov 24 17:26:59 2017 +0100
Date: Fri Nov 24 17:39:58 2017 +0100:
Git: b9bc3b605a96920d3e225d472d549864205e92ce
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1517119
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtManager/delete.py b/virtManager/delete.py
index 98df413..0ebfdeb 100644
--- a/virtManager/delete.py
+++ b/virtManager/delete.py
@@ -162,6 +162,7 @@ class vmmDeleteDialog(vmmGObjectUI):
def _async_delete(self, asyncjob, paths):
storage_errors = []
details = ""
+ undefine = self.vm.is_persistent()
try:
if self.vm.is_active():
@@ -181,8 +182,9 @@ class vmmDeleteDialog(vmmGObjectUI):
"".join(traceback.format_exc())))
meter.end(0)
- logging.debug("Removing VM '%s'", self.vm.get_name())
- self.vm.delete()
+ if undefine:
+ logging.debug("Removing VM '%s'", self.vm.get_name())
+ self.vm.delete()
except Exception as e:
error = (_("Error deleting virtual machine '%s': %s") %
diff --git a/virtManager/domain.py b/virtManager/domain.py
index a1f59e3..183a56c 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -484,6 +484,9 @@ class vmmDomain(vmmLibvirtObject):
return bool(self.get_xmlobj().os.loader_ro is True and
self.get_xmlobj().os.loader_type == "pflash")
+ def is_persistent(self):
+ return bool(self._backend.isPersistent())
+
##################
# Support checks #
##################

View File

@ -1,18 +0,0 @@
Subject: progress: Remove unused import
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:43 2017 +0100
Date: Fri Oct 20 11:49:14 2017 -0400:
Git: bc3c9a9d7b0b2afcccac69182e771bf3a3eacae0
diff --git a/virtinst/progress.py b/virtinst/progress.py
index d73d4292..05114ed4 100644
--- a/virtinst/progress.py
+++ b/virtinst/progress.py
@@ -27,7 +27,6 @@
import sys
import time
import math
-import thread
import fcntl
import struct
import termios

View File

@ -1,42 +0,0 @@
Subject: cli: append "--attach" to virt-viewer if graphics has listen type none
From: Pavel Hrdina phrdina@redhat.com Fri Jan 5 09:13:45 2018 +0100
Date: Sun Jan 7 08:59:43 2018 +0100:
Git: bc8c5b0778ed633386d1ad50a107ff1b97543a4f
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1527834
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Index: virt-manager-1.4.3/virtinst/cli.py
===================================================================
--- virt-manager-1.4.3.orig/virtinst/cli.py
+++ virt-manager-1.4.3/virtinst/cli.py
@@ -442,8 +442,8 @@ def _gfx_console(guest):
"--wait", guest.name]
# Currently virt-viewer needs attaching to the local display while
- # spice gl is enabled.
- if guest.has_gl():
+ # spice gl is enabled or listen type none is used.
+ if guest.has_gl() or guest.has_listen_none():
args.append("--attach")
logging.debug("Launching virt-viewer for graphics type '%s'",
Index: virt-manager-1.4.3/virtinst/guest.py
===================================================================
--- virt-manager-1.4.3.orig/virtinst/guest.py
+++ virt-manager-1.4.3/virtinst/guest.py
@@ -1233,6 +1233,13 @@ class Guest(XMLBuilder):
if gfx.gl:
return True
+ def has_listen_none(self):
+ for gfx in self.get_devices("graphics"):
+ listen = gfx.get_first_listen_type()
+ if listen and listen == "none":
+ return True
+ return False
+
def _set_video_defaults(self):
if self.has_spice():
self._add_spice_channels()

View File

@ -1,31 +0,0 @@
From c174b5509f5007fb11e095df1c88fd6176789f4f Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Wed, 20 Dec 2017 14:15:56 -0500
Subject: [virt-manager][PATCH] connection: Another py3 exception variable fix
---
virtManager/connection.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/virtManager/connection.py b/virtManager/connection.py
index f9da6677..43fa3eb5 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -1030,11 +1030,13 @@ class vmmConnection(vmmGObject):
warnconsole = False
libvirt_error_code = None
libvirt_error_message = None
+ exc = None
try:
self._backend.open(self._do_creds_password)
return True, None
- except Exception as exc:
+ except Exception as e:
+ exc = e
tb = "".join(traceback.format_exc())
if isinstance(exc, libvirt.libvirtError):
# pylint: disable=no-member
--
2.15.1

View File

@ -1,145 +0,0 @@
Subject: progress: Remove trailing white space
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:40 2017 +0100
Date: Fri Oct 20 11:49:12 2017 -0400:
Git: d1e1cf64a7c248f586308d8c89ea51855a9a0451
diff --git a/virtinst/progress.py b/virtinst/progress.py
index a27108b1..e9a243b1 100644
--- a/virtinst/progress.py
+++ b/virtinst/progress.py
@@ -9,9 +9,9 @@
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330,
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA
# This file is part of urlgrabber, a high-level cross-protocol url-grabber
@@ -113,7 +113,7 @@ class BaseMeter:
self.last_amount_read = 0
self.last_update_time = None
self.re = RateEstimator()
-
+
def start(self, filename=None, url=None, basename=None,
size=None, now=None, text=None):
self.filename = filename
@@ -131,7 +131,7 @@ class BaseMeter:
self.last_amount_read = 0
self.last_update_time = now
self._do_start(now)
-
+
def _do_start(self, now=None):
pass
@@ -158,7 +158,7 @@ class BaseMeter:
def _do_end(self, amount_read, now=None):
pass
-
+
# This is kind of a hack, but progress is gotten from grabber which doesn't
# know about the total size to download. So we do this so we can get the data
# out of band here. This will be "fixed" one way or anther soon.
@@ -173,7 +173,7 @@ def text_meter_total_size(size, downloaded=0):
#
# update: No size (minimal: 17 chars)
# -----------------------------------
-# <text> <rate> | <current size> <elapsed time>
+# <text> <rate> | <current size> <elapsed time>
# 8-48 1 8 3 6 1 9 5
#
# Order: 1. <text>+<current size> (17)
@@ -208,7 +208,7 @@ def text_meter_total_size(size, downloaded=0):
#
# end
# ---
-# <text> | <current size> <elapsed time>
+# <text> | <current size> <elapsed time>
# 8-56 3 6 1 9 5
#
# Order: 1. <text> ( 8)
@@ -341,7 +341,7 @@ class RateEstimator:
self.last_update_time = now
self.last_amount_read = 0
self.ave_rate = None
-
+
def update(self, amount_read, now=None):
if now is None: now = time.time()
# libcurl calls the progress callback when fetching headers
@@ -365,7 +365,7 @@ class RateEstimator:
time_diff, read_diff, self.ave_rate, self.timescale)
self.last_amount_read = amount_read
#print 'results', time_diff, read_diff, self.ave_rate
-
+
#####################################################################
# result methods
def average_rate(self):
@@ -401,14 +401,14 @@ class RateEstimator:
epsilon = time_diff / timescale
if epsilon > 1: epsilon = 1.0
return self._rolling_ave(time_diff, read_diff, last_ave, epsilon)
-
+
def _rolling_ave(self, time_diff, read_diff, last_ave, epsilon):
"""perform a "rolling average" iteration
a rolling average "folds" new data into an existing average with
some weight, epsilon. epsilon must be between 0.0 and 1.0 (inclusive)
a value of 0.0 means only the old value (initial value) counts,
and a value of 1.0 means only the newest value is considered."""
-
+
try:
recent_rate = read_diff / time_diff
except ZeroDivisionError:
@@ -437,7 +437,7 @@ class RateEstimator:
rt = int(rt)
if shift <= 0: return rt
return float(int(rt) >> shift << shift)
-
+
def format_time(seconds, use_hours=0):
if seconds is None or seconds < 0:
@@ -455,7 +455,7 @@ def format_time(seconds, use_hours=0):
return '%02i:%02i:%02i' % (hours, minutes, seconds)
else:
return '%02i:%02i' % (minutes, seconds)
-
+
def format_number(number, SI=0, space=' '):
"""Turn numbers into human-readable metric-like numbers"""
symbols = ['', # (none)
@@ -467,14 +467,14 @@ def format_number(number, SI=0, space=' '):
'E', # exa
'Z', # zetta
'Y'] # yotta
-
+
if SI: step = 1000.0
else: step = 1024.0
thresh = 999
depth = 0
max_depth = len(symbols) - 1
-
+
# we want numbers between 0 and thresh, but don't exceed the length
# of our list. In that event, the formatting will be screwed up,
# but it'll still show the right number.
@@ -492,5 +492,5 @@ def format_number(number, SI=0, space=' '):
format = '%.1f%s%s'
else:
format = '%.0f%s%s'
-
+
return(format % (float(number or 0), space, symbols[depth]))

View File

@ -1,92 +0,0 @@
Subject: virtconv: Don't implicitly depend on dict hash order
From: Cole Robinson crobinso@redhat.com Fri Oct 20 16:06:48 2017 -0400
Date: Fri Oct 20 16:13:04 2017 -0400:
Git: d2648d81cc8a9c1ddb7e19b8fe44edaf53ad67ab
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
index 4cad0203..60055b7d 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
@@ -6,7 +6,6 @@
<vcpu>1</vcpu>
<os>
<type arch="x86_64">hvm</type>
- <boot dev="cdrom"/>
<boot dev="hd"/>
</os>
<features>
@@ -28,15 +27,15 @@
</pm>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
- <disk type="file" device="cdrom">
- <driver type="raw"/>
- <target dev="hda" bus="ide"/>
- <readonly/>
- </disk>
<disk type="file" device="disk">
<driver name="qemu"/>
<source file="/var/lib/libvirt/images/MS-DOS"/>
+ <target dev="hda" bus="ide"/>
+ </disk>
+ <disk type="file" device="cdrom">
+ <driver type="raw"/>
<target dev="hdb" bus="ide"/>
+ <readonly/>
</disk>
<controller type="usb" index="0" model="ich9-ehci1"/>
<controller type="usb" index="0" model="ich9-uhci1">
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
index 803a7424..e72a7184 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
@@ -6,7 +6,6 @@
<vcpu>2</vcpu>
<os>
<type arch="x86_64">hvm</type>
- <boot dev="cdrom"/>
<boot dev="hd"/>
</os>
<features>
@@ -28,15 +27,15 @@
</pm>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
- <disk type="file" device="cdrom">
- <target dev="hda" bus="ide"/>
- <readonly/>
- </disk>
<disk type="file" device="disk">
<driver name="qemu"/>
<source file="/var/lib/libvirt/images/ESX4.0-rhel4u8-32b-flat"/>
<target dev="sda" bus="scsi"/>
</disk>
+ <disk type="file" device="cdrom">
+ <target dev="hda" bus="ide"/>
+ <readonly/>
+ </disk>
<controller type="usb" index="0" model="ich9-ehci1"/>
<controller type="usb" index="0" model="ich9-uhci1">
<master startport="0"/>
diff --git a/virtconv/vmx.py b/virtconv/vmx.py
index fc6a5264..3be19e5c 100644
--- a/virtconv/vmx.py
+++ b/virtconv/vmx.py
@@ -19,6 +19,7 @@
# MA 02110-1301 USA.
#
+import collections
import logging
import os
import re
@@ -88,7 +89,7 @@ class _VMXFile(object):
(len(self.lines) + 1, line.strip(), e))
def pairs(self):
- ret = {}
+ ret = collections.OrderedDict()
for line in self.lines:
if line.pair:
ret[line.pair[0]] = line.pair[1]

View File

@ -1,69 +0,0 @@
Subject: manager: Drop python2 only cmp() usage
From: Cole Robinson crobinso@redhat.com Sat Oct 21 19:18:02 2017 -0400
Date: Sat Oct 21 19:41:33 2017 -0400:
Git: d82022bd2cc805f11eaea3dc8b506678b3fdb3d5
Manually implement it
diff --git a/virtManager/manager.py b/virtManager/manager.py
index 73fe6ea7..c257af28 100644
--- a/virtManager/manager.py
+++ b/virtManager/manager.py
@@ -66,6 +66,10 @@ def _style_get_prop(widget, propname):
return value.get_int()
+def _cmp(a, b):
+ return ((a > b) - (a < b))
+
+
def _get_inspection_icon_pixbuf(vm, w, h):
# libguestfs gives us the PNG data as a string.
png_data = vm.inspection.icon
@@ -911,40 +915,40 @@ class vmmManager(vmmGObjectUI):
def vmlist_name_sorter(self, model, iter1, iter2, ignore):
key1 = str(model[iter1][ROW_SORT_KEY]).lower()
key2 = str(model[iter2][ROW_SORT_KEY]).lower()
- return cmp(key1, key2)
+ return _cmp(key1, key2)
def vmlist_guest_cpu_usage_sorter(self, model, iter1, iter2, ignore):
obj1 = model[iter1][ROW_HANDLE]
obj2 = model[iter2][ROW_HANDLE]
- return cmp(obj1.guest_cpu_time_percentage(),
+ return _cmp(obj1.guest_cpu_time_percentage(),
obj2.guest_cpu_time_percentage())
def vmlist_host_cpu_usage_sorter(self, model, iter1, iter2, ignore):
obj1 = model[iter1][ROW_HANDLE]
obj2 = model[iter2][ROW_HANDLE]
- return cmp(obj1.host_cpu_time_percentage(),
+ return _cmp(obj1.host_cpu_time_percentage(),
obj2.host_cpu_time_percentage())
def vmlist_memory_usage_sorter(self, model, iter1, iter2, ignore):
obj1 = model[iter1][ROW_HANDLE]
obj2 = model[iter2][ROW_HANDLE]
- return cmp(obj1.stats_memory(),
+ return _cmp(obj1.stats_memory(),
obj2.stats_memory())
def vmlist_disk_io_sorter(self, model, iter1, iter2, ignore):
obj1 = model[iter1][ROW_HANDLE]
obj2 = model[iter2][ROW_HANDLE]
- return cmp(obj1.disk_io_rate(), obj2.disk_io_rate())
+ return _cmp(obj1.disk_io_rate(), obj2.disk_io_rate())
def vmlist_network_usage_sorter(self, model, iter1, iter2, ignore):
obj1 = model[iter1][ROW_HANDLE]
obj2 = model[iter2][ROW_HANDLE]
- return cmp(obj1.network_traffic_rate(), obj2.network_traffic_rate())
+ return _cmp(obj1.network_traffic_rate(), obj2.network_traffic_rate())
def enable_polling(self, column):
# pylint: disable=redefined-variable-type

View File

@ -1,53 +0,0 @@
Subject: Remove deprecated statvfs module
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:47 2017 +0100
Date: Fri Oct 20 11:49:14 2017 -0400:
Git: dff00d4fc02aa88036d0c7aa13324276fe08f14f
The statvfs module has been removed in Python 3. [1]
It is replaced by os.statvfs which is also available in Pyhton 2.
[1] https://docs.python.org/2/library/statvfs.html#module-statvfs
[2] https://docs.python.org/3/library/os.html#os.statvfs
diff --git a/virtManager/addstorage.py b/virtManager/addstorage.py
index cdfd78e1..c137e2b3 100644
--- a/virtManager/addstorage.py
+++ b/virtManager/addstorage.py
@@ -19,7 +19,6 @@
import logging
import os
-import statvfs
from gi.repository import GObject
from gi.repository import Gtk
@@ -81,7 +80,7 @@ class vmmAddStorage(vmmGObjectUI):
elif not self.conn.is_remote() and os.path.exists(path):
vfs = os.statvfs(os.path.dirname(path))
- avail = vfs[statvfs.F_FRSIZE] * vfs[statvfs.F_BAVAIL]
+ avail = vfs.f_frsize * vfs.f_bavail
return float(avail / 1024.0 / 1024.0 / 1024.0)
diff --git a/virtinst/diskbackend.py b/virtinst/diskbackend.py
index a08a23e5..636aa51f 100644
--- a/virtinst/diskbackend.py
+++ b/virtinst/diskbackend.py
@@ -22,7 +22,6 @@ import logging
import os
import re
import stat
-import statvfs
import libvirt
@@ -391,7 +390,7 @@ class CloneStorageCreator(_StorageCreator):
avail = _stat_disk(self._path)[1]
else:
vfs = os.statvfs(os.path.dirname(self._path))
- avail = vfs[statvfs.F_FRSIZE] * vfs[statvfs.F_BAVAIL]
+ avail = vfs.f_frsize * vfs.f_bavail
need = long(self._size * 1024 * 1024 * 1024)
if need > avail:
if self._sparse:

View File

@ -1,28 +0,0 @@
Subject: Convert iteritems() to items()
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:35:45 2017 +0100
Date: Fri Oct 20 11:49:14 2017 -0400:
Git: e2ad4b2fded8cb3ad23cd62b0c9d08767656ea83
In Python 2 iteritems() [1] returns an iterator over the dictionary and
items() [2] returns a list of pairs.
In Python 3 iteritems() does not exist and items() returns a view of
the dictionary's items.[3]
[1] https://docs.python.org/2/library/stdtypes.html#dict.iteritems
[2] https://docs.python.org/2/library/stdtypes.html#dict.items
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
diff --git a/virtManager/create.py b/virtManager/create.py
index 1fbc65ef..8b4d75d5 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -2499,7 +2499,7 @@ class vmmCreate(vmmGObjectUI):
'passwd': self._get_config_oscontainer_source_password,
'insecure': self._get_config_oscontainer_isecure
}
- for key, getter in bootstrap_arg_keys.iteritems():
+ for key, getter in bootstrap_arg_keys.items():
bootstrap_args[key] = getter()
parentobj = self._customize_window or self

View File

@ -1,37 +0,0 @@
Subject: diskbackend: convert to long the calculated size
From: Pavel Hrdina phrdina@redhat.com Tue Oct 3 13:56:20 2017 +0200
Date: Thu Oct 19 09:06:44 2017 +0200:
Git: e73abe5a3acaa8e30363fb2ab8c9828b1fdb2589
If we convert to long the disk size, it may end up "0". The size is
in GiB so it can be "0.1".
Introduced by commit <fab55c128ff3f092039bb950ecfd337568d2a9a8>.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtinst/diskbackend.py b/virtinst/diskbackend.py
index 5979e6e6..de745f4d 100644
--- a/virtinst/diskbackend.py
+++ b/virtinst/diskbackend.py
@@ -389,7 +389,7 @@ class CloneStorageCreator(_StorageCreator):
msg = None
vfs = os.statvfs(os.path.dirname(self._path))
avail = vfs[statvfs.F_FRSIZE] * vfs[statvfs.F_BAVAIL]
- need = long(self._size) * long(1024) * long(1024) * long(1024)
+ need = long(self._size * 1024 * 1024 * 1024)
if need > avail:
if self._sparse:
msg = _("The filesystem will not have enough free space"
@@ -409,9 +409,8 @@ class CloneStorageCreator(_StorageCreator):
text = (_("Cloning %(srcfile)s") %
{'srcfile': os.path.basename(self._input_path)})
- size_bytes = (long(self.get_size()) *
- long(1024) * long(1024) * long(1024))
- progresscb.start(filename=self._output_path, size=long(size_bytes),
+ size_bytes = long(self.get_size() * 1024 * 1024 * 1024)
+ progresscb.start(filename=self._output_path, size=size_bytes,
text=text)
# Plain file clone

View File

@ -1,74 +0,0 @@
Subject: Use enumerate instead of range and len
From: Radostin Stoyanov rstoyanov1@gmail.com Wed Oct 11 12:36:03 2017 +0100
Date: Fri Oct 20 13:18:31 2017 -0400:
Git: f41aafc721e8fbe9baa0bc52ec9482ae3e5666ae
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index cf860e63..3793006c 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -594,9 +594,8 @@ class vmmAddHardware(vmmGObjectUI):
vmmAddHardware.populate_smartcard_mode_combo(vm, combo)
idx = -1
- for rowid in range(len(combo.get_model())):
+ for rowid, row in enumerate(combo.get_model()):
idx = 0
- row = combo.get_model()[rowid]
if row[0] == virtinst.VirtualSmartCardDevice.MODE_DEFAULT:
idx = rowid
break
@@ -641,9 +640,8 @@ class vmmAddHardware(vmmGObjectUI):
vmmAddHardware.populate_tpm_type_combo(vm, combo)
idx = -1
- for rowid in range(len(combo.get_model())):
+ for rowid, row in enumerate(combo.get_model()):
idx = 0
- row = combo.get_model()[rowid]
if row[0] == virtinst.VirtualTPMDevice.TYPE_DEFAULT:
idx = rowid
break
diff --git a/virtManager/netlist.py b/virtManager/netlist.py
index 4f1e991a..0bb17965 100644
--- a/virtManager/netlist.py
+++ b/virtManager/netlist.py
@@ -288,8 +288,8 @@ class vmmNetworkList(vmmGObjectUI):
model.insert(0, row)
default = 0
elif label:
- default = [idx for idx in range(len(model)) if
- model[idx][2] == label][0]
+ default = [idx for idx, model_label in enumerate(model) if
+ model_label[2] == label][0]
_add_manual_bridge_row()
return default
diff --git a/virtManager/systray.py b/virtManager/systray.py
index ff550738..aa62df0a 100644
--- a/virtManager/systray.py
+++ b/virtManager/systray.py
@@ -274,7 +274,7 @@ class vmmSystray(vmmGObject):
vm_submenu.insert(menu_item, 0)
return
- for i in range(0, len(vm_names)):
+ for i, name in enumerate(vm_names):
name = vm_names[i]
connkey = vm_mappings[name]
if connkey in self.conn_vm_menuitems[uri]:
diff --git a/virtinst/cloner.py b/virtinst/cloner.py
index 7345bdad..9be5485c 100644
--- a/virtinst/cloner.py
+++ b/virtinst/cloner.py
@@ -430,8 +430,7 @@ class Cloner(object):
iface.macaddr = mac
# Changing storage XML
- for i in range(len(self._original_disks)):
- orig_disk = self._original_disks[i]
+ for i, orig_disk in enumerate(self._original_disks):
clone_disk = self._clone_disks[i]
for disk in self._guest.get_devices("disk"):

View File

@ -1,30 +0,0 @@
Subject: devicepanic: Don't return empty model list (bz #1505532)
From: Cole Robinson crobinso@redhat.com Fri Oct 27 09:42:54 2017 +0200
Date: Fri Oct 27 09:42:54 2017 +0200:
Git: f7c8cf9f667f2b0122f5689009d74c94c38c7316
Callers don't expect it, and it breaks opening the addhardware dialog
for aarch64 VMs
https://bugzilla.redhat.com/show_bug.cgi?id=1505532
diff --git a/virtinst/devicepanic.py b/virtinst/devicepanic.py
index 63a88f71..9f44e93e 100644
--- a/virtinst/devicepanic.py
+++ b/virtinst/devicepanic.py
@@ -49,12 +49,13 @@ class VirtualPanicDevice(VirtualDevice):
@staticmethod
def get_models(os):
if os.is_x86():
- return [VirtualPanicDevice.MODEL_ISA, VirtualPanicDevice.MODEL_HYPERV]
+ return [VirtualPanicDevice.MODEL_ISA,
+ VirtualPanicDevice.MODEL_HYPERV]
elif os.is_pseries():
return [VirtualPanicDevice.MODEL_PSERIES]
elif os.is_s390x():
return [VirtualPanicDevice.MODEL_S390]
- return None
+ return []
@staticmethod
def get_default_model(os):

View File

@ -1,20 +0,0 @@
Subject: virtinst: Fix _URLFetcher for reading files
From: Andrew Wong andrew.kw.w@gmail.com Wed Nov 8 01:23:28 2017 -0500
Date: Wed Nov 22 17:26:31 2017 -0500:
Git: f836e47b7053ce8cd83c66728acfb9b0f821bcac
_grabber() is used for both binary and text files.
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index 5dae424c..1288668a 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -169,7 +169,7 @@ class _URLFetcher(object):
"""
Grab the passed filename from self.location and return it as a string
"""
- fileobj = io.StringIO()
+ fileobj = io.BytesIO()
self._grabURL(filename, fileobj)
return fileobj.getvalue()

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6a393ece4e4db5dd4e9cfb88102e41200c41b56b1db431b19121f894fd8c9fa0
size 1516794

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:33e0de18182cb3335ce2844c09917786d9db66b208f059a97ca37a6381535578
size 1547509

View File

@ -1,3 +1,64 @@
-------------------------------------------------------------------
Wed Feb 7 08:58:09 MST 2018 - carnold@suse.com
- Update to virt-manager 1.5.0 (bsc#1027942)
virt-manager-1.5.0.tar.bz2
* python3 prep work (Radostin Stoyanov, Cole Robinson, Cédric Bosdonnat)
* Switch location ISO to use isoinfo (Andrew Wong)
* virt-install: add cpu numa distance handling (Menno Lageman)
* virt-install: fix disk for rbd volumes with auth (Rauno Väli)
* virt-install: add cputune vcpupin handling (Wim ten Have)
* details ui: Showing attached scsi devices per controller (Lin Ma)
* network ui: Show details about SR-IOV VF pool (Lin Ma)
* Greatly expand UI test suite coverage
- Dropped patches
0001-Improve-container-image-url-example.patch
0001-py3-store-exception-variables-for-use-outside-except.patch
0002-create-wizard-fix-alignment-in-os-container-page.patch
0003-oscontainer-ask-root-password-in-the-wizard.patch
0004-Harmonize-invisible_char-values.patch
083dfcc8-Show-details-about-the-network-of-SR-IOV-VF-pool.patch
08a58d61-pycodestyle-remove-description-of-fixed-errors.patch
0c6bcb09-fix-bytes-string-mess-in-serial-console.patch
0e812e3c-dont-skip-authentication-for-listen-type-none-with-fixed-QEMU.patch
23aaf852-network-Set-bridge-name-to-None-instead-of-blank.patch
2d276ebe-progress-dont-overwrite-format.patch
2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch
374a3779-urlfetcher-write-test-file-as-binary-content.patch
37ea5207-replace-StandardError-with-Exception.patch
3b769643-dont-add-URI-into-params-for-tunneled-migration.patch
3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch
44de92b7-use-reload-from-imp-module.patch
63fce081-pycodestyle-Use-isinstance-for-type-checking.patch
67122615-python2to3-division-compatability.patch
69c84bea-import-reduce-from-functools-module.patch
6dfc4de1-add-support-for-parsing-formatting-SR-IOV-VFs.patch
6e6f59e7-diskbackend-get-a-proper-size-of-existing-block-device-while-cloning.patch
73de8285-systray-remove-redundant-variable-assignment.patch
75210ed3-replace-StringIO-with-io.patch
7f1b4cee-pycodestyle-fix-all-E125-warnings.patch
7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
91c0669c-cli-Fix-OrderedDict-mutated-during-iteration-on-python3.patch
9617d126-systray-Use-APPLICATION_STATUS-for-appindicator.patch
999dbb36-cli-Make-VirtCLIArgument-instantiation-less-crazy.patch
9a9f9ecd-ignore-comments-in-keymap-conf-files.patch
a2bcd6c4-dont-compare-between-None-and-int.patch
b5b2433a-baseclass-Fix-UI-file-loading-on-py3.patch
b8fa0c6b-xmlnsqemu-order-XML-output-like-libvirt-does.patch
b9bc3b60-undefine-only-persistent-domain.patch
bc3c9a9d-progress-remove-unused-import.patch
bc8c5b07-append--attach-to-virt-viewer-if-graphics-has-listen-type-none.patch
c174b550-connection-Another-py3-exception-variable-fix.patch
d1e1cf64-progress-remove-trailing-white-space.patch
d2648d81-virtconv-dont-implicitly-depend-on-dict-hash-order.patch
d82022bd-manager-drop-python2-only-cmp-usage.patch
dff00d4f-remove-deprecated-statvfs-module.patch
e2ad4b2f-convert-iteritems-to-items.patch
e73abe5a-diskbackend-convert-to-long-the-calculated-size.patch
f41aafc7-Use-enumerate-instead-of-range-and-len.patch
f7c8cf9f-devicepanic-dont-return-empty-model-list.patch
f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Feb 6 11:57:54 MST 2018 - carnold@suse.com Tue Feb 6 11:57:54 MST 2018 - carnold@suse.com

View File

@ -23,11 +23,11 @@
%define libvirt_xen_packages "" %define libvirt_xen_packages ""
%define preferred_distros "sles15,opensuse15" %define preferred_distros "sles15,opensuse15"
%define kvm_packages "" %define kvm_packages ""
%define _version 1.4.3 %define _version 1.5.0
%define _release 0 %define _release 0
Name: virt-manager Name: virt-manager
Version: 1.4.3 Version: 1.5.0
Release: 0 Release: 0
Summary: Virtual Machine Manager Summary: Virtual Machine Manager
License: GPL-2.0+ License: GPL-2.0+
@ -38,47 +38,6 @@ Source1: virt-install.rb
Source2: virt-install.desktop Source2: virt-install.desktop
Source3: virt-manager-supportconfig Source3: virt-manager-supportconfig
# Upstream Patches # Upstream Patches
Patch1: 3b769643-dont-add-URI-into-params-for-tunneled-migration.patch
Patch2: 6dfc4de1-add-support-for-parsing-formatting-SR-IOV-VFs.patch
Patch3: 083dfcc8-Show-details-about-the-network-of-SR-IOV-VF-pool.patch
Patch4: 9a9f9ecd-ignore-comments-in-keymap-conf-files.patch
Patch5: 9617d126-systray-Use-APPLICATION_STATUS-for-appindicator.patch
Patch6: e73abe5a-diskbackend-convert-to-long-the-calculated-size.patch
Patch7: 6e6f59e7-diskbackend-get-a-proper-size-of-existing-block-device-while-cloning.patch
Patch8: 23aaf852-network-Set-bridge-name-to-None-instead-of-blank.patch
Patch9: d1e1cf64-progress-remove-trailing-white-space.patch
Patch10: 63fce081-pycodestyle-Use-isinstance-for-type-checking.patch
Patch11: 08a58d61-pycodestyle-remove-description-of-fixed-errors.patch
Patch12: bc3c9a9d-progress-remove-unused-import.patch
Patch13: 2d276ebe-progress-dont-overwrite-format.patch
Patch14: e2ad4b2f-convert-iteritems-to-items.patch
Patch15: dff00d4f-remove-deprecated-statvfs-module.patch
Patch16: 75210ed3-replace-StringIO-with-io.patch
Patch17: a2bcd6c4-dont-compare-between-None-and-int.patch
Patch18: 44de92b7-use-reload-from-imp-module.patch
Patch19: 69c84bea-import-reduce-from-functools-module.patch
Patch20: 37ea5207-replace-StandardError-with-Exception.patch
Patch21: f41aafc7-Use-enumerate-instead-of-range-and-len.patch
Patch22: 91c0669c-cli-Fix-OrderedDict-mutated-during-iteration-on-python3.patch
Patch23: b8fa0c6b-xmlnsqemu-order-XML-output-like-libvirt-does.patch
Patch24: d2648d81-virtconv-dont-implicitly-depend-on-dict-hash-order.patch
Patch25: 999dbb36-cli-Make-VirtCLIArgument-instantiation-less-crazy.patch
Patch26: 7f1b4cee-pycodestyle-fix-all-E125-warnings.patch
Patch27: d82022bd-manager-drop-python2-only-cmp-usage.patch
Patch28: 374a3779-urlfetcher-write-test-file-as-binary-content.patch
Patch29: f7c8cf9f-devicepanic-dont-return-empty-model-list.patch
Patch30: 3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch
Patch31: 73de8285-systray-remove-redundant-variable-assignment.patch
Patch32: b9bc3b60-undefine-only-persistent-domain.patch
Patch33: 7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
Patch34: 2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch
Patch35: f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch
Patch36: c174b550-connection-Another-py3-exception-variable-fix.patch
Patch37: b5b2433a-baseclass-Fix-UI-file-loading-on-py3.patch
Patch38: 0c6bcb09-fix-bytes-string-mess-in-serial-console.patch
Patch39: bc8c5b07-append--attach-to-virt-viewer-if-graphics-has-listen-type-none.patch
Patch40: 0e812e3c-dont-skip-authentication-for-listen-type-none-with-fixed-QEMU.patch
Patch41: 67122615-python2to3-division-compatability.patch
# SUSE Only # SUSE Only
Patch70: virtman-desktop.patch Patch70: virtman-desktop.patch
Patch71: virtman-kvm.patch Patch71: virtman-kvm.patch
@ -133,12 +92,6 @@ Patch206: 0002-virtinst-python3-avoid-comparison-of-None-and-int.patch
Patch207: 0003-virtinst-python3-avoid-using-long-type.patch Patch207: 0003-virtinst-python3-avoid-using-long-type.patch
Patch208: 0004-virtinst-python3-use-binary-mode-for-kernel.patch Patch208: 0004-virtinst-python3-use-binary-mode-for-kernel.patch
Patch209: virtman-register-delete-event-for-details-dialog.patch Patch209: virtman-register-delete-event-for-details-dialog.patch
Patch210: 0001-py3-store-exception-variables-for-use-outside-except.patch
# For upstream review
Patch500: 0001-Improve-container-image-url-example.patch
Patch501: 0002-create-wizard-fix-alignment-in-os-container-page.patch
Patch502: 0003-oscontainer-ask-root-password-in-the-wizard.patch
Patch503: 0004-Harmonize-invisible_char-values.patch
BuildArch: noarch BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -223,47 +176,6 @@ machine).
%prep %prep
%setup -q %setup -q
# Upstream Patches # 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
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
# SUSE Only # SUSE Only
%patch70 -p1 %patch70 -p1
%patch71 -p1 %patch71 -p1
@ -318,11 +230,6 @@ machine).
%patch207 -p1 %patch207 -p1
%patch208 -p1 %patch208 -p1
%patch209 -p1 %patch209 -p1
%patch210 -p1
%patch500 -p1
%patch501 -p1
%patch502 -p1
%patch503 -p1
%build %build
%if %{qemu_user} %if %{qemu_user}

View File

@ -1,10 +1,10 @@
References: bsc#1010060 References: bsc#1010060
Index: virt-manager-1.4.3/virtinst/urlfetcher.py Index: virt-manager-1.5.0/virtinst/urlfetcher.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/urlfetcher.py --- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.3/virtinst/urlfetcher.py +++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -466,6 +466,10 @@ def _distroFromSUSEContent(fetcher, arch @@ -490,6 +490,10 @@ def _distroFromSUSEContent(fetcher, arch
dclass = OESDistro dclass = OESDistro
if distro_version is None: if distro_version is None:
distro_version = _parse_sle_distribution(distribution) distro_version = _parse_sle_distribution(distribution)
@ -15,7 +15,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
elif re.match(".*openSUSE.*", distribution[1]): elif re.match(".*openSUSE.*", distribution[1]):
dclass = OpensuseDistro dclass = OpensuseDistro
if distro_version is None: if distro_version is None:
@@ -1052,6 +1056,8 @@ class SuseDistro(Distro): @@ -1076,6 +1080,8 @@ class SuseDistro(Distro):
self.os_variant += major_version + 'sp' + sp_version self.os_variant += major_version + 'sp' + sp_version
else: else:
self.os_variant += major_version self.os_variant += major_version
@ -24,7 +24,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
else: else:
self.os_variant += "9" self.os_variant += "9"
@@ -1098,6 +1104,11 @@ class SLESDistro(SuseDistro): @@ -1122,6 +1128,11 @@ class SLESDistro(SuseDistro):
class SLEDDistro(SuseDistro): class SLEDDistro(SuseDistro):
urldistro = "sled" urldistro = "sled"

View File

@ -1,10 +1,10 @@
Reference: bnc#869024 Reference: bnc#869024
Add s390x and ppc64 support Add s390x and ppc64 support
Index: virt-manager-1.4.2/virtinst/urlfetcher.py Index: virt-manager-1.5.0/virtinst/urlfetcher.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py --- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py +++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -440,6 +440,10 @@ def _distroFromSUSEContent(fetcher, arch @@ -464,6 +464,10 @@ def _distroFromSUSEContent(fetcher, arch
arch = "i586" arch = "i586"
elif cbuf.find("s390x") != -1: elif cbuf.find("s390x") != -1:
arch = "s390x" arch = "s390x"
@ -15,7 +15,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
def _parse_sle_distribution(d): def _parse_sle_distribution(d):
sle_version = d[1].strip().rsplit(' ')[4] sle_version = d[1].strip().rsplit(' ')[4]
@@ -998,10 +1002,12 @@ class SuseDistro(Distro): @@ -1022,10 +1026,12 @@ class SuseDistro(Distro):
oldkern += "64" oldkern += "64"
oldinit += "64" oldinit += "64"

View File

@ -6,11 +6,11 @@ We must continue to keep the content parsing code for the older distros.
As a fallback, detection is also setup to look at the media.1/products and As a fallback, detection is also setup to look at the media.1/products and
media.1/build files. media.1/build files.
Index: virt-manager-1.4.3/virtinst/urlfetcher.py Index: virt-manager-1.5.0/virtinst/urlfetcher.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/urlfetcher.py --- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.3/virtinst/urlfetcher.py +++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -392,7 +392,23 @@ def _distroFromSUSEContent(fetcher, arch @@ -416,7 +416,23 @@ def _distroFromSUSEContent(fetcher, arch
try: try:
cbuf = fetcher.acquireFileContent("content") cbuf = fetcher.acquireFileContent("content")
except ValueError: except ValueError:
@ -35,7 +35,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
distribution = None distribution = None
distro_version = None distro_version = None
@@ -465,7 +481,7 @@ def _distroFromSUSEContent(fetcher, arch @@ -489,7 +505,7 @@ def _distroFromSUSEContent(fetcher, arch
dclass = GenericDistro dclass = GenericDistro
if distribution: if distribution:
if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \ if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
@ -44,7 +44,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
dclass = SLESDistro dclass = SLESDistro
if distro_version is None: if distro_version is None:
distro_version = _parse_sle_distribution(distribution) distro_version = _parse_sle_distribution(distribution)
@@ -481,10 +497,13 @@ def _distroFromSUSEContent(fetcher, arch @@ -505,10 +521,13 @@ def _distroFromSUSEContent(fetcher, arch
dclass = CAASPDistro dclass = CAASPDistro
if distro_version is None: if distro_version is None:
distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[6]] distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[6]]
@ -60,7 +60,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
if distro_version is None: if distro_version is None:
return None return None
@@ -1003,6 +1022,7 @@ class SLDistro(RHELDistro): @@ -1027,6 +1046,7 @@ class SLDistro(RHELDistro):
class SuseDistro(Distro): class SuseDistro(Distro):
name = "SUSE" name = "SUSE"
@ -68,7 +68,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
_boot_iso_paths = ["boot/boot.iso"] _boot_iso_paths = ["boot/boot.iso"]
@@ -1040,8 +1060,11 @@ class SuseDistro(Distro): @@ -1064,8 +1084,11 @@ class SuseDistro(Distro):
self._xen_kernel_paths = [("boot/%s/vmlinuz-xenpae" % self.arch, self._xen_kernel_paths = [("boot/%s/vmlinuz-xenpae" % self.arch,
"boot/%s/initrd-xenpae" % self.arch)] "boot/%s/initrd-xenpae" % self.arch)]
else: else:
@ -82,7 +82,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
def _variantFromVersion(self): def _variantFromVersion(self):
distro_version = self.version_from_content[1].strip() distro_version = self.version_from_content[1].strip()
@@ -1053,7 +1076,7 @@ class SuseDistro(Distro): @@ -1077,7 +1100,7 @@ class SuseDistro(Distro):
if len(distro_version.split('.', 1)) == 2: if len(distro_version.split('.', 1)) == 2:
sp_version = 'sp' + distro_version.split('.', 1)[1].strip() sp_version = 'sp' + distro_version.split('.', 1)[1].strip()
self.os_variant += version self.os_variant += version
@ -91,7 +91,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
self.os_variant += sp_version self.os_variant += sp_version
elif self.os_variant.startswith("opensuse"): elif self.os_variant.startswith("opensuse"):
if len(version) == 8: if len(version) == 8:
@@ -1077,6 +1100,24 @@ class SuseDistro(Distro): @@ -1101,6 +1124,24 @@ class SuseDistro(Distro):
self.os_variant += "9" self.os_variant += "9"
def isValidStore(self): def isValidStore(self):
@ -116,7 +116,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
# self.version_from_content is the VERSION line from the contents file # self.version_from_content is the VERSION line from the contents file
if (not self.version_from_content or if (not self.version_from_content or
self.version_from_content[1] is None): self.version_from_content[1] is None):
@@ -1128,8 +1169,6 @@ class OESDistro(SuseDistro): @@ -1152,8 +1193,6 @@ class OESDistro(SuseDistro):
urldistro = "oes" urldistro = "oes"

View File

@ -1,10 +1,10 @@
Enhancement to correctly detect Open Enterprise Server media is Enhancement to correctly detect Open Enterprise Server media is
selected as the installation source. selected as the installation source.
Index: virt-manager-1.4.2/virtinst/urlfetcher.py Index: virt-manager-1.5.0/virtinst/urlfetcher.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py --- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py +++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -458,6 +458,10 @@ def _distroFromSUSEContent(fetcher, arch @@ -482,6 +482,10 @@ def _distroFromSUSEContent(fetcher, arch
dclass = SLEDDistro dclass = SLEDDistro
if distro_version is None: if distro_version is None:
distro_version = _parse_sle_distribution(distribution) distro_version = _parse_sle_distribution(distribution)
@ -15,7 +15,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
elif re.match(".*openSUSE.*", distribution[1]): elif re.match(".*openSUSE.*", distribution[1]):
dclass = OpensuseDistro dclass = OpensuseDistro
if distro_version is None: if distro_version is None:
@@ -1018,20 +1022,30 @@ class SuseDistro(Distro): @@ -1042,20 +1046,30 @@ class SuseDistro(Distro):
distro_version = self.version_from_content[1].strip() distro_version = self.version_from_content[1].strip()
version = distro_version.split('.', 1)[0].strip() version = distro_version.split('.', 1)[0].strip()
self.os_variant = self.urldistro self.os_variant = self.urldistro
@ -59,7 +59,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
else: else:
self.os_variant += "9" self.os_variant += "9"
@@ -1078,6 +1092,9 @@ class SLESDistro(SuseDistro): @@ -1102,6 +1116,9 @@ class SLESDistro(SuseDistro):
class SLEDDistro(SuseDistro): class SLEDDistro(SuseDistro):
urldistro = "sled" urldistro = "sled"

View File

@ -1,10 +1,10 @@
References: bsc#1042709 References: bsc#1042709
Index: virt-manager-1.4.2/virtinst/urlfetcher.py Index: virt-manager-1.5.0/virtinst/urlfetcher.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py --- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py +++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -446,9 +446,20 @@ def _distroFromSUSEContent(fetcher, arch @@ -470,9 +470,20 @@ def _distroFromSUSEContent(fetcher, arch
arch = "ppc64le" arch = "ppc64le"
def _parse_sle_distribution(d): def _parse_sle_distribution(d):

View File

@ -5,10 +5,10 @@ A fix for accessing nfs mounted media. A comment in the code states,
and carry the latter form around internally" and carry the latter form around internally"
We need the RFC version to work correctly whereas redhat's anaconda We need the RFC version to work correctly whereas redhat's anaconda
needs their own modified version. needs their own modified version.
Index: virt-manager-1.4.3/virtinst/util.py Index: virt-manager-1.5.0/virtinst/util.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/util.py --- virt-manager-1.5.0.orig/virtinst/util.py
+++ virt-manager-1.4.3/virtinst/util.py +++ virt-manager-1.5.0/virtinst/util.py
@@ -374,3 +374,22 @@ def getInstallRepos(): @@ -374,3 +374,22 @@ def getInstallRepos():
return (0, []) return (0, [])
return lookupZypperRepos(getHostInstallSource()) return lookupZypperRepos(getHostInstallSource())
@ -32,10 +32,10 @@ Index: virt-manager-1.4.3/virtinst/util.py
+ +
+ return url + return url
+ +
Index: virt-manager-1.4.3/virtinst/distroinstaller.py Index: virt-manager-1.5.0/virtinst/distroinstaller.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/distroinstaller.py --- virt-manager-1.5.0.orig/virtinst/distroinstaller.py
+++ virt-manager-1.4.3/virtinst/distroinstaller.py +++ virt-manager-1.5.0/virtinst/distroinstaller.py
@@ -44,6 +44,8 @@ def _sanitize_url(url): @@ -44,6 +44,8 @@ def _sanitize_url(url):
""" """
Do nothing for http or ftp, but make sure nfs is in the expected format Do nothing for http or ftp, but make sure nfs is in the expected format
@ -45,11 +45,11 @@ Index: virt-manager-1.4.3/virtinst/distroinstaller.py
if url.startswith("nfs://"): if url.startswith("nfs://"):
# Convert RFC compliant NFS nfs://server/path/to/distro # Convert RFC compliant NFS nfs://server/path/to/distro
# to what mount/anaconda expect nfs:server:/path/to/distro # to what mount/anaconda expect nfs:server:/path/to/distro
Index: virt-manager-1.4.3/virtinst/urlfetcher.py Index: virt-manager-1.5.0/virtinst/urlfetcher.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/urlfetcher.py --- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.3/virtinst/urlfetcher.py +++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -34,6 +34,7 @@ import urlparse @@ -33,6 +33,7 @@ import urlparse
import requests import requests
from .osdict import OSDB from .osdict import OSDB
@ -57,13 +57,13 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
######################################################################### #########################################################################
@@ -303,7 +304,8 @@ class _MountedURLFetcher(_LocalURLFetche @@ -301,7 +302,8 @@ class _MountedURLFetcher(_LocalURLFetche
mountcmd = "/bin/mount"
logging.debug("Preparing mount at " + self._srcdir) logging.debug("Preparing mount at " + self._srcdir)
if self.location.startswith("nfs:"): - cmd = [mountcmd, "-o", "ro", self.location[4:], self._srcdir]
- cmd = [mountcmd, "-o", "ro", self.location[4:], self._srcdir] + url = util.sanitize_url(self.location)
+ url = util.sanitize_url(self.location) + cmd = [mountcmd, "-o", "ro", url[4:], self._srcdir]
+ cmd = [mountcmd, "-o", "ro", url[4:], self._srcdir]
else: logging.debug("mount cmd: %s", cmd)
if stat.S_ISBLK(os.stat(self.location)[stat.ST_MODE]): if not self._in_test_suite:
mountopt = "ro"

View File

@ -1,17 +1,17 @@
Index: virt-manager-1.4.3/virt-install Index: virt-manager-1.5.0/virt-install
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virt-install --- virt-manager-1.5.0.orig/virt-install
+++ virt-manager-1.4.3/virt-install +++ virt-manager-1.5.0/virt-install
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-#!/usr/bin/env python2 -#!/usr/bin/env python2
+#!/usr/bin/python3 +#!/usr/bin/python3
# #
# Copyright 2005-2014 Red Hat, Inc. # Copyright 2005-2014 Red Hat, Inc.
# #
Index: virt-manager-1.4.3/virtinst/uri.py Index: virt-manager-1.5.0/virtinst/uri.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/uri.py --- virt-manager-1.5.0.orig/virtinst/uri.py
+++ virt-manager-1.4.3/virtinst/uri.py +++ virt-manager-1.5.0/virtinst/uri.py
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
import logging import logging
@ -30,10 +30,10 @@ Index: virt-manager-1.4.3/virtinst/uri.py
(self.scheme, self.username, self.hostname, (self.scheme, self.username, self.hostname,
self.path, self.query, self.fragment) = self._split(unquoted_uri) self.path, self.query, self.fragment) = self._split(unquoted_uri)
Index: virt-manager-1.4.3/virtinst/hostkeymap.py Index: virt-manager-1.5.0/virtinst/hostkeymap.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/hostkeymap.py --- virt-manager-1.5.0.orig/virtinst/hostkeymap.py
+++ virt-manager-1.4.3/virtinst/hostkeymap.py +++ virt-manager-1.5.0/virtinst/hostkeymap.py
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
import logging import logging
import os import os
@ -51,10 +51,10 @@ Index: virt-manager-1.4.3/virtinst/hostkeymap.py
for key in sorted_keys: for key in sorted_keys:
origkey = key origkey = key
Index: virt-manager-1.4.3/virtinst/support.py Index: virt-manager-1.5.0/virtinst/support.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/support.py --- virt-manager-1.5.0.orig/virtinst/support.py
+++ virt-manager-1.4.3/virtinst/support.py +++ virt-manager-1.5.0/virtinst/support.py
@@ -167,7 +167,7 @@ class _SupportCheck(object): @@ -167,7 +167,7 @@ class _SupportCheck(object):
self.hv_version = hv_version or {} self.hv_version = hv_version or {}
self.hv_libvirt_version = hv_libvirt_version or {} self.hv_libvirt_version = hv_libvirt_version or {}
@ -64,10 +64,10 @@ Index: virt-manager-1.4.3/virtinst/support.py
for vstr in versions: for vstr in versions:
v = _version_str_to_int(vstr) v = _version_str_to_int(vstr)
if vstr is not None and v != 0 and v < 7009: if vstr is not None and v != 0 and v < 7009:
Index: virt-manager-1.4.3/virtinst/osdict.py Index: virt-manager-1.5.0/virtinst/osdict.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/osdict.py --- virt-manager-1.5.0.orig/virtinst/osdict.py
+++ virt-manager-1.4.3/virtinst/osdict.py +++ virt-manager-1.5.0/virtinst/osdict.py
@@ -79,7 +79,7 @@ def _sort(tosort, sortpref=None, limit_p @@ -79,7 +79,7 @@ def _sort(tosort, sortpref=None, limit_p
retlist = [] retlist = []
sortpref = sortpref or [] sortpref = sortpref or []
@ -101,10 +101,10 @@ Index: virt-manager-1.4.3/virtinst/osdict.py
if typename and typename != osobj.get_typename(): if typename and typename != osobj.get_typename():
continue continue
if only_supported and not osobj.get_supported(): if only_supported and not osobj.get_supported():
Index: virt-manager-1.4.3/virtinst/guest.py Index: virt-manager-1.5.0/virtinst/guest.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/guest.py --- virt-manager-1.5.0.orig/virtinst/guest.py
+++ virt-manager-1.4.3/virtinst/guest.py +++ virt-manager-1.5.0/virtinst/guest.py
@@ -434,7 +434,7 @@ class Guest(XMLBuilder): @@ -434,7 +434,7 @@ class Guest(XMLBuilder):
domain.undefine() domain.undefine()
except Exception: except Exception:
@ -123,10 +123,10 @@ Index: virt-manager-1.4.3/virtinst/guest.py
if len(devs) > 1 and 0 in devs: if len(devs) > 1 and 0 in devs:
devs[0].address.multifunction = True devs[0].address.multifunction = True
Index: virt-manager-1.4.3/virtinst/distroinstaller.py Index: virt-manager-1.5.0/virtinst/distroinstaller.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/distroinstaller.py --- virt-manager-1.5.0.orig/virtinst/distroinstaller.py
+++ virt-manager-1.4.3/virtinst/distroinstaller.py +++ virt-manager-1.5.0/virtinst/distroinstaller.py
@@ -68,7 +68,7 @@ def _sanitize_url(url): @@ -68,7 +68,7 @@ def _sanitize_url(url):
MEDIA_LOCATION_URL, MEDIA_LOCATION_URL,
MEDIA_CDROM_PATH, MEDIA_CDROM_PATH,
@ -136,10 +136,10 @@ Index: virt-manager-1.4.3/virtinst/distroinstaller.py
class DistroInstaller(Installer): class DistroInstaller(Installer):
Index: virt-manager-1.4.3/virtinst/cli.py Index: virt-manager-1.5.0/virtinst/cli.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/cli.py --- virt-manager-1.5.0.orig/virtinst/cli.py
+++ virt-manager-1.4.3/virtinst/cli.py +++ virt-manager-1.5.0/virtinst/cli.py
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA. # MA 02110-1301 USA.
@ -149,7 +149,7 @@ Index: virt-manager-1.4.3/virtinst/cli.py
import argparse import argparse
import collections import collections
@@ -293,7 +293,7 @@ def _do_creds_authname(creds): @@ -294,7 +294,7 @@ def _do_creds_authname(creds):
res = cred[retindex] res = cred[retindex]
if credtype == libvirt.VIR_CRED_AUTHNAME: if credtype == libvirt.VIR_CRED_AUTHNAME:
@ -158,7 +158,7 @@ Index: virt-manager-1.4.3/virtinst/cli.py
elif credtype == libvirt.VIR_CRED_PASSPHRASE: elif credtype == libvirt.VIR_CRED_PASSPHRASE:
import getpass import getpass
res = getpass.getpass(prompt) res = getpass.getpass(prompt)
@@ -1159,7 +1159,7 @@ class VirtCLIParser(object): @@ -1193,7 +1193,7 @@ class VirtCLIParser(object):
passed an invalid argument such as --disk idontexist=foo passed an invalid argument such as --disk idontexist=foo
""" """
if optdict: if optdict:
@ -167,7 +167,7 @@ Index: virt-manager-1.4.3/virtinst/cli.py
def _parse(self, inst): def _parse(self, inst):
""" """
@@ -1616,7 +1616,7 @@ class ParserBoot(VirtCLIParser): @@ -1681,7 +1681,7 @@ class ParserBoot(VirtCLIParser):
def _parse(self, inst): def _parse(self, inst):
# Build boot order # Build boot order
boot_order = [] boot_order = []
@ -176,10 +176,10 @@ Index: virt-manager-1.4.3/virtinst/cli.py
if cliname not in inst.os.BOOT_DEVICES: if cliname not in inst.os.BOOT_DEVICES:
continue continue
Index: virt-manager-1.4.3/virtinst/xmlbuilder.py Index: virt-manager-1.5.0/virtinst/xmlbuilder.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/xmlbuilder.py --- virt-manager-1.5.0.orig/virtinst/xmlbuilder.py
+++ virt-manager-1.4.3/virtinst/xmlbuilder.py +++ virt-manager-1.5.0/virtinst/xmlbuilder.py
@@ -327,7 +327,7 @@ class XMLChildProperty(property): @@ -327,7 +327,7 @@ class XMLChildProperty(property):
def _findpropname(self, xmlbuilder): def _findpropname(self, xmlbuilder):
@ -290,10 +290,10 @@ Index: virt-manager-1.4.3/virtinst/xmlbuilder.py
if key not in do_order: if key not in do_order:
do_order.append(key) do_order.append(key)
Index: virt-manager-1.4.3/virtinst/domcapabilities.py Index: virt-manager-1.5.0/virtinst/domcapabilities.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/domcapabilities.py --- virt-manager-1.5.0.orig/virtinst/domcapabilities.py
+++ virt-manager-1.4.3/virtinst/domcapabilities.py +++ virt-manager-1.5.0/virtinst/domcapabilities.py
@@ -139,7 +139,7 @@ class DomainCapabilities(XMLBuilder): @@ -139,7 +139,7 @@ class DomainCapabilities(XMLBuilder):
return _("BIOS") return _("BIOS")
return _("None") return _("None")
@ -312,10 +312,10 @@ Index: virt-manager-1.4.3/virtinst/domcapabilities.py
def supports_uefi_xml(self): def supports_uefi_xml(self):
""" """
Index: virt-manager-1.4.3/virtinst/devicedisk.py Index: virt-manager-1.5.0/virtinst/devicedisk.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/devicedisk.py --- virt-manager-1.5.0.orig/virtinst/devicedisk.py
+++ virt-manager-1.4.3/virtinst/devicedisk.py +++ virt-manager-1.5.0/virtinst/devicedisk.py
@@ -87,7 +87,7 @@ def _is_dir_searchable(uid, username, pa @@ -87,7 +87,7 @@ def _is_dir_searchable(uid, username, pa
logging.debug("Cmd '%s' failed: %s", cmd, err) logging.debug("Cmd '%s' failed: %s", cmd, err)
return False return False
@ -324,8 +324,8 @@ Index: virt-manager-1.4.3/virtinst/devicedisk.py
+ return bool(re.search("user:%s:..x" % username, out.decode())) + return bool(re.search("user:%s:..x" % username, out.decode()))
class _DiskSeclabel(XMLBuilder): class _Host(XMLBuilder):
@@ -445,7 +445,7 @@ class VirtualDisk(VirtualDevice): @@ -453,7 +453,7 @@ class VirtualDisk(VirtualDevice):
digit = 1 digit = 1
seen_valid = True seen_valid = True
@ -334,7 +334,7 @@ Index: virt-manager-1.4.3/virtinst/devicedisk.py
return gen_t return gen_t
@@ -1022,11 +1022,11 @@ class VirtualDisk(VirtualDevice): @@ -1054,11 +1054,11 @@ class VirtualDisk(VirtualDevice):
def get_target(): def get_target():
first_found = None first_found = None
@ -348,10 +348,10 @@ Index: virt-manager-1.4.3/virtinst/devicedisk.py
for i in ran: for i in ran:
postfix = self.num_to_target(i + 1) postfix = self.num_to_target(i + 1)
Index: virt-manager-1.4.3/virtinst/storage.py Index: virt-manager-1.5.0/virtinst/storage.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/storage.py --- virt-manager-1.5.0.orig/virtinst/storage.py
+++ virt-manager-1.4.3/virtinst/storage.py +++ virt-manager-1.5.0/virtinst/storage.py
@@ -130,7 +130,7 @@ class StoragePool(_StorageObject): @@ -130,7 +130,7 @@ class StoragePool(_StorageObject):
""" """
Return list of appropriate pool types Return list of appropriate pool types
@ -361,10 +361,10 @@ Index: virt-manager-1.4.3/virtinst/storage.py
@staticmethod @staticmethod
def get_pool_type_desc(pool_type): def get_pool_type_desc(pool_type):
Index: virt-manager-1.4.3/virtinst/devicegraphics.py Index: virt-manager-1.5.0/virtinst/devicegraphics.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/devicegraphics.py --- virt-manager-1.5.0.orig/virtinst/devicegraphics.py
+++ virt-manager-1.4.3/virtinst/devicegraphics.py +++ virt-manager-1.5.0/virtinst/devicegraphics.py
@@ -84,7 +84,7 @@ class VirtualGraphics(VirtualDevice): @@ -84,7 +84,7 @@ class VirtualGraphics(VirtualDevice):
""" """
from . import hostkeymap from . import hostkeymap
@ -374,10 +374,10 @@ Index: virt-manager-1.4.3/virtinst/devicegraphics.py
sort_list = [] sort_list = []
orig_list.sort() orig_list.sort()
Index: virt-manager-1.4.3/virtinst/util.py Index: virt-manager-1.5.0/virtinst/util.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/util.py --- virt-manager-1.5.0.orig/virtinst/util.py
+++ virt-manager-1.4.3/virtinst/util.py +++ virt-manager-1.5.0/virtinst/util.py
@@ -147,7 +147,7 @@ def generate_name(base, collision_cb, su @@ -147,7 +147,7 @@ def generate_name(base, collision_cb, su
else: else:
return collision_cb(tryname) return collision_cb(tryname)
@ -387,10 +387,10 @@ Index: virt-manager-1.4.3/virtinst/util.py
if not force_num: if not force_num:
numrange = [None] + numrange numrange = [None] + numrange
Index: virt-manager-1.4.3/virtinst/urlfetcher.py Index: virt-manager-1.5.0/virtinst/urlfetcher.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/urlfetcher.py --- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.3/virtinst/urlfetcher.py +++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA. # MA 02110-1301 USA.
@ -400,8 +400,8 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
import ftplib import ftplib
import io import io
import logging import logging
@@ -28,8 +28,8 @@ import re @@ -27,8 +27,8 @@ import os
import stat import re
import subprocess import subprocess
import tempfile import tempfile
-import urllib2 -import urllib2
@ -411,7 +411,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
import requests import requests
@@ -221,9 +221,13 @@ class _FTPURLFetcher(_URLFetcher): @@ -220,9 +220,13 @@ class _FTPURLFetcher(_URLFetcher):
return return
try: try:
@ -427,7 +427,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
self._ftp.login() self._ftp.login()
# Force binary mode # Force binary mode
self._ftp.voidcmd("TYPE I") self._ftp.voidcmd("TYPE I")
@@ -235,9 +239,9 @@ class _FTPURLFetcher(_URLFetcher): @@ -234,9 +238,9 @@ class _FTPURLFetcher(_URLFetcher):
""" """
Use urllib2 and ftplib to grab the file Use urllib2 and ftplib to grab the file
""" """
@ -440,7 +440,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
return urlobj, size return urlobj, size
@@ -253,7 +257,7 @@ class _FTPURLFetcher(_URLFetcher): @@ -252,7 +256,7 @@ class _FTPURLFetcher(_URLFetcher):
self._ftp = None self._ftp = None
def _hasFile(self, url): def _hasFile(self, url):
@ -449,7 +449,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
try: try:
try: try:
@@ -278,7 +282,7 @@ class _LocalURLFetcher(_URLFetcher): @@ -277,7 +281,7 @@ class _LocalURLFetcher(_URLFetcher):
return os.path.exists(url) return os.path.exists(url)
def _grabber(self, url): def _grabber(self, url):
@ -458,7 +458,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
size = os.path.getsize(url) size = os.path.getsize(url)
return urlobj, size return urlobj, size
@@ -371,14 +375,14 @@ def _grabTreeinfo(fetcher): @@ -395,14 +399,14 @@ def _grabTreeinfo(fetcher):
return None return None
try: try:
@ -475,7 +475,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
logging.debug("Did not find 'family' section in treeinfo") logging.debug("Did not find 'family' section in treeinfo")
return None return None
@@ -391,11 +395,13 @@ def _distroFromSUSEContent(fetcher, arch @@ -415,11 +419,13 @@ def _distroFromSUSEContent(fetcher, arch
# None if no content, GenericDistro if unknown label type. # None if no content, GenericDistro if unknown label type.
try: try:
cbuf = fetcher.acquireFileContent("content") cbuf = fetcher.acquireFileContent("content")
@ -489,7 +489,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
pbuf = pbuf.split(' ', 1)[1].strip() pbuf = pbuf.split(' ', 1)[1].strip()
# The media.1/products file naming convention changed between SLE11 and SLE12 # The media.1/products file naming convention changed between SLE11 and SLE12
if pbuf.startswith('SLE'): if pbuf.startswith('SLE'):
@@ -404,6 +410,7 @@ def _distroFromSUSEContent(fetcher, arch @@ -428,6 +434,7 @@ def _distroFromSUSEContent(fetcher, arch
cbuf = "\nDISTRO ," + pbuf.replace('-', ' ') cbuf = "\nDISTRO ," + pbuf.replace('-', ' ')
try: try:
bbuf = fetcher.acquireFileContent("media.1/build").split('-') bbuf = fetcher.acquireFileContent("media.1/build").split('-')
@ -497,7 +497,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
except: except:
bbuf = ["x86_64"] bbuf = ["x86_64"]
cbuf = cbuf + "\n" + " ".join(bbuf) cbuf = cbuf + "\n" + " ".join(bbuf)
@@ -621,7 +628,7 @@ class Distro(object): @@ -645,7 +652,7 @@ class Distro(object):
try: try:
kernelpath = self._getTreeinfoMedia("kernel") kernelpath = self._getTreeinfoMedia("kernel")
initrdpath = self._getTreeinfoMedia("initrd") initrdpath = self._getTreeinfoMedia("initrd")
@ -506,7 +506,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
pass pass
if not kernelpath or not initrdpath: if not kernelpath or not initrdpath:
@@ -688,6 +695,7 @@ class Distro(object): @@ -712,6 +719,7 @@ class Distro(object):
# Fetch 'filename' and return True/False if it matches the regex # Fetch 'filename' and return True/False if it matches the regex
try: try:
content = self.fetcher.acquireFileContent(filename) content = self.fetcher.acquireFileContent(filename)
@ -514,7 +514,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
except ValueError: except ValueError:
return False return False
@@ -757,15 +765,15 @@ class GenericDistro(Distro): @@ -781,15 +789,15 @@ class GenericDistro(Distro):
self._valid_kernel_path = ( self._valid_kernel_path = (
self._getTreeinfoMedia("kernel"), self._getTreeinfoMedia("kernel"),
self._getTreeinfoMedia("initrd")) self._getTreeinfoMedia("initrd"))
@ -533,7 +533,7 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
logging.debug(e) logging.debug(e)
if self.type == "xen": if self.type == "xen":
@@ -1440,7 +1448,7 @@ class ALTLinuxDistro(Distro): @@ -1472,7 +1480,7 @@ class ALTLinuxDistro(Distro):
# Build list of all *Distro classes # Build list of all *Distro classes
def _build_distro_list(): def _build_distro_list():
allstores = [] allstores = []
@ -542,10 +542,10 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
if isinstance(obj, type) and issubclass(obj, Distro) and obj.name: if isinstance(obj, type) and issubclass(obj, Distro) and obj.name:
allstores.append(obj) allstores.append(obj)
Index: virt-manager-1.4.3/virtinst/diskbackend.py Index: virt-manager-1.5.0/virtinst/diskbackend.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/diskbackend.py --- virt-manager-1.5.0.orig/virtinst/diskbackend.py
+++ virt-manager-1.4.3/virtinst/diskbackend.py +++ virt-manager-1.5.0/virtinst/diskbackend.py
@@ -391,7 +391,7 @@ class CloneStorageCreator(_StorageCreato @@ -391,7 +391,7 @@ class CloneStorageCreator(_StorageCreato
else: else:
vfs = os.statvfs(os.path.dirname(self._path)) vfs = os.statvfs(os.path.dirname(self._path))
@ -564,10 +564,10 @@ Index: virt-manager-1.4.3/virtinst/diskbackend.py
progresscb.start(filename=self._output_path, size=size_bytes, progresscb.start(filename=self._output_path, size=size_bytes,
text=text) text=text)
Index: virt-manager-1.4.3/virtinst/progress.py Index: virt-manager-1.5.0/virtinst/progress.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/progress.py --- virt-manager-1.5.0.orig/virtinst/progress.py
+++ virt-manager-1.4.3/virtinst/progress.py +++ virt-manager-1.5.0/virtinst/progress.py
@@ -481,7 +481,7 @@ def format_number(number, SI=0, space=' @@ -481,7 +481,7 @@ def format_number(number, SI=0, space='
depth = depth + 1 depth = depth + 1
number = number / step number = number / step
@ -577,10 +577,10 @@ Index: virt-manager-1.4.3/virtinst/progress.py
# it's an int or a long, which means it didn't get divided, # it's an int or a long, which means it didn't get divided,
# which means it's already short enough # which means it's already short enough
fmt = '%i%s%s' fmt = '%i%s%s'
Index: virt-manager-1.4.3/virtinst/pollhelpers.py Index: virt-manager-1.5.0/virtinst/pollhelpers.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/pollhelpers.py --- virt-manager-1.5.0.orig/virtinst/pollhelpers.py
+++ virt-manager-1.4.3/virtinst/pollhelpers.py +++ virt-manager-1.5.0/virtinst/pollhelpers.py
@@ -50,7 +50,7 @@ def _new_poll_helper(origmap, typename, @@ -50,7 +50,7 @@ def _new_poll_helper(origmap, typename,
current[connkey] = origmap[connkey] current[connkey] = origmap[connkey]
del(origmap[connkey]) del(origmap[connkey])

View File

@ -1,10 +1,10 @@
Reference: bnc#869024 Reference: bnc#869024
Disable graphics on s390x Disable graphics on s390x
Index: virt-manager-1.4.3/virtinst/guest.py Index: virt-manager-1.5.0/virtinst/guest.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/guest.py --- virt-manager-1.5.0.orig/virtinst/guest.py
+++ virt-manager-1.4.3/virtinst/guest.py +++ virt-manager-1.5.0/virtinst/guest.py
@@ -125,7 +125,10 @@ class Guest(XMLBuilder): @@ -126,7 +126,10 @@ class Guest(XMLBuilder):
self.skip_default_channel = False self.skip_default_channel = False
self.skip_default_sound = False self.skip_default_sound = False
self.skip_default_usbredir = False self.skip_default_usbredir = False

View File

@ -1,9 +1,9 @@
Enhancement to add ocfs2 as a supported FS type Enhancement to add ocfs2 as a supported FS type
Index: virt-manager-1.4.2/virtinst/storage.py Index: virt-manager-1.5.0/virtinst/storage.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtinst/storage.py --- virt-manager-1.5.0.orig/virtinst/storage.py
+++ virt-manager-1.4.2/virtinst/storage.py +++ virt-manager-1.5.0/virtinst/storage.py
@@ -467,7 +467,7 @@ class StoragePool(_StorageObject): @@ -460,7 +460,7 @@ class StoragePool(_StorageObject):
def list_formats(self): def list_formats(self):
if self.type == self.TYPE_FS: if self.type == self.TYPE_FS:
return ["auto", "ext2", "ext3", "ext4", "ufs", "iso9660", "udf", return ["auto", "ext2", "ext3", "ext4", "ufs", "iso9660", "udf",

View File

@ -2,11 +2,11 @@ References: bsc#989639
When the device added is a cdrom device (/dev/sr0), don't use When the device added is a cdrom device (/dev/sr0), don't use
"phy" as the driver name but instead use "qemu". "phy" as the driver name but instead use "qemu".
Index: virt-manager-1.4.2/virtinst/devicedisk.py Index: virt-manager-1.5.0/virtinst/devicedisk.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtinst/devicedisk.py --- virt-manager-1.5.0.orig/virtinst/devicedisk.py
+++ virt-manager-1.4.2/virtinst/devicedisk.py +++ virt-manager-1.5.0/virtinst/devicedisk.py
@@ -552,7 +552,8 @@ class VirtualDisk(VirtualDevice): @@ -561,7 +561,8 @@ class VirtualDisk(VirtualDevice):
# Recommended xen defaults from here: # Recommended xen defaults from here:
# https://bugzilla.redhat.com/show_bug.cgi?id=1171550#c9 # https://bugzilla.redhat.com/show_bug.cgi?id=1171550#c9
# If type block, use name=phy. Otherwise do the same as qemu # If type block, use name=phy. Otherwise do the same as qemu

View File

@ -4,11 +4,11 @@ a non pae version. The sles10 sp4 32bit kernel will only boot para-
virtualized if the pae kernel is selected. virtualized if the pae kernel is selected.
Note that sles12 and newer has no 32bit release. Note that sles12 and newer has no 32bit release.
Index: virt-manager-1.4.2/virtinst/urlfetcher.py Index: virt-manager-1.5.0/virtinst/urlfetcher.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py --- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py +++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -1025,8 +1025,12 @@ class SuseDistro(Distro): @@ -1049,8 +1049,12 @@ class SuseDistro(Distro):
"boot/%s/initrd" % self.arch)) "boot/%s/initrd" % self.arch))
# Matches Opensuse > 10.2 and sles 10 # Matches Opensuse > 10.2 and sles 10

View File

@ -4,11 +4,11 @@ issue on btrfs.
Signed-off-by: Chunyan Liu <cyliu@suse.com> Signed-off-by: Chunyan Liu <cyliu@suse.com>
Index: virt-manager-1.4.3/virtinst/storage.py Index: virt-manager-1.5.0/virtinst/storage.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/storage.py --- virt-manager-1.5.0.orig/virtinst/storage.py
+++ virt-manager-1.4.3/virtinst/storage.py +++ virt-manager-1.5.0/virtinst/storage.py
@@ -708,6 +708,12 @@ class StorageVolume(_StorageObject): @@ -701,6 +701,12 @@ class StorageVolume(_StorageObject):
return self._pool_xml.get_disk_type() return self._pool_xml.get_disk_type()
file_type = property(_get_vol_type) file_type = property(_get_vol_type)
@ -21,10 +21,10 @@ Index: virt-manager-1.4.3/virtinst/storage.py
################## ##################
# XML properties # # XML properties #
Index: virt-manager-1.4.3/virtinst/support.py Index: virt-manager-1.5.0/virtinst/support.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/support.py --- virt-manager-1.5.0.orig/virtinst/support.py
+++ virt-manager-1.4.3/virtinst/support.py +++ virt-manager-1.5.0/virtinst/support.py
@@ -326,6 +326,8 @@ SUPPORT_CONN_USB3_PORTS = _make(version= @@ -326,6 +326,8 @@ SUPPORT_CONN_USB3_PORTS = _make(version=
SUPPORT_CONN_MACHVIRT_PCI_DEFAULT = _make(version="3.0.0") SUPPORT_CONN_MACHVIRT_PCI_DEFAULT = _make(version="3.0.0")
SUPPORT_CONN_QEMU_XHCI = _make(version="3.3.0") SUPPORT_CONN_QEMU_XHCI = _make(version="3.3.0")

View File

@ -2,11 +2,11 @@ Reference: bnc#813082
Virt-manager on Xen doesn't fill in any type thereby defaulting to Virt-manager on Xen doesn't fill in any type thereby defaulting to
'raw'. This patch will generate the correct XML on Xen. 'raw'. This patch will generate the correct XML on Xen.
Index: virt-manager-1.4.2/virtinst/devicedisk.py Index: virt-manager-1.5.0/virtinst/devicedisk.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtinst/devicedisk.py --- virt-manager-1.5.0.orig/virtinst/devicedisk.py
+++ virt-manager-1.4.2/virtinst/devicedisk.py +++ virt-manager-1.5.0/virtinst/devicedisk.py
@@ -570,6 +570,10 @@ class VirtualDisk(VirtualDevice): @@ -579,6 +579,10 @@ class VirtualDisk(VirtualDevice):
http://lists.gnu.org/archive/html/qemu-devel/2008-04/msg00675.html http://lists.gnu.org/archive/html/qemu-devel/2008-04/msg00675.html
""" """
if self.driver_name != self.DRIVER_NAME_QEMU: if self.driver_name != self.DRIVER_NAME_QEMU:

View File

@ -6,11 +6,11 @@ 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 passed to qemu where it error'ed out with the disks having the same
index (in this case both are 0). index (in this case both are 0).
Index: virt-manager-1.4.3/virtinst/devicedisk.py Index: virt-manager-1.5.0/virtinst/devicedisk.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtinst/devicedisk.py --- virt-manager-1.5.0.orig/virtinst/devicedisk.py
+++ virt-manager-1.4.3/virtinst/devicedisk.py +++ virt-manager-1.5.0/virtinst/devicedisk.py
@@ -1004,6 +1004,17 @@ class VirtualDisk(VirtualDevice): @@ -1036,6 +1036,17 @@ class VirtualDisk(VirtualDevice):
@rtype C{str} @rtype C{str}
""" """
prefix, maxnode = self.get_target_prefix(skip_targets) prefix, maxnode = self.get_target_prefix(skip_targets)
@ -28,7 +28,7 @@ Index: virt-manager-1.4.3/virtinst/devicedisk.py
skip_targets = [t for t in skip_targets if t and t.startswith(prefix)] skip_targets = [t for t in skip_targets if t and t.startswith(prefix)]
skip_targets.sort() skip_targets.sort()
@@ -1017,7 +1028,12 @@ class VirtualDisk(VirtualDevice): @@ -1049,7 +1060,12 @@ class VirtualDisk(VirtualDevice):
ran = range(pref_ctrl * 7, (pref_ctrl + 1) * 7) ran = range(pref_ctrl * 7, (pref_ctrl + 1) * 7)
for i in ran: for i in ran:

View File

@ -1,10 +1,10 @@
Enhancement for when no hypervisor can be found locally it opens Enhancement for when no hypervisor can be found locally it opens
the new connection dialog. the new connection dialog.
Index: virt-manager-1.4.2/virtManager/engine.py Index: virt-manager-1.5.0/virtManager/engine.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtManager/engine.py --- virt-manager-1.5.0.orig/virtManager/engine.py
+++ virt-manager-1.4.2/virtManager/engine.py +++ virt-manager-1.5.0/virtManager/engine.py
@@ -236,9 +236,6 @@ class vmmEngine(vmmGObject): @@ -239,9 +239,6 @@ class vmmEngine(vmmGObject):
except Exception: except Exception:
logging.exception("Error talking to PackageKit") logging.exception("Error talking to PackageKit")
@ -14,7 +14,7 @@ Index: virt-manager-1.4.2/virtManager/engine.py
warnmsg = _("The 'libvirtd' service will need to be started.\n\n" warnmsg = _("The 'libvirtd' service will need to be started.\n\n"
"After that, virt-manager will connect to libvirt on\n" "After that, virt-manager will connect to libvirt on\n"
"the next application start up.") "the next application start up.")
@@ -252,7 +249,11 @@ class vmmEngine(vmmGObject): @@ -255,7 +252,11 @@ class vmmEngine(vmmGObject):
if not connected and do_start: if not connected and do_start:
manager.err.ok(_("Libvirt service must be started"), warnmsg) manager.err.ok(_("Libvirt service must be started"), warnmsg)

View File

@ -1,11 +1,11 @@
References: bsc#919692 References: bsc#919692
Because openSUSE repos combine 32 and 64 bit sources we need to Because openSUSE repos combine 32 and 64 bit sources we need to
continue showing the 'Architecture' pop-up. continue showing the 'Architecture' pop-up.
Index: virt-manager-1.4.2/virtManager/create.py Index: virt-manager-1.5.0/virtManager/create.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtManager/create.py --- virt-manager-1.5.0.orig/virtManager/create.py
+++ virt-manager-1.4.2/virtManager/create.py +++ virt-manager-1.5.0/virtManager/create.py
@@ -847,11 +847,6 @@ class vmmCreate(vmmGObjectUI): @@ -849,11 +849,6 @@ class vmmCreate(vmmGObjectUI):
for guest in self.conn.caps.guests: for guest in self.conn.caps.guests:
if guest.os_type == self._capsinfo.os_type: if guest.os_type == self._capsinfo.os_type:
archs.append(guest.arch) archs.append(guest.arch)

View File

@ -6,11 +6,11 @@ Steps to get a KVM VM in the crashed state:
4) Edit the VM's /etc/default/grub file and remove the crashkernel information 4) Edit the VM's /etc/default/grub file and remove the crashkernel information
and then run grub2-mkconfig /boot/grub2/grub.cfg. 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" 5) Start the VM and within the VM's terminal type "echo 'c' > /proc/sysrq-trigger"
Index: virt-manager-1.4.3/virtManager/manager.py Index: virt-manager-1.5.0/virtManager/manager.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/manager.py --- virt-manager-1.5.0.orig/virtManager/manager.py
+++ virt-manager-1.4.3/virtManager/manager.py +++ virt-manager-1.5.0/virtManager/manager.py
@@ -843,7 +843,7 @@ class vmmManager(vmmGObjectUI): @@ -844,7 +844,7 @@ class vmmManager(vmmGObjectUI):
show_pause = bool(vm and vm.is_unpauseable()) show_pause = bool(vm and vm.is_unpauseable())
else: else:
show_pause = bool(vm and vm.is_pauseable()) show_pause = bool(vm and vm.is_pauseable())
@ -19,10 +19,10 @@ Index: virt-manager-1.4.3/virtManager/manager.py
if vm and vm.managedsave_supported: if vm and vm.managedsave_supported:
self.change_run_text(vm.has_managed_save()) self.change_run_text(vm.has_managed_save())
Index: virt-manager-1.4.3/virtManager/vmmenu.py Index: virt-manager-1.5.0/virtManager/vmmenu.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/vmmenu.py --- virt-manager-1.5.0.orig/virtManager/vmmenu.py
+++ virt-manager-1.4.3/virtManager/vmmenu.py +++ virt-manager-1.5.0/virtManager/vmmenu.py
@@ -31,6 +31,7 @@ class _VMMenu(Gtk.Menu): @@ -31,6 +31,7 @@ class _VMMenu(Gtk.Menu):
self._parent = src self._parent = src
self._current_vm_cb = current_vm_cb self._current_vm_cb = current_vm_cb

View File

@ -1,9 +1,9 @@
Enhancement to default to the host os version when creating a VM Enhancement to default to the host os version when creating a VM
and media detection of the install source is turned off. and media detection of the install source is turned off.
Index: virt-manager-1.4.3/virtManager/create.py Index: virt-manager-1.5.0/virtManager/create.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/create.py --- virt-manager-1.5.0.orig/virtManager/create.py
+++ virt-manager-1.4.3/virtManager/create.py +++ virt-manager-1.5.0/virtManager/create.py
@@ -24,6 +24,9 @@ import pkgutil @@ -24,6 +24,9 @@ import pkgutil
import os import os
import threading import threading
@ -14,7 +14,7 @@ Index: virt-manager-1.4.3/virtManager/create.py
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gtk from gi.repository import Gtk
@@ -1505,6 +1508,63 @@ class vmmCreate(vmmGObjectUI): @@ -1511,6 +1514,63 @@ class vmmCreate(vmmGObjectUI):
def _cdrom_changed(self, src): def _cdrom_changed(self, src):
self._detectable_media_widget_changed(src) self._detectable_media_widget_changed(src)
@ -78,7 +78,7 @@ Index: virt-manager-1.4.3/virtManager/create.py
def _toggle_detect_os(self, src): def _toggle_detect_os(self, src):
dodetect = src.get_active() dodetect = src.get_active()
@@ -1517,6 +1577,8 @@ class vmmCreate(vmmGObjectUI): @@ -1523,6 +1583,8 @@ class vmmCreate(vmmGObjectUI):
self.widget("install-os-version-entry").set_text("") self.widget("install-os-version-entry").set_text("")
self._os_already_detected_for_media = False self._os_already_detected_for_media = False
self._start_detect_os_if_needed() self._start_detect_os_if_needed()

View File

@ -1,9 +1,9 @@
Enhancement to default to PV instead of HVM on Xen host. Enhancement to default to PV instead of HVM on Xen host.
Index: virt-manager-1.4.2/virtManager/create.py Index: virt-manager-1.5.0/virtManager/create.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtManager/create.py --- virt-manager-1.5.0.orig/virtManager/create.py
+++ virt-manager-1.4.2/virtManager/create.py +++ virt-manager-1.5.0/virtManager/create.py
@@ -757,7 +757,12 @@ class vmmCreate(vmmGObjectUI): @@ -759,7 +759,12 @@ class vmmCreate(vmmGObjectUI):
if gtype is None: if gtype is None:
# If none specified, prefer HVM so install options aren't limited # If none specified, prefer HVM so install options aren't limited
# with a default PV choice. # with a default PV choice.

View File

@ -1,10 +1,10 @@
/usr/bin/kvm doesn't exist on suse distros so check instead for /usr/bin/kvm doesn't exist on suse distros so check instead for
/usr/bin/qemu-system-x86_64 /usr/bin/qemu-system-x86_64
Index: virt-manager-1.4.2/virtManager/connect.py Index: virt-manager-1.5.0/virtManager/connect.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtManager/connect.py --- virt-manager-1.5.0.orig/virtManager/connect.py
+++ virt-manager-1.4.2/virtManager/connect.py +++ virt-manager-1.5.0/virtManager/connect.py
@@ -116,7 +116,7 @@ class vmmConnect(vmmGObjectUI): @@ -117,7 +117,7 @@ class vmmConnect(vmmGObjectUI):
if (os.path.exists("/usr/bin/qemu") or if (os.path.exists("/usr/bin/qemu") or
os.path.exists("/usr/bin/qemu-kvm") or os.path.exists("/usr/bin/qemu-kvm") or

View File

@ -1,8 +1,8 @@
Index: virt-manager-1.3.2/virtManager/engine.py Index: virt-manager-1.5.0/virtManager/engine.py
=================================================================== ===================================================================
--- virt-manager-1.3.2.orig/virtManager/engine.py --- virt-manager-1.5.0.orig/virtManager/engine.py
+++ virt-manager-1.3.2/virtManager/engine.py +++ virt-manager-1.5.0/virtManager/engine.py
@@ -257,9 +257,22 @@ class vmmEngine(vmmGObject): @@ -260,9 +260,22 @@ class vmmEngine(vmmGObject):
def load_stored_uris(self): def load_stored_uris(self):
uris = self.config.get_conn_uris() or [] uris = self.config.get_conn_uris() or []

View File

@ -4,10 +4,10 @@ This is not a normal situation on a suse distro. Split out required
libvirt packages (kvm vs xen). Only install those libvirt packages libvirt packages (kvm vs xen). Only install those libvirt packages
for which the host is booted. This patch has a corresponding spec for which the host is booted. This patch has a corresponding spec
file change (%define libvirt_kvm_packages and %define libvirt_xen_packages). file change (%define libvirt_kvm_packages and %define libvirt_xen_packages).
Index: virt-manager-1.4.2/setup.py Index: virt-manager-1.5.0/setup.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/setup.py --- virt-manager-1.5.0.orig/setup.py
+++ virt-manager-1.4.2/setup.py +++ virt-manager-1.5.0/setup.py
@@ -308,8 +308,11 @@ class configure(distutils.core.Command): @@ -308,8 +308,11 @@ class configure(distutils.core.Command):
("prefix=", None, "installation prefix"), ("prefix=", None, "installation prefix"),
("qemu-user=", None, ("qemu-user=", None,
@ -45,10 +45,10 @@ Index: virt-manager-1.4.2/setup.py
if self.kvm_package_names is not None: if self.kvm_package_names is not None:
template += "hv_packages = %s\n" % self.kvm_package_names template += "hv_packages = %s\n" % self.kvm_package_names
if self.askpass_package_names is not None: if self.askpass_package_names is not None:
Index: virt-manager-1.4.2/virtcli/cliconfig.py Index: virt-manager-1.5.0/virtcli/cliconfig.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtcli/cliconfig.py --- virt-manager-1.5.0.orig/virtcli/cliconfig.py
+++ virt-manager-1.4.2/virtcli/cliconfig.py +++ virt-manager-1.5.0/virtcli/cliconfig.py
@@ -83,7 +83,8 @@ class _CLIConfig(object): @@ -83,7 +83,8 @@ class _CLIConfig(object):
_get_param("preferred_distros", "")) _get_param("preferred_distros", ""))
self.hv_packages = _split_list(_get_param("hv_packages", "")) self.hv_packages = _split_list(_get_param("hv_packages", ""))
@ -59,11 +59,11 @@ Index: virt-manager-1.4.2/virtcli/cliconfig.py
self.default_graphics = _get_param("default_graphics", "spice") self.default_graphics = _get_param("default_graphics", "spice")
self.default_hvs = _split_list(_get_param("default_hvs", "")) self.default_hvs = _split_list(_get_param("default_hvs", ""))
Index: virt-manager-1.4.2/virtManager/config.py Index: virt-manager-1.5.0/virtManager/config.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtManager/config.py --- virt-manager-1.5.0.orig/virtManager/config.py
+++ virt-manager-1.4.2/virtManager/config.py +++ virt-manager-1.5.0/virtManager/config.py
@@ -172,7 +172,8 @@ class vmmConfig(object): @@ -183,7 +183,8 @@ class vmmConfig(object):
self.default_qemu_user = CLIConfig.default_qemu_user self.default_qemu_user = CLIConfig.default_qemu_user
self.preferred_distros = CLIConfig.preferred_distros self.preferred_distros = CLIConfig.preferred_distros
self.hv_packages = CLIConfig.hv_packages self.hv_packages = CLIConfig.hv_packages
@ -73,11 +73,11 @@ Index: virt-manager-1.4.2/virtManager/config.py
self.askpass_package = CLIConfig.askpass_package self.askpass_package = CLIConfig.askpass_package
self.default_graphics_from_config = CLIConfig.default_graphics self.default_graphics_from_config = CLIConfig.default_graphics
self.default_hvs = CLIConfig.default_hvs self.default_hvs = CLIConfig.default_hvs
Index: virt-manager-1.4.2/virtManager/engine.py Index: virt-manager-1.5.0/virtManager/engine.py
=================================================================== ===================================================================
--- virt-manager-1.4.2.orig/virtManager/engine.py --- virt-manager-1.5.0.orig/virtManager/engine.py
+++ virt-manager-1.4.2/virtManager/engine.py +++ virt-manager-1.5.0/virtManager/engine.py
@@ -226,22 +226,18 @@ class vmmEngine(vmmGObject): @@ -229,22 +229,18 @@ class vmmEngine(vmmGObject):
ret = None ret = None
try: try:

View File

@ -1,7 +1,7 @@
Index: virt-manager-1.4.3/virt-manager Index: virt-manager-1.5.0/virt-manager
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virt-manager --- virt-manager-1.5.0.orig/virt-manager
+++ virt-manager-1.4.3/virt-manager +++ virt-manager-1.5.0/virt-manager
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-#!/usr/bin/env python2 -#!/usr/bin/env python2
+#!/usr/bin/python3 +#!/usr/bin/python3
@ -17,10 +17,10 @@ Index: virt-manager-1.4.3/virt-manager
# This will error if Gtk wasn't correctly initialized # This will error if Gtk wasn't correctly initialized
Gtk.Window() Gtk.Window()
else: else:
Index: virt-manager-1.4.3/virtManager/network.py Index: virt-manager-1.5.0/virtManager/network.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/network.py --- virt-manager-1.5.0.orig/virtManager/network.py
+++ virt-manager-1.4.3/virtManager/network.py +++ virt-manager-1.5.0/virtManager/network.py
@@ -103,7 +103,7 @@ class vmmNetwork(vmmLibvirtObject): @@ -103,7 +103,7 @@ class vmmNetwork(vmmLibvirtObject):
def set_qos(self, **kwargs): def set_qos(self, **kwargs):
xmlobj = self._make_xmlobj_to_define() xmlobj = self._make_xmlobj_to_define()
@ -30,10 +30,10 @@ Index: virt-manager-1.4.3/virtManager/network.py
setattr(q, key, val) setattr(q, key, val)
self._redefine_xmlobj(xmlobj) self._redefine_xmlobj(xmlobj)
Index: virt-manager-1.4.3/virtManager/inspection.py Index: virt-manager-1.5.0/virtManager/inspection.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/inspection.py --- virt-manager-1.5.0.orig/virtManager/inspection.py
+++ virt-manager-1.4.3/virtManager/inspection.py +++ virt-manager-1.5.0/virtManager/inspection.py
@@ -17,8 +17,9 @@ @@ -17,8 +17,9 @@
# MA 02110-1301 USA. # MA 02110-1301 USA.
# #
@ -63,10 +63,10 @@ Index: virt-manager-1.4.3/virtManager/inspection.py
data.error = False data.error = False
return data return data
Index: virt-manager-1.4.3/virtManager/systray.py Index: virt-manager-1.5.0/virtManager/systray.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/systray.py --- virt-manager-1.5.0.orig/virtManager/systray.py
+++ virt-manager-1.4.3/virtManager/systray.py +++ virt-manager-1.5.0/virtManager/systray.py
@@ -199,13 +199,13 @@ class vmmSystray(vmmGObject): @@ -199,13 +199,13 @@ class vmmSystray(vmmGObject):
def repopulate_menu_list(self): def repopulate_menu_list(self):
@ -92,10 +92,10 @@ Index: virt-manager-1.4.3/virtManager/systray.py
vm_names.sort() vm_names.sort()
if len(vm_names) == 0: if len(vm_names) == 0:
Index: virt-manager-1.4.3/virtManager/console.py Index: virt-manager-1.5.0/virtManager/console.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/console.py --- virt-manager-1.5.0.orig/virtManager/console.py
+++ virt-manager-1.4.3/virtManager/console.py +++ virt-manager-1.5.0/virtManager/console.py
@@ -35,7 +35,7 @@ from .viewers import SpiceViewer, VNCVie @@ -35,7 +35,7 @@ from .viewers import SpiceViewer, VNCVie
(_CONSOLE_PAGE_UNAVAILABLE, (_CONSOLE_PAGE_UNAVAILABLE,
_CONSOLE_PAGE_AUTHENTICATE, _CONSOLE_PAGE_AUTHENTICATE,
@ -105,10 +105,10 @@ Index: virt-manager-1.4.3/virtManager/console.py
class _TimedRevealer(vmmGObject): class _TimedRevealer(vmmGObject):
Index: virt-manager-1.4.3/virtManager/connection.py Index: virt-manager-1.5.0/virtManager/connection.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/connection.py --- virt-manager-1.5.0.orig/virtManager/connection.py
+++ virt-manager-1.4.3/virtManager/connection.py +++ virt-manager-1.5.0/virtManager/connection.py
@@ -198,7 +198,7 @@ class vmmConnection(vmmGObject): @@ -198,7 +198,7 @@ class vmmConnection(vmmGObject):
(_STATE_DISCONNECTED, (_STATE_DISCONNECTED,
@ -159,10 +159,10 @@ Index: virt-manager-1.4.3/virtManager/connection.py
return pollhelpers.fetch_vms(self._backend, keymap, return pollhelpers.fetch_vms(self._backend, keymap,
(lambda obj, key: vmmDomain(self, obj, key))) (lambda obj, key: vmmDomain(self, obj, key)))
Index: virt-manager-1.4.3/virtManager/addhardware.py Index: virt-manager-1.5.0/virtManager/addhardware.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/addhardware.py --- virt-manager-1.5.0.orig/virtManager/addhardware.py
+++ virt-manager-1.4.3/virtManager/addhardware.py +++ virt-manager-1.5.0/virtManager/addhardware.py
@@ -57,7 +57,7 @@ from .addstorage import vmmAddStorage @@ -57,7 +57,7 @@ from .addstorage import vmmAddStorage
PAGE_USBREDIR, PAGE_USBREDIR,
PAGE_TPM, PAGE_TPM,
@ -172,7 +172,7 @@ Index: virt-manager-1.4.3/virtManager/addhardware.py
class vmmAddHardware(vmmGObjectUI): class vmmAddHardware(vmmGObjectUI):
@@ -1160,7 +1160,7 @@ class vmmAddHardware(vmmGObjectUI): @@ -1164,7 +1164,7 @@ class vmmAddHardware(vmmGObjectUI):
self._dev = VirtualTPMDevice(self.conn.get_backend()) self._dev = VirtualTPMDevice(self.conn.get_backend())
self._dev.type = devtype self._dev.type = devtype
@ -181,7 +181,7 @@ Index: virt-manager-1.4.3/virtManager/addhardware.py
make_visible = self._dev.supports_property(param_name) make_visible = self._dev.supports_property(param_name)
uiutil.set_grid_row_visible(self.widget(widget_name + "-label"), uiutil.set_grid_row_visible(self.widget(widget_name + "-label"),
make_visible) make_visible)
@@ -1214,7 +1214,7 @@ class vmmAddHardware(vmmGObjectUI): @@ -1218,7 +1218,7 @@ class vmmAddHardware(vmmGObjectUI):
self._dev = char_class(self.conn.get_backend()) self._dev = char_class(self.conn.get_backend())
self._dev.type = devtype self._dev.type = devtype
@ -190,7 +190,7 @@ Index: virt-manager-1.4.3/virtManager/addhardware.py
make_visible = self._dev.supports_property(param_name) make_visible = self._dev.supports_property(param_name)
uiutil.set_grid_row_visible(self.widget(widget_name + "-label"), uiutil.set_grid_row_visible(self.widget(widget_name + "-label"),
make_visible) make_visible)
@@ -1669,7 +1669,7 @@ class vmmAddHardware(vmmGObjectUI): @@ -1671,7 +1671,7 @@ class vmmAddHardware(vmmGObjectUI):
try: try:
self._dev = devclass self._dev = devclass
@ -199,7 +199,7 @@ Index: virt-manager-1.4.3/virtManager/addhardware.py
if self._dev.supports_property(param_name) and val is not None: if self._dev.supports_property(param_name) and val is not None:
setattr(self._dev, param_name, val) setattr(self._dev, param_name, val)
@@ -1750,7 +1750,7 @@ class vmmAddHardware(vmmGObjectUI): @@ -1752,7 +1752,7 @@ class vmmAddHardware(vmmGObjectUI):
try: try:
self._dev = VirtualTPMDevice(conn) self._dev = VirtualTPMDevice(conn)
self._dev.type = typ self._dev.type = typ
@ -208,7 +208,7 @@ Index: virt-manager-1.4.3/virtManager/addhardware.py
if self._dev.supports_property(param_name): if self._dev.supports_property(param_name):
setattr(self._dev, param_name, val) setattr(self._dev, param_name, val)
except Exception as e: except Exception as e:
@@ -1854,7 +1854,7 @@ class vmmAddHardware(vmmGObjectUI): @@ -1856,7 +1856,7 @@ class vmmAddHardware(vmmGObjectUI):
try: try:
self._dev = virtinst.VirtualRNGDevice(self.conn.get_backend()) self._dev = virtinst.VirtualRNGDevice(self.conn.get_backend())
self._dev.type = rtype self._dev.type = rtype
@ -217,10 +217,10 @@ Index: virt-manager-1.4.3/virtManager/addhardware.py
if self._dev.supports_property(param_name): if self._dev.supports_property(param_name):
setattr(self._dev, param_name, val) setattr(self._dev, param_name, val)
except Exception as e: except Exception as e:
Index: virt-manager-1.4.3/virtManager/createinterface.py Index: virt-manager-1.5.0/virtManager/createinterface.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/createinterface.py --- virt-manager-1.5.0.orig/virtManager/createinterface.py
+++ virt-manager-1.4.3/virtManager/createinterface.py +++ virt-manager-1.5.0/virtManager/createinterface.py
@@ -387,7 +387,7 @@ class vmmCreateInterface(vmmGObjectUI): @@ -387,7 +387,7 @@ class vmmCreateInterface(vmmGObjectUI):
Interface.INTERFACE_TYPE_VLAN: "vlan", Interface.INTERFACE_TYPE_VLAN: "vlan",
} }
@ -254,10 +254,10 @@ Index: virt-manager-1.4.3/virtManager/createinterface.py
model.append(row) model.append(row)
def get_default_name(self): def get_default_name(self):
Index: virt-manager-1.4.3/virtManager/snapshots.py Index: virt-manager-1.5.0/virtManager/snapshots.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/snapshots.py --- virt-manager-1.5.0.orig/virtManager/snapshots.py
+++ virt-manager-1.4.3/virtManager/snapshots.py +++ virt-manager-1.5.0/virtManager/snapshots.py
@@ -44,7 +44,7 @@ mimemap = { @@ -44,7 +44,7 @@ mimemap = {
@ -276,10 +276,10 @@ Index: virt-manager-1.4.3/virtManager/snapshots.py
p = basesn + "." + ext p = basesn + "." + ext
if os.path.exists(basesn + "." + ext): if os.path.exists(basesn + "." + ext):
os.unlink(p) os.unlink(p)
Index: virt-manager-1.4.3/virtManager/graphwidgets.py Index: virt-manager-1.5.0/virtManager/graphwidgets.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/graphwidgets.py --- virt-manager-1.5.0.orig/virtManager/graphwidgets.py
+++ virt-manager-1.4.3/virtManager/graphwidgets.py +++ virt-manager-1.5.0/virtManager/graphwidgets.py
@@ -25,8 +25,8 @@ from gi.repository import Gtk @@ -25,8 +25,8 @@ from gi.repository import Gtk
def rect_print(name, rect): def rect_print(name, rect):
@ -291,10 +291,10 @@ Index: virt-manager-1.4.3/virtManager/graphwidgets.py
def _line_helper(cairo_ct, x, y, w, h, points, for_fill=False): def _line_helper(cairo_ct, x, y, w, h, points, for_fill=False):
Index: virt-manager-1.4.3/virtManager/host.py Index: virt-manager-1.5.0/virtManager/host.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/host.py --- virt-manager-1.5.0.orig/virtManager/host.py
+++ virt-manager-1.4.3/virtManager/host.py +++ virt-manager-1.5.0/virtManager/host.py
@@ -43,11 +43,11 @@ EDIT_NET_IDS = ( @@ -43,11 +43,11 @@ EDIT_NET_IDS = (
EDIT_NET_NAME, EDIT_NET_NAME,
EDIT_NET_AUTOSTART, EDIT_NET_AUTOSTART,
@ -309,10 +309,10 @@ Index: virt-manager-1.4.3/virtManager/host.py
class vmmHost(vmmGObjectUI): class vmmHost(vmmGObjectUI):
Index: virt-manager-1.4.3/virtManager/sshtunnels.py Index: virt-manager-1.5.0/virtManager/sshtunnels.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/sshtunnels.py --- virt-manager-1.5.0.orig/virtManager/sshtunnels.py
+++ virt-manager-1.4.3/virtManager/sshtunnels.py +++ virt-manager-1.5.0/virtManager/sshtunnels.py
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
import functools import functools
import logging import logging
@ -331,10 +331,10 @@ Index: virt-manager-1.4.3/virtManager/sshtunnels.py
self._lock = threading.Lock() self._lock = threading.Lock()
def _handle_queue(self): def _handle_queue(self):
Index: virt-manager-1.4.3/virtManager/engine.py Index: virt-manager-1.5.0/virtManager/engine.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/engine.py --- virt-manager-1.5.0.orig/virtManager/engine.py
+++ virt-manager-1.4.3/virtManager/engine.py +++ virt-manager-1.5.0/virtManager/engine.py
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
import logging import logging
@ -353,7 +353,7 @@ Index: virt-manager-1.4.3/virtManager/engine.py
class vmmEngine(vmmGObject): class vmmEngine(vmmGObject):
@@ -104,7 +104,7 @@ class vmmEngine(vmmGObject): @@ -105,7 +105,7 @@ class vmmEngine(vmmGObject):
target=self._handle_tick_queue, target=self._handle_tick_queue,
args=()) args=())
self._tick_thread.daemon = True self._tick_thread.daemon = True
@ -362,16 +362,16 @@ Index: virt-manager-1.4.3/virtManager/engine.py
self.inspection = None self.inspection = None
self._create_inspection_thread() self._create_inspection_thread()
@@ -153,7 +153,7 @@ class vmmEngine(vmmGObject): @@ -154,7 +154,7 @@ class vmmEngine(vmmGObject):
self._application.add_action(action) self._application.add_action(action)
def _default_startup(self, skip_autostart): def _default_startup(self, skip_autostart, cliuri):
- uris = self.conns.keys() - uris = self.conns.keys()
+ uris = list(self.conns.keys()) + uris = list(self.conns.keys())
if not uris: if not uris:
logging.debug("No stored URIs found.") logging.debug("No stored URIs found.")
else: else:
@@ -279,15 +279,15 @@ class vmmEngine(vmmGObject): @@ -282,15 +282,15 @@ class vmmEngine(vmmGObject):
""" """
We serialize conn autostart, so polkit/ssh-askpass doesn't spam We serialize conn autostart, so polkit/ssh-askpass doesn't spam
""" """
@ -390,7 +390,7 @@ Index: virt-manager-1.4.3/virtManager/engine.py
def state_change_cb(conn): def state_change_cb(conn):
if conn.is_active(): if conn.is_active():
@@ -299,7 +299,7 @@ class vmmEngine(vmmGObject): @@ -302,7 +302,7 @@ class vmmEngine(vmmGObject):
def handle_queue(): def handle_queue():
while True: while True:
@ -399,7 +399,7 @@ Index: virt-manager-1.4.3/virtManager/engine.py
if uri is None: if uri is None:
return return
if uri not in self.conns: if uri not in self.conns:
@@ -336,7 +336,7 @@ class vmmEngine(vmmGObject): @@ -339,7 +339,7 @@ class vmmEngine(vmmGObject):
hvuri = conn.get_uri() hvuri = conn.get_uri()
@ -408,7 +408,7 @@ Index: virt-manager-1.4.3/virtManager/engine.py
self.conns[hvuri]["windowDetails"][connkey].cleanup() self.conns[hvuri]["windowDetails"][connkey].cleanup()
del(self.conns[hvuri]["windowDetails"][connkey]) del(self.conns[hvuri]["windowDetails"][connkey])
@@ -521,10 +521,10 @@ class vmmEngine(vmmGObject): @@ -524,10 +524,10 @@ class vmmEngine(vmmGObject):
focus, and use that focus, and use that
""" """
windowlist = [self.windowManager] windowlist = [self.windowManager]
@ -422,7 +422,7 @@ Index: virt-manager-1.4.3/virtManager/engine.py
use_win = None use_win = None
for window in windowlist: for window in windowlist:
@@ -600,7 +600,7 @@ class vmmEngine(vmmGObject): @@ -603,7 +603,7 @@ class vmmEngine(vmmGObject):
self.conns[uri]["windowClone"].cleanup() self.conns[uri]["windowClone"].cleanup()
details = self.conns[uri]["windowDetails"] details = self.conns[uri]["windowDetails"]
@ -431,7 +431,7 @@ Index: virt-manager-1.4.3/virtManager/engine.py
win.cleanup() win.cleanup()
self.conns[uri]["conn"].cleanup() self.conns[uri]["conn"].cleanup()
@@ -620,7 +620,7 @@ class vmmEngine(vmmGObject): @@ -623,7 +623,7 @@ class vmmEngine(vmmGObject):
handle_id = vmmGObject.connect(self, name, callback, *args) handle_id = vmmGObject.connect(self, name, callback, *args)
if name == "conn-added": if name == "conn-added":
@ -440,7 +440,7 @@ Index: virt-manager-1.4.3/virtManager/engine.py
self.emit("conn-added", conn_dict["conn"]) self.emit("conn-added", conn_dict["conn"])
return handle_id return handle_id
@@ -770,7 +770,7 @@ class vmmEngine(vmmGObject): @@ -773,7 +773,7 @@ class vmmEngine(vmmGObject):
return self.connect_to_uri(uri, autoconnect, probe=True) return self.connect_to_uri(uri, autoconnect, probe=True)
def cancelled(src): def cancelled(src):
@ -449,10 +449,10 @@ Index: virt-manager-1.4.3/virtManager/engine.py
self.exit_app(src) self.exit_app(src)
obj = vmmConnect() obj = vmmConnect()
Index: virt-manager-1.4.3/virtManager/mediacombo.py Index: virt-manager-1.5.0/virtManager/mediacombo.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/mediacombo.py --- virt-manager-1.5.0.orig/virtManager/mediacombo.py
+++ virt-manager-1.4.3/virtManager/mediacombo.py +++ virt-manager-1.5.0/virtManager/mediacombo.py
@@ -33,7 +33,7 @@ class vmmMediaCombo(vmmGObjectUI): @@ -33,7 +33,7 @@ class vmmMediaCombo(vmmGObjectUI):
(OPTICAL_DEV_PATH, (OPTICAL_DEV_PATH,
OPTICAL_LABEL, OPTICAL_LABEL,
@ -462,10 +462,10 @@ Index: virt-manager-1.4.3/virtManager/mediacombo.py
def __init__(self, conn, builder, topwin, media_type): def __init__(self, conn, builder, topwin, media_type):
vmmGObjectUI.__init__(self, None, None, builder=builder, topwin=topwin) vmmGObjectUI.__init__(self, None, None, builder=builder, topwin=topwin)
Index: virt-manager-1.4.3/virtManager/clone.py Index: virt-manager-1.5.0/virtManager/clone.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/clone.py --- virt-manager-1.5.0.orig/virtManager/clone.py
+++ virt-manager-1.4.3/virtManager/clone.py +++ virt-manager-1.5.0/virtManager/clone.py
@@ -336,7 +336,7 @@ class vmmCloneVM(vmmGObjectUI): @@ -336,7 +336,7 @@ class vmmCloneVM(vmmGObjectUI):
build_net_row(label, mac, newmac) build_net_row(label, mac, newmac)
@ -493,10 +493,10 @@ Index: virt-manager-1.4.3/virtManager/clone.py
can_clone = row[STORAGE_INFO_CAN_CLONE] can_clone = row[STORAGE_INFO_CAN_CLONE]
can_share = row[STORAGE_INFO_CAN_SHARE] can_share = row[STORAGE_INFO_CAN_SHARE]
if not (can_clone or can_share): if not (can_clone or can_share):
Index: virt-manager-1.4.3/virtManager/netlist.py Index: virt-manager-1.5.0/virtManager/netlist.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/netlist.py --- virt-manager-1.5.0.orig/virtManager/netlist.py
+++ virt-manager-1.4.3/virtManager/netlist.py +++ virt-manager-1.5.0/virtManager/netlist.py
@@ -197,7 +197,7 @@ class vmmNetworkList(vmmGObjectUI): @@ -197,7 +197,7 @@ class vmmNetworkList(vmmGObjectUI):
for slave in slave_names: for slave in slave_names:
netdevs.pop(slave, None) netdevs.pop(slave, None)
@ -506,10 +506,10 @@ Index: virt-manager-1.4.3/virtManager/netlist.py
if ((name in vnet_taps) or if ((name in vnet_taps) or
(name in [v + "-nic" for v in vnet_bridges]) or (name in [v + "-nic" for v in vnet_bridges]) or
(name in skip_ifaces)): (name in skip_ifaces)):
Index: virt-manager-1.4.3/virtManager/manager.py Index: virt-manager-1.5.0/virtManager/manager.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/manager.py --- virt-manager-1.5.0.orig/virtManager/manager.py
+++ virt-manager-1.4.3/virtManager/manager.py +++ virt-manager-1.5.0/virtManager/manager.py
@@ -48,7 +48,7 @@ ROW_IS_CONN_CONNECTED, @@ -48,7 +48,7 @@ ROW_IS_CONN_CONNECTED,
ROW_IS_VM, ROW_IS_VM,
ROW_IS_VM_RUNNING, ROW_IS_VM_RUNNING,
@ -528,10 +528,10 @@ Index: virt-manager-1.4.3/virtManager/manager.py
def _style_get_prop(widget, propname): def _style_get_prop(widget, propname):
Index: virt-manager-1.4.3/virtManager/keyring.py Index: virt-manager-1.5.0/virtManager/keyring.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/keyring.py --- virt-manager-1.5.0.orig/virtManager/keyring.py
+++ virt-manager-1.4.3/virtManager/keyring.py +++ virt-manager-1.5.0/virtManager/keyring.py
@@ -110,10 +110,10 @@ class vmmKeyring(object): @@ -110,10 +110,10 @@ class vmmKeyring(object):
label = iface.get_cached_property("Label").unpack().strip("'") label = iface.get_cached_property("Label").unpack().strip("'")
dbusattrs = iface.get_cached_property("Attributes").unpack() dbusattrs = iface.get_cached_property("Attributes").unpack()
@ -545,10 +545,10 @@ Index: virt-manager-1.4.3/virtManager/keyring.py
if key not in ["hvuri", "uuid"]: if key not in ["hvuri", "uuid"]:
continue continue
attrs["%s" % key] = "%s" % val attrs["%s" % key] = "%s" % val
Index: virt-manager-1.4.3/virtManager/addstorage.py Index: virt-manager-1.5.0/virtManager/addstorage.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/addstorage.py --- virt-manager-1.5.0.orig/virtManager/addstorage.py
+++ virt-manager-1.4.3/virtManager/addstorage.py +++ virt-manager-1.5.0/virtManager/addstorage.py
@@ -162,7 +162,7 @@ class vmmAddStorage(vmmGObjectUI): @@ -162,7 +162,7 @@ class vmmAddStorage(vmmGObjectUI):
errmsg = _("Errors were encountered changing permissions for the " errmsg = _("Errors were encountered changing permissions for the "
"following directories:") "following directories:")
@ -567,10 +567,10 @@ Index: virt-manager-1.4.3/virtManager/addstorage.py
def reset_state(self): def reset_state(self):
self._update_host_space() self._update_host_space()
Index: virt-manager-1.4.3/virtManager/details.py Index: virt-manager-1.5.0/virtManager/details.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/details.py --- virt-manager-1.5.0.orig/virtManager/details.py
+++ virt-manager-1.4.3/virtManager/details.py +++ virt-manager-1.5.0/virtManager/details.py
@@ -106,7 +106,7 @@ from .graphwidgets import Sparkline @@ -106,7 +106,7 @@ from .graphwidgets import Sparkline
EDIT_FS, EDIT_FS,
@ -640,7 +640,7 @@ Index: virt-manager-1.4.3/virtManager/details.py
val = "-" val = "-"
if dev.supports_property(prop): if dev.supports_property(prop):
val = getattr(dev, prop) or "-" val = getattr(dev, prop) or "-"
@@ -3214,7 +3214,7 @@ class vmmDetails(vmmGObjectUI): @@ -3229,7 +3229,7 @@ class vmmDetails(vmmGObjectUI):
for dev in self.vm.get_panic_devices(): for dev in self.vm.get_panic_devices():
update_hwlist(HW_LIST_TYPE_PANIC, dev) update_hwlist(HW_LIST_TYPE_PANIC, dev)
@ -649,10 +649,10 @@ Index: virt-manager-1.4.3/virtManager/details.py
devs.reverse() devs.reverse()
for i in devs: for i in devs:
_iter = hw_list_model.iter_nth_child(None, i) _iter = hw_list_model.iter_nth_child(None, i)
Index: virt-manager-1.4.3/virtManager/create.py Index: virt-manager-1.5.0/virtManager/create.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/create.py --- virt-manager-1.5.0.orig/virtManager/create.py
+++ virt-manager-1.4.3/virtManager/create.py +++ virt-manager-1.5.0/virtManager/create.py
@@ -55,7 +55,7 @@ DEFAULT_MEM = 1024 @@ -55,7 +55,7 @@ DEFAULT_MEM = 1024
PAGE_INSTALL, PAGE_INSTALL,
PAGE_MEM, PAGE_MEM,
@ -678,7 +678,7 @@ Index: virt-manager-1.4.3/virtManager/create.py
##################### #####################
@@ -951,7 +951,7 @@ class vmmCreate(vmmGObjectUI): @@ -953,7 +953,7 @@ class vmmCreate(vmmGObjectUI):
model.clear() model.clear()
default = -1 default = -1
@ -687,19 +687,19 @@ Index: virt-manager-1.4.3/virtManager/create.py
connobj = c["conn"] connobj = c["conn"]
if not connobj.is_active(): if not connobj.is_active():
continue continue
@@ -2579,7 +2579,7 @@ class vmmCreate(vmmGObjectUI): @@ -2587,7 +2587,7 @@ class vmmCreate(vmmGObjectUI):
'passwd': self._get_config_oscontainer_source_password, 'insecure': self._get_config_oscontainer_isecure,
'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 bootstrap_arg_keys.items():
+ for key, getter in list(bootstrap_arg_keys.items()): + for key, getter in list(bootstrap_arg_keys.items()):
bootstrap_args[key] = getter() bootstrap_args[key] = getter()
parentobj = self._customize_window or self parentobj = self._customize_window or self
Index: virt-manager-1.4.3/virtManager/preferences.py Index: virt-manager-1.5.0/virtManager/preferences.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/preferences.py --- virt-manager-1.5.0.orig/virtManager/preferences.py
+++ virt-manager-1.4.3/virtManager/preferences.py +++ virt-manager-1.5.0/virtManager/preferences.py
@@ -121,7 +121,7 @@ class vmmPreferences(vmmGObjectUI): @@ -121,7 +121,7 @@ class vmmPreferences(vmmGObjectUI):
} }
model.append([-1, _("System default (%s)") % model.append([-1, _("System default (%s)") %
@ -709,10 +709,10 @@ Index: virt-manager-1.4.3/virtManager/preferences.py
model.append([key, val]) model.append([key, val])
combo.set_model(model) combo.set_model(model)
uiutil.init_combo_text_column(combo, 1) uiutil.init_combo_text_column(combo, 1)
Index: virt-manager-1.4.3/virtManager/migrate.py Index: virt-manager-1.5.0/virtManager/migrate.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/migrate.py --- virt-manager-1.5.0.orig/virtManager/migrate.py
+++ virt-manager-1.4.3/virtManager/migrate.py +++ virt-manager-1.5.0/virtManager/migrate.py
@@ -36,7 +36,7 @@ from .domain import vmmDomain @@ -36,7 +36,7 @@ from .domain import vmmDomain
NUM_COLS = 3 NUM_COLS = 3
(COL_LABEL, (COL_LABEL,
@ -722,7 +722,7 @@ Index: virt-manager-1.4.3/virtManager/migrate.py
class vmmMigrateDialog(vmmGObjectUI): class vmmMigrateDialog(vmmGObjectUI):
@@ -310,7 +310,7 @@ class vmmMigrateDialog(vmmGObjectUI): @@ -313,7 +313,7 @@ class vmmMigrateDialog(vmmGObjectUI):
model.clear() model.clear()
rows = [] rows = []
@ -731,10 +731,10 @@ Index: virt-manager-1.4.3/virtManager/migrate.py
rows.append(self._build_dest_row(conn)) rows.append(self._build_dest_row(conn))
if not any([row[COL_CAN_MIGRATE] for row in rows]): if not any([row[COL_CAN_MIGRATE] for row in rows]):
Index: virt-manager-1.4.3/virtManager/connect.py Index: virt-manager-1.5.0/virtManager/connect.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/connect.py --- virt-manager-1.5.0.orig/virtManager/connect.py
+++ virt-manager-1.4.3/virtManager/connect.py +++ virt-manager-1.5.0/virtManager/connect.py
@@ -22,7 +22,7 @@ import glob @@ -22,7 +22,7 @@ import glob
import os import os
import logging import logging
@ -744,12 +744,12 @@ Index: virt-manager-1.4.3/virtManager/connect.py
from gi.repository import Gio from gi.repository import Gio
from gi.repository import GObject from gi.repository import GObject
@@ -36,11 +36,11 @@ HV_XEN, @@ -37,11 +37,11 @@ HV_LXC,
HV_LXC,
HV_QEMU_SESSION, HV_QEMU_SESSION,
HV_BHYVE, HV_BHYVE,
-HV_VZ) = range(6) HV_VZ,
+HV_VZ) = list(range(6)) -HV_CUSTOM) = range(7)
+HV_CUSTOM) = list(range(7))
(CONN_SSH, (CONN_SSH,
CONN_TCP, CONN_TCP,
@ -758,7 +758,7 @@ Index: virt-manager-1.4.3/virtManager/connect.py
def current_user(): def current_user():
@@ -394,7 +394,7 @@ class vmmConnect(vmmGObjectUI): @@ -409,7 +409,7 @@ class vmmConnect(vmmGObjectUI):
addrstr = "" addrstr = ""
if user: if user:
@ -767,7 +767,7 @@ Index: virt-manager-1.4.3/virtManager/connect.py
if host.count(":") > 1: if host.count(":") > 1:
host = "[%s]" % host host = "[%s]" % host
@@ -449,7 +449,7 @@ class vmmConnect(vmmGObjectUI): @@ -467,7 +467,7 @@ class vmmConnect(vmmGObjectUI):
if host.startswith("linux-"): if host.startswith("linux-"):
tmphost = host[6:] tmphost = host[6:]
try: try:
@ -776,10 +776,10 @@ Index: virt-manager-1.4.3/virtManager/connect.py
host = "" host = ""
except ValueError: except ValueError:
pass pass
Index: virt-manager-1.4.3/virtManager/storagelist.py Index: virt-manager-1.5.0/virtManager/storagelist.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/storagelist.py --- virt-manager-1.5.0.orig/virtManager/storagelist.py
+++ virt-manager-1.4.3/virtManager/storagelist.py +++ virt-manager-1.5.0/virtManager/storagelist.py
@@ -36,7 +36,7 @@ from .createvol import vmmCreateVolume @@ -36,7 +36,7 @@ from .createvol import vmmCreateVolume
EDIT_POOL_IDS = ( EDIT_POOL_IDS = (
EDIT_POOL_NAME, EDIT_POOL_NAME,
@ -805,10 +805,10 @@ Index: virt-manager-1.4.3/virtManager/storagelist.py
ICON_RUNNING = "state_running" ICON_RUNNING = "state_running"
ICON_SHUTOFF = "state_shutoff" ICON_SHUTOFF = "state_shutoff"
Index: virt-manager-1.4.3/virtManager/createnet.py Index: virt-manager-1.5.0/virtManager/createnet.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/virtManager/createnet.py --- virt-manager-1.5.0.orig/virtManager/createnet.py
+++ virt-manager-1.4.3/virtManager/createnet.py +++ virt-manager-1.5.0/virtManager/createnet.py
@@ -35,7 +35,7 @@ from .baseclass import vmmGObjectUI @@ -35,7 +35,7 @@ from .baseclass import vmmGObjectUI
(PAGE_NAME, (PAGE_NAME,
PAGE_IPV4, PAGE_IPV4,

View File

@ -1,8 +1,8 @@
Index: virt-manager-1.4.3/tests/clitest.py Index: virt-manager-1.5.0/tests/clitest.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/tests/clitest.py --- virt-manager-1.5.0.orig/tests/clitest.py
+++ virt-manager-1.4.3/tests/clitest.py +++ virt-manager-1.5.0/tests/clitest.py
@@ -218,7 +218,7 @@ class Command(object): @@ -223,7 +223,7 @@ class Command(object):
try: try:
conn = None conn = None
@ -11,21 +11,21 @@ Index: virt-manager-1.4.3/tests/clitest.py
if self.argv[idx] == "--connect": if self.argv[idx] == "--connect":
conn = utils.openconn(self.argv[idx + 1]) conn = utils.openconn(self.argv[idx + 1])
break break
Index: virt-manager-1.4.3/tests/uitests/utils.py Index: virt-manager-1.5.0/tests/uitests/utils.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/tests/uitests/utils.py --- virt-manager-1.5.0.orig/tests/uitests/utils.py
+++ virt-manager-1.4.3/tests/uitests/utils.py +++ virt-manager-1.5.0/tests/uitests/utils.py
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-from __future__ import print_function -from __future__ import print_function
+ +
import logging
import os import os
import re Index: virt-manager-1.5.0/tests/utils.py
Index: virt-manager-1.4.3/tests/utils.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/tests/utils.py --- virt-manager-1.5.0.orig/tests/utils.py
+++ virt-manager-1.4.3/tests/utils.py +++ virt-manager-1.5.0/tests/utils.py
@@ -96,11 +96,11 @@ def openconn(uri): @@ -104,11 +104,11 @@ def openconn(uri):
conn.fetch_all_nodedevs() conn.fetch_all_nodedevs()
_conn_cache[uri] = {} _conn_cache[uri] = {}
@ -39,10 +39,10 @@ Index: virt-manager-1.4.3/tests/utils.py
conn._fetch_cache[key] = value[:] conn._fetch_cache[key] = value[:]
def cb_cache_new_pool(poolobj): def cb_cache_new_pool(poolobj):
Index: virt-manager-1.4.3/tests/test_inject.py Index: virt-manager-1.5.0/tests/test_inject.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/tests/test_inject.py --- virt-manager-1.5.0.orig/tests/test_inject.py
+++ virt-manager-1.4.3/tests/test_inject.py +++ virt-manager-1.5.0/tests/test_inject.py
@@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# Copyright (C) 2013, 2014 Red Hat, Inc. # Copyright (C) 2013, 2014 Red Hat, Inc.
@ -52,7 +52,7 @@ Index: virt-manager-1.4.3/tests/test_inject.py
import atexit import atexit
import os import os
@@ -29,7 +29,7 @@ FEDORA_URL = "http://dl.fedoraproject.or @@ -30,7 +30,7 @@ FEDORA_URL = "http://dl.fedoraproject.or
(WARN_RHEL4, (WARN_RHEL4,
WARN_RHEL5, WARN_RHEL5,
@ -61,7 +61,7 @@ Index: virt-manager-1.4.3/tests/test_inject.py
def prompt(): def prompt():
@@ -185,7 +185,7 @@ def _make_tests(): @@ -186,7 +186,7 @@ def _make_tests():
return lambda s: _test_distro(_d) return lambda s: _test_distro(_d)
idx = 0 idx = 0
@ -70,23 +70,23 @@ Index: virt-manager-1.4.3/tests/test_inject.py
idx += 1 idx += 1
setattr(FetchTests, "testFetch%.3d_%s" % setattr(FetchTests, "testFetch%.3d_%s" %
(idx, dname.replace("-", "_")), _make_fetch_cb(dobj)) (idx, dname.replace("-", "_")), _make_fetch_cb(dobj))
Index: virt-manager-1.4.3/tests/test_urls.py Index: virt-manager-1.5.0/tests/test_urls.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/tests/test_urls.py --- virt-manager-1.5.0.orig/tests/test_urls.py
+++ virt-manager-1.4.3/tests/test_urls.py +++ virt-manager-1.5.0/tests/test_urls.py
@@ -346,7 +346,7 @@ def _make_tests(): @@ -253,7 +253,7 @@ def _make_tests():
d.distroclass = None vals.get("testshortcircuit", "0") == "1")
urls[d.name] = d urls[d.name] = d
- keys = urls.keys() - keys = urls.keys()
+ keys = list(urls.keys()) + keys = list(urls.keys())
keys.sort() keys.sort()
for key in keys: for key in keys:
distroobj = urls[key] distroobj = urls[key]
Index: virt-manager-1.4.3/tests/virtconvtest.py Index: virt-manager-1.5.0/tests/virtconvtest.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/tests/virtconvtest.py --- virt-manager-1.5.0.orig/tests/virtconvtest.py
+++ virt-manager-1.4.3/tests/virtconvtest.py +++ virt-manager-1.5.0/tests/virtconvtest.py
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA. # MA 02110-1301 USA.
@ -96,10 +96,10 @@ Index: virt-manager-1.4.3/tests/virtconvtest.py
import glob import glob
import io import io
Index: virt-manager-1.4.3/tests/nodedev.py Index: virt-manager-1.5.0/tests/nodedev.py
=================================================================== ===================================================================
--- virt-manager-1.4.3.orig/tests/nodedev.py --- virt-manager-1.5.0.orig/tests/nodedev.py
+++ virt-manager-1.4.3/tests/nodedev.py +++ virt-manager-1.5.0/tests/nodedev.py
@@ -69,7 +69,7 @@ class TestNodeDev(unittest.TestCase): @@ -69,7 +69,7 @@ class TestNodeDev(unittest.TestCase):
def _testCompare(self, devname, vals, devxml=None): def _testCompare(self, devname, vals, devxml=None):