- Upstream bug fixes (bsc#1027942)

9a9f9ecd-ignore-comments-in-keymap-conf-files.patch
  9617d126-systray-Use-APPLICATION_STATUS-for-appindicator.patch
  e73abe5a-diskbackend-convert-to-long-the-calculated-size.patch
  6e6f59e7-diskbackend-get-a-proper-size-of-existing-block-device-while-cloning.patch
  23aaf852-network-Set-bridge-name-to-None-instead-of-blank.patch
  d1e1cf64-progress-remove-trailing-white-space.patch
  63fce081-pycodestyle-Use-isinstance-for-type-checking.patch
  08a58d61-pycodestyle-remove-description-of-fixed-errors.patch
  bc3c9a9d-progress-remove-unused-import.patch
  2d276ebe-progress-dont-overwrite-format.patch
  e2ad4b2f-convert-iteritems-to-items.patch
  dff00d4f-remove-deprecated-statvfs-module.patch
  75210ed3-replace-StringIO-with-io.patch
  a2bcd6c4-dont-compare-between-None-and-int.patch
  44de92b7-use-reload-from-imp-module.patch
  69c84bea-import-reduce-from-functools-module.patch
  37ea5207-replace-StandardError-with-Exception.patch
  f41aafc7-Use-enumerate-instead-of-range-and-len.patch
  91c0669c-cli-Fix-OrderedDict-mutated-during-iteration-on-python3.patch
  b8fa0c6b-xmlnsqemu-order-XML-output-like-libvirt-does.patch
  d2648d81-virtconv-dont-implicitly-depend-on-dict-hash-order.patch
  999dbb36-cli-Make-VirtCLIArgument-instantiation-less-crazy.patch
  7f1b4cee-pycodestyle-fix-all-E125-warnings.patch
  d82022bd-manager-drop-python2-only-cmp-usage.patch
  374a3779-urlfetcher-write-test-file-as-binary-content.patch
  f7c8cf9f-devicepanic-dont-return-empty-model-list.patch
  3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch
  73de8285-systray-remove-redundant-variable-assignment.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=375
This commit is contained in:
Charles Arnold 2017-10-30 20:23:56 +00:00 committed by Git OBS Bridge
parent 953fda9f1b
commit ba698f40db
38 changed files with 2245 additions and 76 deletions

View File

@ -0,0 +1,26 @@
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

@ -0,0 +1,23 @@
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

@ -0,0 +1,30 @@
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

@ -0,0 +1,22 @@
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

@ -0,0 +1,28 @@
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

@ -0,0 +1,24 @@
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

@ -0,0 +1,24 @@
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

@ -0,0 +1,316 @@
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

@ -0,0 +1,54 @@
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

@ -0,0 +1,34 @@
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

@ -0,0 +1,19 @@
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

@ -0,0 +1,148 @@
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
Index: virt-manager-1.4.3/tests/clitest.py
===================================================================
--- virt-manager-1.4.3.orig/tests/clitest.py
+++ virt-manager-1.4.3/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
Index: virt-manager-1.4.3/tests/virtconvtest.py
===================================================================
--- virt-manager-1.4.3.orig/tests/virtconvtest.py
+++ virt-manager-1.4.3/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)
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
@@ -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')
Index: virt-manager-1.4.3/virtManager/snapshots.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/snapshots.py
+++ virt-manager-1.4.3/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
Index: virt-manager-1.4.3/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.4.3.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.3/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
@@ -104,6 +104,8 @@ class _URLFetcher(object):
buff = urlobj.read(self._block_size)
if not buff:
break
+ if isinstance(fileobj, io.StringIO) and type(buff) is str:
+ buff = unicode(buff)
fileobj.write(buff)
total += len(buff)
self.meter.update(total)
@@ -169,7 +171,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

@ -0,0 +1,458 @@
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

@ -0,0 +1,19 @@
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

@ -0,0 +1,23 @@
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

@ -0,0 +1,215 @@
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

@ -0,0 +1,30 @@
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

@ -0,0 +1,49 @@
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

@ -0,0 +1,37 @@
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

@ -0,0 +1,18 @@
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

@ -0,0 +1,145 @@
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

@ -0,0 +1,92 @@
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

@ -0,0 +1,69 @@
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

@ -0,0 +1,53 @@
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

@ -0,0 +1,28 @@
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

@ -0,0 +1,37 @@
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

@ -0,0 +1,74 @@
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

