[node-patches] Change in ovirt-node[master]: RFC: Add tuned configuration
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Thu May 23 11:18:03 UTC 2013
Fabian Deutsch has posted comments on this change.
Change subject: RFC: Add tuned configuration
......................................................................
Patch Set 2: (4 inline comments)
Looks quite good. Just a couple of smaller things.
....................................................
File src/ovirt/node/config/tuned.py
Line 29: """
Line 30: keys = ("OVIRT_TUNED_PROFILE",)
Line 31:
Line 32: def update(self, profile):
Line 33: all_profiles = tuned.get_available_profiles()
Does "None" or "Off" needs to be added to all_profiles? Depends if get-available_profiles contains them.
Line 34: if profile not in all_profiles:
Line 35: raise InvalidData("Unknown tuned profile: %s" % profile)
Line 36:
Line 37: def transaction(self):
Line 46: class CallTunedAdm(utils.Transaction.Element):
Line 47: title = "Requesting profile change"
Line 48:
Line 49: def commit(self):
Line 50: tuned.set_active_profile(profile)
Does some configuration file needs to be persisted?
IIUIC tuned-adm is normally persisting the changes so altering some file.
Line 51:
Line 52: tx = utils.Transaction("Applying tuned configuration")
Line 53: if profile:
Line 54: # Only add the element if there is a profile to be set
....................................................
File src/ovirt/node/setup/performance_page.py
Line 54: ui.Label("label", "Choose the tuned profile you would " +
Line 55: "like to apply to this system."),
Line 56: ui.Divider("divider[0]"),
Line 57: ui.KeywordLabel("tuned.profile", "Current Active Profile: "),
Line 58: ui.Table("tuned.profile", "", "Available tuned Profiles",
the tuned.profile identifier is used twice, you can use tuned.profiles for the table.
Line 59: profiles),
Line 60: ]
Line 61: page = ui.Page("page", ws)
Line 62: self.widgets.add(page)
....................................................
File src/ovirt/node/utils/tuned.py
Line 51: else:
Line 52: return profile.replace("\n", "").split(" ")[3]
Line 53:
Line 54:
Line 55: def set_active_profile(profile):
Please use exceptions instead of return False - that way we can handle the different failure cases much better.
Line 56: """Sets the active tuned profile on the system.
Line 57:
Line 58: Returns:
Line 59: A boolean based on the return of tuned-adm
--
To view, visit http://gerrit.ovirt.org/14962
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic1ed6db48bfeeed962f1bff656d71243281e1597
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Michael Burns <mburns at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Michael Burns <mburns at redhat.com>
More information about the node-patches
mailing list