1
0
Fork 0
Commit graph

13 commits

Author SHA1 Message Date
Jaroslav Škarvada
6def0e44cf
plugin_net: added support for hotplug and rename
This will not completely resolve RHEL-60906, because there will be
always race condition if the rename event happens before the instance
is fully initialized, but it should significantly improve the situation.

Drawback is that it can report in the logs device names that shouldn't
be matched by the plugin_net instance, i.e. it matches devices according
to their original names but accesses them with their new names. This
can be confusing. Also in the runtime API (e.g. for removal of the
device from the instance), the original device names have to be used.
For insertion of the device to the instance, new names have to be used.
This can be even more confusing.

Unfortunately, there probably isn't better alternative now, because
for correct operation we would have to handle rename by removal and
addition events. This would require rollback and retune steps which would
lead to very negative performance consequences. Also we would have to
cope with partially tuned devices if the rename event happens during
profile application. It's doable, but it would require big
architectural changes.

The PR also extends internal API, now the plugin instances receive
'instance' as a method parameter.

Also fixed some existing CodeQL warnings.

Resolves: RHEL-60906

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2025-01-16 18:40:41 +01:00
Adriaan Schmidt
b10bafce48 instance: add priority as a property
Currently instance priorities are only used at startup to sort the
instance classes. To enable dynamic creation of instances, we need
to store the priorities, so new instances can be sorted accordingly.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
2024-03-15 12:13:43 +01:00
Jaroslav Škarvada
2f911b7e02
hotplug: do not report ENOENT errors on device remove
It requires slight internal plugin API change, thus 3rd party plugins
needs updating.

Namely the 'command_set' methods for devices were extended by the
'remove' boolean parameter which is set to 'True' on the hotplug remove
event. Then the method should silent the ENOENT errors where
appropriate, because the device interface may be removed (by
kernel/udev) before the method finishes.

Resolves: RHEL-11342

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2023-12-07 13:00:34 +01:00
Jaroslav Škarvada
8d55d8d256
Merge pull request #417 from CZerta/rhbz1891036_striping_quotes_when_unpacking_cpu_list
Striping quotes when unpacking cpu list
2022-08-09 16:11:40 +02:00
Jan Zerdik
910ff510e9
Default delimiters causing errors in some specific situations, inline comments
Resolves: rhbz#2060138
Resolves: rhbz#2038886

Signed-off-by: Jan Zerdik <jzerdik@redhat.com>
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2022-03-16 12:49:03 +01:00
Jan Zerdik
2ec3546cd1 Striping quotes when unpacking cpu list
Resolves: rhbz#1891036

Signed-off-by: Jan Zerdik <jzerdik@redhat.com>
2022-03-08 14:12:43 +01:00
Jan Zerdik
063277a05b Removing dependency on python-configobj.
Resolves: rhbz#1936386

Signed-off-by: Jan Zerdik <jzerdik@redhat.com>
2021-08-18 10:28:27 +02:00
Jaroslav Škarvada
bd6697f8f4
profiles: fix loading multiple profiles if there are repeating profiles
The original idea behind this patch is credited to
Jiří Mencák <jmencak@redhat.com>.

Resolves: rhbz#1825882

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2021-06-09 11:00:18 +02:00
Jaroslav Škarvada
89e670c80a
Fixed building on RHEL-7/CentOS 7
Also fixed building with python-2.7.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-06-19 11:15:12 +02:00
Miro Hrončok
2399aa3b2d Remove usage of unittest2, use unittest from the standard library
Fixes https://github.com/redhat-performance/tuned/issues/241

Fedora is removing the unittest2 package: https://bugzilla.redhat.com/show_bug.cgi?id=1794222

tuned is not targeting Python 2.6: https://github.com/redhat-performance/tuned/issues/241#issuecomment-588320175

One thing not present in Python 2.7 is assertItemsEqual() -- renamed to assertCountEqual().

Related, mock was also listed as a requirement in the spec file,
but all the imports are from unittest.mock, hence removed.
2020-02-25 20:04:51 +01:00
Tomas Korbar
925e7d1764 Stop using Travis
We replaced travis with packit.
Also remove Dockerfile because we do not need it anymore.

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-12-02 12:20:33 +01:00
Tomas Korbar
140d982354 Replace python flexmock module with builtin mock
Also replace dependency in specfile and alter dockerfile

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-11-28 07:54:15 +01:00
Jaroslav Škarvada
cff78c537c tests: moved tests under directory 'tests'
Also renamed directories to be more consistent.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-11-18 16:34:11 +01:00