@ -0,0 +1,30 @@
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,3 +1,36 @@
-------------------------------------------------------------------
Fri Oct 27 14:19:35 MDT 2017 - carnold@suse.com
- Upstream bug fixes (bsc#1027942)
9a9f9ecd-ignore-comments-in-keymap-conf-files.patch
9617d126-systray-Use-APPLICATION_STATUS-for-appindicator.patch
e73abe5a-diskbackend-convert-to-long-the-calculated-size.patch
6e6f59e7-diskbackend-get-a-proper-size-of-existing-block-device-while-cloning.patch
23aaf852-network-Set-bridge-name-to-None-instead-of-blank.patch
d1e1cf64-progress-remove-trailing-white-space.patch
63fce081-pycodestyle-Use-isinstance-for-type-checking.patch
08a58d61-pycodestyle-remove-description-of-fixed-errors.patch
bc3c9a9d-progress-remove-unused-import.patch
2d276ebe-progress-dont-overwrite-format.patch
e2ad4b2f-convert-iteritems-to-items.patch
dff00d4f-remove-deprecated-statvfs-module.patch
75210ed3-replace-StringIO-with-io.patch
a2bcd6c4-dont-compare-between-None-and-int.patch
44de92b7-use-reload-from-imp-module.patch
69c84bea-import-reduce-from-functools-module.patch
37ea5207-replace-StandardError-with-Exception.patch
f41aafc7-Use-enumerate-instead-of-range-and-len.patch
91c0669c-cli-Fix-OrderedDict-mutated-during-iteration-on-python3.patch
b8fa0c6b-xmlnsqemu-order-XML-output-like-libvirt-does.patch
d2648d81-virtconv-dont-implicitly-depend-on-dict-hash-order.patch
999dbb36-cli-Make-VirtCLIArgument-instantiation-less-crazy.patch
7f1b4cee-pycodestyle-fix-all-E125-warnings.patch
d82022bd-manager-drop-python2-only-cmp-usage.patch
374a3779-urlfetcher-write-test-file-as-binary-content.patch
f7c8cf9f-devicepanic-dont-return-empty-model-list.patch
3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch
73de8285-systray-remove-redundant-variable-assignment.patch
-------------------------------------------------------------------
Wed Oct 11 13:58:55 MDT 2017 - carnold@suse.com

View File

@ -41,6 +41,34 @@ Source3: virt-manager-supportconfig
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
# SUSE Only
Patch70: virtman-desktop.patch
Patch71: virtman-kvm.patch
@ -169,6 +197,34 @@ machine).
%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
# SUSE Only
%patch70 -p1
%patch71 -p1

View File

@ -39,8 +39,8 @@ Index: virt-manager-1.4.3/virtinst/urlfetcher.py
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]) or re.match("SLES*", distribution[1]):
- re.match(".*SUSE SLES*", distribution[1]):
+ re.match(".*SUSE SLES*", distribution[1]) or re.match("SLES*", distribution[1]):
dclass = SLESDistro
if distro_version is None:
distro_version = _parse_sle_distribution(distribution)

View File

