Cédric Bosdonnat
0c6bcb0917
python3: fix bytes/string mess in serial console
...
Add a few encode() and decode() to convert between libvirt stream
functions expecting bytes arrays and Vte callbacks providing strings.
2017-12-20 16:09:35 -05:00
Cole Robinson
b5b2433ad5
baseclass: Fix UI file loading on py3
...
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
2017-12-20 16:04:36 -05:00
Cole Robinson
c174b5509f
connection: Another py3 exception variable fix
2017-12-20 14:16:13 -05:00
Cédric Bosdonnat
60968fa259
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.
2017-12-20 14:13:27 -05:00
Anthony
ca3c3a5869
ui: create: fix bootstrap typo
2017-12-20 14:02:55 -05:00
Scott Garfinkle
249ff1ed36
virtio-scsi by default on power
...
Power architecture guests should default to virtio-scsi rather than spapr-scsi
Signed-off-by: Scott Garfinkle <scottgar@linux.vnet.ibm.com>
2017-12-20 13:30:45 -05:00
Lin Ma
08b2b808bd
addhardware: Remove IDE from list while adding controllers
...
Libvirt only supports built-in IDE controller so far, There is no
any case that needs us manually add an IDE controller, So remove
it from the controller list.
Signed-off-by: Lin Ma <lma@suse.com>
2017-12-20 13:15:46 -05:00
Pavel Hrdina
f3f9dd6b73
virtinst.support: fix copy&paste error
...
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-12-18 19:18:31 +01:00
Cole Robinson
4224b0926e
tests: Remove storage UUID hackery
...
In several cases we were trying to define two different pools with
the same UUID. Libvirt used to accept that but as of a recent
commit it started rejecting it for the test driver.
The UUID stuff isn't adding anything so drop it from all the test
cases and data.
2017-12-14 12:45:01 -05:00
Cole Robinson
fe59c33772
virtinst: storage: Don't generate UUID by default
...
Just let libvirt do it for us, it doesn't really add anything
2017-12-14 12:45:01 -05:00
Cole Robinson
c286593b56
virtinst: network: Don't generate UUID by default
...
Just let libvirt do it for us, it doesn't really add anything
2017-12-14 12:45:01 -05:00
Cole Robinson
8b4befae60
virtinst: Drop UUID validation
...
It's redundant as libvirt will give us these checks already, and we
aren't even testing it
2017-12-14 12:45:01 -05:00
Cole Robinson
5ac933e98a
guest: Set default rendernode= if spice gl requested
...
Since this is required to work out of the box with qemu:///system
2017-11-25 17:29:02 -05:00
Cole Robinson
bd1c6e55ad
gfxdetails: Select rendernode by default when user requests gl=on
...
Since it's required for qemu:///system to work
2017-11-25 17:28:57 -05:00
Cole Robinson
29a5e7a230
details: Remove q35 support warning (bz #1443021 )
...
It's been around long enough and in use long enough that this
isn't required anymore
2017-11-25 15:15:08 -05:00
Pavel Hrdina
b9bc3b605a
delete: undefine only persistent domain
...
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1517119
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-11-24 17:39:58 +01:00
Cole Robinson
9b58ea4e51
tests: test_urls: Update URL list
2017-11-22 17:32:20 -05:00
Andrew Wong
f836e47b70
virtinst: Fix _URLFetcher for reading files
...
_grabber() is used for both binary and text files.
2017-11-22 17:26:31 -05:00
Lin Ma
2eb455c97f
addhardware: Correctly calculate virtio-scsi controller index
...
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>
2017-11-22 16:50:33 -05:00
Cole Robinson
7fc7e94f21
addhardware: Fix virtio-scsi controller target calculation
...
More details here: https://www.redhat.com/archives/virt-tools-list/2017-November/msg00014.html
Reported-by: Lin Ma <lma@suse.com>
2017-11-22 16:50:33 -05:00
Lin Ma
bbd6a8fd98
testdriver: add missing addrStr for scsi disk
...
Signed-off-by: Lin Ma <lma@suse.com>
2017-11-21 17:39:00 -05:00
Lin Ma
2e85ad5675
details: Show controller description + index
...
This patch and future patches can help users to better recognize which
disks connect to which scsi controllers.
Signed-off-by: Lin Ma <lma@suse.com>
2017-11-21 17:18:56 -05:00
Radostin Stoyanov
4e93ad09cb
news: Fix typo
2017-10-27 10:10:08 +02:00
Radostin Stoyanov
73de828524
systray: Remove redundant variable assignment
...
The explicit assignment of "name" is unnecessary.
2017-10-27 10:10:08 +02:00
Cole Robinson
3be78d1f3f
addhardware: Don't allow panic option where it isn't supported
...
Like aarch64, basically any arch that doesn't have an explicit panic
model
2017-10-27 09:47:38 +02:00
Cole Robinson
f7c8cf9f66
devicepanic: Don't return empty model list (bz #1505532 )
...
Callers don't expect it, and it breaks opening the addhardware dialog
for aarch64 VMs
https://bugzilla.redhat.com/show_bug.cgi?id=1505532
2017-10-27 09:42:54 +02:00
Cole Robinson
6fb5baf8a8
tests: xmlparse: explain AddRemoveDevice cases
2017-10-26 12:02:03 +02:00
Lin Ma
9e0e0dfb08
testdriver: Add vhostuser example
...
Signed-off-by: Lin Ma <lma@suse.com>
2017-10-26 11:52:26 +02:00
David Rabel
9cbf7efb16
Fix typo in virt-convert man page
...
'VMX of OVF' -> 'VMX or OVF'
2017-10-26 10:34:33 +02:00
Chen Hanxiao
4897615a1e
pylint: Replace deprecated assertEquals with assertEqual
...
pylint complain:
Using deprecated method assertEquals() (deprecated-method)
https://docs.python.org/3.3/library/unittest.html#deprecated-aliases
Method Name Deprecated alias Deprecated alias
assertEqual() failUnlessEqual assertEquals
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-10-22 19:24:29 +08:00
Cole Robinson
10246e0caa
tests: uitests: wire up --debug option
2017-10-21 19:41:33 -04:00
Cole Robinson
374a3779c4
urlfetcher: Write test file as binary content
...
Triggers an test_ui error otherwise:
TypeError: write() argument must be str, not bytes
2017-10-21 19:41:33 -04:00
Cole Robinson
d82022bd2c
manager: Drop python2 only cmp() usage
...
Manually implement it
2017-10-21 19:41:33 -04:00
Cole Robinson
be7db97ecf
uitests: launch UI with same python executable
...
As the tests were launched with
2017-10-21 19:41:33 -04:00
Chen Hanxiao
7f1b4cee82
pycodestyle: fix all E125 warnings
...
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>
2017-10-21 23:26:16 +08:00
Cole Robinson
999dbb3665
cli: Make _VirtCLIArgument instantiation less crazy
...
Motivation is that the other way had changed behavior with python3
which breaks things
2017-10-20 17:07:19 -04:00
Cole Robinson
d2648d81cc
virtconv: Don't implicitly depend on dict hash order
2017-10-20 16:13:04 -04:00
Cole Robinson
b8fa0c6b67
xmlnsqemu: Order XML output like libvirt does
...
args before env
2017-10-20 16:13:04 -04:00
Cole Robinson
91c0669cf6
cli: Fix OrderedDict mutated during iteration on python3
2017-10-20 16:13:04 -04:00
Cole Robinson
e4aed23427
tests: Convert file()->open() usage
...
One snuck in recently
2017-10-20 16:13:04 -04:00
Radostin Stoyanov
f41aafc721
Use enumerate instead of range and len
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
37ea520773
Replace 'StandardError' with 'Exception'
...
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
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
69c84bea47
Import reduce() from functools module
...
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
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
44de92b772
Use reload() from imp module
...
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
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
a2bcd6c43a
Do not compare between None and int
...
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'
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
75210ed37c
Replace StringIO with io.(StringIO or BytesIO)
...
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
2017-10-20 13:18:31 -04:00
Radostin Stoyanov
dff00d4fc0
Remove deprecated statvfs module
...
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
2017-10-20 11:49:14 -04:00
Radostin Stoyanov
e2ad4b2fde
Convert iteritems() to items()
...
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
2017-10-20 11:49:14 -04:00
Radostin Stoyanov
2d276ebed8
progress: Don't overwrite "format"
...
Do not overwrite built-in format. [1]
https://docs.python.org/2/library/functions.html#format
2017-10-20 11:49:14 -04:00
Radostin Stoyanov
bc3c9a9d7b
progress: Remove unused import
2017-10-20 11:49:14 -04:00