summaryrefslogtreecommitdiffstats
path: root/sys-utils/chcpu.c
Commit message (Collapse)AuthorAgeFilesLines
* sys-utils/disk-utils/lib: fix printf format types [cppcheck]Boris Egorov2015-06-251-19/+19
| | | | | | Fix 'invalidPrintfArgType' cppcheck warnings Signed-off-by: Boris Egorov <egorov@linux.com>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-0/+3
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: use version printing macro everywhereSami Kerola2014-10-011-2/+1Star
| | | | | | | Only mount, umount, and blkid remains not using the macro because they are print also library references. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* chcpu: cleanup stdout/stderr usageKarel Zak2014-03-051-10/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chcpu: cleanup return codesKarel Zak2014-03-051-22/+60
| | | | | | | | The code currently always return EXIT_SUCCESS, that's strange. It seems better to return 0 on success, 1 on complete failure and 64 on partial success. Signed-off-by: Karel Zak <kzak@redhat.com>
* chcpu: clean up error messagesKarel Zak2013-05-141-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/path: rename functions to be more explicitKarel Zak2012-11-231-11/+11
| | | | | | ... and to have names compatible with lib/sysfs.c Signed-off-by: Karel Zak <kzak@redhat.com>
* chcpu: use err_exclusive_options()Karel Zak2012-07-261-15/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: fix typos found by misspellingsBernhard Voelker2012-07-091-2/+2
| | | | | | | | | | | | | | | | | | The tool misspellings (https://github.com/lyda/misspell-check) detected several typos. Command used: $ git ls-files | grep -v ^po/ | misspellings -f - * Documentation/releases/v2.18-ReleaseNotes: Fix typo in news entry. * NEWS: Likewise. * config/texinfo.tex: Fix typo in comments. * libmount/src/context.c: Fix typo in comment. * libmount/src/fs.c: Likewise. * login-utils/login.c: Likewise. * login-utils.su.1: Fix typo in man page. * sys-utils/chcpu.c: Fix typo in error message. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* chcpu: use exclusive_option()Sami Kerola2012-06-171-4/+18
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sys-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: corrections to FSF license files, and postal addressSami Kerola2012-02-241-3/+3
| | | | | | | | | | | | | | The COPYING and Documentation/licenses/COPYING* files are being replaced by files from GNU web site. http://www.gnu.org/licenses/gpl-2.0.txt http://www.gnu.org/licenses/lgpl-2.1.txt Postal addresses to FSF in other files are updated to match with the address in license files. Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* chcpu: use appropriate variable type [cppcheck]Sami Kerola2012-02-081-2/+2
| | | | | | [sys-utils/chcpu.c:251]: (style) Checking if unsigned variable 'maxcpus' is less than zero. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* chcpu: check get_max_number_of_cpus() result properlyKarel Zak2012-02-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: use %m in format string instead of %s and strerror(errno)Petr Uzel2011-09-271-8/+4Star
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* chcpu: provide better user feedbackHeiko Carstens2011-09-271-11/+40
| | | | | | | | | | Instead of printing error messages like "I/O resource busy" which are supplied by strerror, give better feedback if the reason of failure is known. E.g. taking the last cpu offline cannot succeed, therefore print a message that gives this "hint". Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* chcpu: convert to use lib/path.cHeiko Carstens2011-09-271-57/+16Star
| | | | | | | Use the common path access functions. In order to simplify chcpu also implement and use path_writestr() which writes a string to the path specified. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* chcpu,cpuset: reduce code duplication for cpu list parsingHeiko Carstens2011-09-101-12/+16
| | | | | | | Reduce code duplication and print better error message if an unsupported cpu number was passed. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* chcpu: new toolHeiko Carstens2011-08-221-0/+337
chcpu can modify the logical state of CPUs. It can enable and disable CPUs, scan for new CPUs, change the CPU dispatching mode of the underlying hypervisor and request (configure) or give logical CPUs back (deconfigure) to the the underlying hypervisor. This is quite useful if you work a lot with virtual servers, since doing all the configuration stuff directly via sysfs becomes a pain. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>