@ -1,10 +1,10 @@
Reference: bnc#885380
Allow Xen based VMs to default to using qcow2
Index: virt-manager-1.3.0/virtinst/support.py
Index: virt-manager-1.4.3/virtinst/support.py
===================================================================
--- virt-manager-1.3.0.orig/virtinst/support.py
+++ virt-manager-1.3.0/virtinst/support.py
@@ -258,7 +258,7 @@ SUPPORT_CONN_DISK_SD = _make(version="1.
--- virt-manager-1.4.3.orig/virtinst/support.py
+++ virt-manager-1.4.3/virtinst/support.py
@@ -259,7 +259,7 @@ SUPPORT_CONN_DISK_SD = _make(version="1.
# default to qcow2. It might be fine for xen or qemu older than the versions
# here, but until someone tests things I'm going to be a bit conservative.
SUPPORT_CONN_DEFAULT_QCOW2 = _make(

View File

@ -1,8 +1,6 @@
Enhancement for the following GUI wizard installation options.
Enhancement for the following GUI wizard installation option.
1) If Xen, leave 'Architecture options' expanded so users know PV
is the default
2) Under 'Network selection' default to a bridge that has an actual
IP address if available (not just the first one found).
Index: virt-manager-1.4.2/virtManager/create.py
===================================================================
--- virt-manager-1.4.2.orig/virtManager/create.py
@ -29,46 +27,3 @@ Index: virt-manager-1.4.2/virtManager/create.py
if self._set_conn(activeconn) is False:
return False
Index: virt-manager-1.4.2/virtManager/netlist.py
===================================================================
--- virt-manager-1.4.2.orig/virtManager/netlist.py
+++ virt-manager-1.4.2/virtManager/netlist.py
@@ -170,9 +170,19 @@ class vmmNetworkList(vmmGObjectUI):
return rows, vnet_bridges, default_label
def _find_physical_devices(self, vnet_bridges):
+ def check_for_inet(bname):
+ if bname is not None:
+ from subprocess import Popen, PIPE
+ p = Popen(['/sbin/ip', 'addr', 'show', bname], stdout=PIPE, stderr=PIPE)
+ stdout, stderr = p.communicate()
+ if stdout and 'inet' in stdout:
+ return True
+ return False
+
rows = []
can_default = False
default_label = None
+ default_label_with_inet = None
skip_ifaces = ["lo"]
vnet_taps = []
@@ -232,10 +242,18 @@ class vmmNetworkList(vmmGObjectUI):
if can_default and not default_label:
default_label = label
+ # Default to a bridge that has an actual inet addr
+ if default_label_with_inet is None:
+ if check_for_inet(source_name):
+ default_label_with_inet = label
+
rows.append(self._build_source_row(
nettype, source_name, label, sensitive, True,
key=name))
+ if default_label and default_label_with_inet is not None:
+ default_label = default_label_with_inet
+
return rows, default_label
def _populate_network_model(self, model):

View File

@ -13,14 +13,14 @@ status affects the hypervisor connection.
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Index: virt-manager-1.3.0/virtinst/pollhelpers.py
Index: virt-manager-1.4.3/virtinst/pollhelpers.py
===================================================================
--- virt-manager-1.3.0.orig/virtinst/pollhelpers.py
+++ virt-manager-1.3.0/virtinst/pollhelpers.py
--- virt-manager-1.4.3.orig/virtinst/pollhelpers.py
+++ virt-manager-1.4.3/virtinst/pollhelpers.py
@@ -133,6 +133,19 @@ def fetch_pools(backend, origmap, build_
if backend.check_support(
backend.SUPPORT_CONN_LISTALLSTORAGEPOOLS) and not FORCE_OLD_POLL:
backend.SUPPORT_CONN_LISTALLSTORAGEPOOLS) and not FORCE_OLD_POLL:
+
+ # Refresh pools before poll_helper. For those
+ # 'active' but target path not exist (or other reasons

View File

@ -4,10 +4,10 @@ issue on btrfs.
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Index: virt-manager-1.4.2/virtinst/storage.py
Index: virt-manager-1.4.3/virtinst/storage.py
===================================================================
--- virt-manager-1.4.2.orig/virtinst/storage.py
+++ virt-manager-1.4.2/virtinst/storage.py
--- virt-manager-1.4.3.orig/virtinst/storage.py
+++ virt-manager-1.4.3/virtinst/storage.py
@@ -708,6 +708,12 @@ class StorageVolume(_StorageObject):
return self._pool_xml.get_disk_type()
file_type = property(_get_vol_type)
@ -21,11 +21,11 @@ Index: virt-manager-1.4.2/virtinst/storage.py
##################
# XML properties #
Index: virt-manager-1.4.2/virtinst/support.py
Index: virt-manager-1.4.3/virtinst/support.py
===================================================================
--- virt-manager-1.4.2.orig/virtinst/support.py
+++ virt-manager-1.4.2/virtinst/support.py
@@ -324,6 +324,8 @@ SUPPORT_CONN_RNG_URANDOM = _make(version
--- virt-manager-1.4.3.orig/virtinst/support.py
+++ virt-manager-1.4.3/virtinst/support.py
@@ -325,6 +325,8 @@ SUPPORT_CONN_RNG_URANDOM = _make(version
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")

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
and then run grub2-mkconfig /boot/grub2/grub.cfg.
5) Start the VM and within the VM's terminal type "echo 'c' > /proc/sysrq-trigger"
Index: virt-manager-1.4.0/virtManager/manager.py
Index: virt-manager-1.4.3/virtManager/manager.py
===================================================================
--- virt-manager-1.4.0.orig/virtManager/manager.py
+++ virt-manager-1.4.0/virtManager/manager.py
@@ -839,7 +839,7 @@ class vmmManager(vmmGObjectUI):
--- virt-manager-1.4.3.orig/virtManager/manager.py
+++ virt-manager-1.4.3/virtManager/manager.py
@@ -843,7 +843,7 @@ class vmmManager(vmmGObjectUI):
show_pause = bool(vm and vm.is_unpauseable())
else:
show_pause = bool(vm and vm.is_pauseable())
@ -19,10 +19,10 @@ Index: virt-manager-1.4.0/virtManager/manager.py
if vm and vm.managedsave_supported:
self.change_run_text(vm.has_managed_save())
Index: virt-manager-1.4.0/virtManager/vmmenu.py
Index: virt-manager-1.4.3/virtManager/vmmenu.py
===================================================================
--- virt-manager-1.4.0.orig/virtManager/vmmenu.py
+++ virt-manager-1.4.0/virtManager/vmmenu.py
--- virt-manager-1.4.3.orig/virtManager/vmmenu.py
+++ virt-manager-1.4.3/virtManager/vmmenu.py
@@ -31,6 +31,7 @@ class _VMMenu(Gtk.Menu):
self._parent = src
self._current_vm_cb = current_vm_cb

View File

@ -1,11 +1,11 @@
Enhancement to default to the host os version when creating a VM
and media detection of the install source is turned off.
Index: virt-manager-1.4.2/virtManager/create.py
Index: virt-manager-1.4.3/virtManager/create.py
===================================================================
--- virt-manager-1.4.2.orig/virtManager/create.py
+++ virt-manager-1.4.2/virtManager/create.py
@@ -24,6 +24,9 @@ import os
import cStringIO
--- virt-manager-1.4.3.orig/virtManager/create.py
+++ virt-manager-1.4.3/virtManager/create.py
@@ -24,6 +24,9 @@ import pkgutil
import os
import threading
import time
+import sys

View File

@ -13,5 +13,5 @@ Index: virt-manager-1.4.3/virtManager/connection.py
- self._backend.setKeepAlive(20, 1)
+ self._backend.setKeepAlive(20, 10)
except Exception as e:
if (type(e) is not AttributeError and
if (not isinstance(e, AttributeError) and
not util.is_error_nosupport(e)):