Commit Graph

5408 Commits

Author SHA1 Message Date
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
Radostin Stoyanov
08a58d6145 pycodestyle: Remove description of fixed errors 2017-10-20 11:49:14 -04:00
Radostin Stoyanov
63fce081ed pycodestyle: Use isinstance() for type checking
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
2017-10-20 11:49:13 -04:00
Radostin Stoyanov
d1e1cf64a7 progress: Remove trailing white space 2017-10-20 11:49:12 -04:00
Cole Robinson
2fe444323b engine: Don't attempt --test-first-run if --connect passed
Which we do for uitests, we don't want it trying to connect to
qemu:///system while uitests are running
2017-10-20 11:47:15 -04:00
Lin Ma
23aaf8527d network: Set bridge name to None instead of blank
Trigger libvirt error if user leaves 'net-bridge-name' GtkEntry
blank when specifying shared device name.

Signed-off-by: Lin Ma <lma@suse.com>
2017-10-19 18:09:19 -04:00
Pavel Hrdina
6e6f59e7ab diskbackend: get a proper size of existing block device while cloning
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>
2017-10-19 09:12:05 +02:00
Pavel Hrdina
e73abe5a3a diskbackend: convert to long the calculated size
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>
2017-10-19 09:06:44 +02:00
Cole Robinson
9617d1267d systray: Use APPLICATION_STATUS for appindicator
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
2017-10-18 19:14:17 -04:00