Commit Graph

35 Commits

Author SHA1 Message Date
Cole Robinson
2f89ecf4a9 Remove Author lines from file headers
Similar to what was done in libvirt. See these commits:

600462834f
c99e954973
2019-01-08 11:45:35 -05:00
Cole Robinson
c23a0d4c96 nodedev: add is_linux_root_hub helper
Move the check out of connection.py, and simplify the addhardware
code
2018-10-13 12:18:50 -04:00
Daniel P. Berrangé
48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson
7fb1ddbc18 virtinst: s/_XML_ROOT_NAME/XML_NAME/g
No reason for it to be privatized, could be useful in some cases
2018-03-21 11:17:36 -04:00
Cole Robinson
b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson
3909c10441 virtinst: Move all devices to virtinst/devices/ 2018-03-21 07:29:40 -04:00
Cole Robinson
1c911ce567 virtinst: Give device classes consistent DeviceX naming
Previous state was inconsistenty and needlessly wordy. Fix up
a few other class namings that have redundant Virtual in the name
2018-03-21 07:29:40 -04:00
Cole Robinson
d108bbe143 Convert docstrings to standard reStructuredText param format 2018-02-14 11:08:09 -05:00
Cole Robinson
8917305a6e Don't use count() for substring checking
Use the idiomatic 'X in Y'
2018-02-14 11:08:09 -05:00
Radostin Stoyanov
b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Chen Hanxiao
a72d368c4e nodedev: remove useless exception instance
Commit f341352cda
removed redundant error string,
so the instance 'e' in exception is useless.
Just delete it.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-03-30 22:43:44 +08:00
Cole Robinson
f341352cda nodedev: Remove redundant error string (bz #1370418) 2017-03-29 14:09:35 -04:00
Lin Ma
262376d16f nodedev: Parse PCI capability_type for SR-IOV device
This will be used in the following patch to recognize SR-IOV capable
device.

Signed-off-by: Lin Ma <lma@suse.com>
2017-03-27 17:15:17 -04:00
Marc-André Lureau
35e6003ba5 nodedev: add DRMDevice
drm capability has been proposed for libvirt 3.1, it provide Direct
Rendering Manager (DRM) devices.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-02-23 18:30:00 -05:00
Marc-André Lureau
a861629f0c nodedev: add DevNode children and helper
<devnode> have been proposed for libvirt 3.1, it provides device /dev/
path when available.

The get_devnode() helper will return the by-path/ path preferably, as
they should be stable.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-02-23 16:30:44 -05:00
Cole Robinson
070664b9e7 tests: Enable property checking for all objects
And loosen restrictions a bit so any read/write will trigger the
tracking.
2015-04-22 16:26:03 -04:00
Cole Robinson
e125aa69d8 nodedev: Handle busted 'system' XML
Libvirt can generated invalid XML for the system nodedev device:

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

This hits at least two people, so catch this specific case, but the
real fix is libvirt not outputing busted XML.
2015-03-26 18:04:23 -04:00
Cole Robinson
35c86a775a nodedev: Simplify parameter comparison 2014-09-20 14:22:03 -04:00
Cole Robinson
a3c6637989 nodedev: Share comparison logic for cli string lookup 2014-09-20 12:58:51 -04:00
Cole Robinson
dd67c48233 connection: Handle nodedev polling too
And cleanup up a bunch of nodedev functions as a result
2014-09-20 12:04:49 -04:00
Cole Robinson
052220cfc8 virtinst: Add DomainCapabilities parser 2014-09-17 18:29:24 -04:00
Lin Ma
2f62ba964c Add comparison function for NodeDevice
PCIDevice and USBDevice include respective comparison logic.

Signed-off-by: Lin Ma <lma@suse.com>
2014-09-16 11:41:13 -04:00
Cole Robinson
eb7612356e virtinst: Switch to relative imports, fix cyclic import warnings 2014-09-12 16:28:38 -04:00
Lubomir Rintel
cf79f06559 nodedev: Be more descriptive about USB device identification
libvirt often passes devices with vendor and product information missing or
malformed, making the USB sharing dialog ugly or useless to the point it's
impossible to identify the device.

This aims to fix pretty-printing of weird textural identification and fall
back to numeric product and device id (in case textual represetations are
not present in the descriptor and device is too new to be in device
database).
2014-09-11 15:37:10 -04:00
Giuseppe Scrivano
e980d9c737 virtinst: display the domain for PCI devices
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1085499

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-04-15 18:53:26 +02:00
Cole Robinson
8562c3258e More pylint fixes 2014-03-22 11:21:19 -04:00
Cole Robinson
52bb0f6067 nodedev: Include PCI vendor in pretty name
Pretty important if trying to distinguish between devices
2014-01-12 14:52:33 -05:00
Cole Robinson
cad64c0dc1 nodedev: Remove subdev for pretty_name, it's pointless 2014-01-12 14:52:15 -05:00
Giuseppe Scrivano
2a040ccd17 mass update: remove double spaces from comments
Updated by this script:

find -name '*.py' -exec sed -i "s|^\(#.*[^.?\!]\)  \(.*[^#]\)$|\1 \2|g" \{\} \;

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:31 +01:00
Giuseppe Scrivano
0df75c7603 headers: update "Red Hat, Inc." copyright for the year 2013
Ensure that any file touched by a @redhat.com author in 2013 has an
updated copyright header.

The files were updated using the build-aux/update-copyright gnulib
script and manually added where the copyright line wasn't present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:26 +01:00
Cole Robinson
6673123185 nodedev: Parse PCI iommuGroup 2013-10-10 09:41:49 -04:00
Cole Robinson
56b9f6187b Streamline support checks
Just use one function check_support
2013-10-06 10:08:04 -04:00
Cole Robinson
fd00ad74e2 devicehostdev: Drop device creation helper
Goes against other device paradigms, and is cleaner when we unwind it.
2013-09-27 18:28:28 -04:00
Cole Robinson
b690557a53 Convert NodeDevice to XMLBuilder 2013-09-23 08:25:20 -04:00
Cole Robinson
952708f509 virtinst: Rename most files to be more sensible
- Lower case everything
- Virtual... -> device...
- A few other similar bits
2013-08-09 08:54:39 -04:00