Commit Graph

3671 Commits

Author SHA1 Message Date
Sami Kerola 99e89eded2 ipcrm: add --verbose option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 15:07:52 +02:00
Sami Kerola b332ef44cf ipcmk: allow high speed ipc creation
This commit will allow user to create quickly plenty of ipc
resources. Earlier the line bellow gave no satisfaction.

for i in $(seq 0 42); do ipcmk -Q; done

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 15:07:52 +02:00
Sami Kerola 3d0fc72d65 ipcrm: add --all option
An --all option will remove all ipc entries. The option takes
optional resource argument, which limits the removal to be
applied only the given resource entries.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 15:07:35 +02:00
Sami Kerola 5ccc85be82 docs: add long options to ipcs.1 man page
Includes few style fixes from Documentation/howto-man-page.txt
and align information by what is being said by The Open Group.

http://pubs.opengroup.org/onlinepubs/009604599/utilities/ipcs.html

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 9a9ff6bd59 docs: add long options to ipcrm.1 man page
Includes few style fixes from Documentation/howto-man-page.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola cbeb426144 docs: add long options to ipcmk.1 man page
Includes few style fixes from Documentation/howto-man-page.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola e0771cf881 docs: add --version to setarch.8
Includes few style fixes from Documentation/howto-man-page.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 1222d81809 docs: mention long options in ctrlaltdel.8
Includes other manual page maintenance fixes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 028f7ed83f ctrlaltdel: add version & help options
Including other necessary changes to usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 8d3abdc0ae docs: mention long options in pivot_root.8
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 922eafb28a pivot_root: add version & help option
Including other necessary changes to usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 1e13900a3b ipcs: comment & white space clean up
Add to multiline comments to have left side stars, convert spaces
to tabs and indent preprocessor directives

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 3ab18da8a7 ipcs: include-what-you-use header check
Two includes added & a sort to alphabetical order.

ipcs.c should add these lines:
 #include <features.h>                   // for __GLIBC__
 #include <stddef.h>                     // for size_t

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 09f53dab0c ipcs: add long options
Includes necessary usage() changes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 79092062a4 ipcrm: include-what-you-use header check
Three removes & a sort to alphabetical order.

ipcrm.c should remove these lines:
- #include <ctype.h>  // lines 29-29
- #include <sys/types.h>  // lines 18-18
- #include <unistd.h>  // lines 27-27

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Sami Kerola 8b69b6d6de ipcrm: refactor new and old main to share code
The code is now much more tidy, and as a bonus old main has
shares error printing with the `new' code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:14 +02:00
Sami Kerola 6054d3a774 ipcrm: exit if unknown error occurs
Previously for instance lack of memory space caused unknown
reason to be printed, and ipcrm tried to continue.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 13:12:33 +02:00
Sami Kerola 1b3b3f9fb9 ipcrm: add long options
With long options usage function had to be changed. The change
also takes libc error printing facilities to use, primarily to
get rid of execname & progname variables.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-12 21:27:07 +02:00
Sami Kerola c20b68231c ipcmk: include-what-you-use header check
Three removes & a sort to alphabetical order.

ipcmk.c should remove these lines:
- #include <string.h>  // lines 24-24
- #include <sys/types.h>  // lines 30-30
- #include <unistd.h>  // lines 29-29

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-12 21:27:07 +02:00
Sami Kerola 0eeec4152a ipcmk: remove camel casing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-12 21:27:07 +02:00
Sami Kerola c821a1256b ipcmk: validate numeric option arguments
Use strtoul_or_err() instead of atoi().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-12 21:27:07 +02:00
Sami Kerola f5b0684e34 ipcmk: remove useless code
Checking same return value twice does not make command any
better. Secondly the program_invocation_short_name is known to
work, so global progname variable does not add anything extra.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-12 21:27:06 +02:00
Sami Kerola 003f497604 ipcmk: add long options & fix usage()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-12 21:26:56 +02:00
Sami Kerola b446402b79 setarch: add version printing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-10 21:33:47 +02:00
Sami Kerola cf1377a431 setarch: use program_invocation_short_name
Trust that the c.h is setting program name correctly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-10 19:37:37 +02:00
Sami Kerola 745627993b setarch: move options struct to function scope
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-10 19:37:19 +02:00
Karel Zak 4e9b3bfda2 lib,cpuset: fix compiler warning [-Wuninitialized]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-10 00:02:00 +02:00
Heiko Carstens 59fb133a02 chcpu,cpuset: reduce code duplication for cpu list parsing
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>
2011-09-10 00:00:35 +02:00
Heiko Carstens f27ce0711c lib,cpuset: enforce stricter parsing of cpu lists
The current cpulist_parse() function ignores extra non-parsable characters at
the end of the to be parsed cpu list string.  E.g. it would accept something
like "0bla" and just set bit 0 in the cpu set.  Since such a string is invalid
implement stricter parsing that makes sure that everything of the string has
been succesfully parsed.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-10 00:00:33 +02:00
Heiko Carstens 72232a267a lib,cpuset: fix stride handling in cpulist_parse()
If cpulist_parse() gets passed a cpu list with a stride value of 0 it will be
stuck in an endless loop.  E.g. the following cpu list will cause an endless
loop: "0-2:0".  Fix this by causing a parse error if the stride value is 0.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-10 00:00:24 +02:00
Heiko Carstens 289127f52d lib,cpuset: fix odd placed braces in cpulist_parse()
The opening and closing braces for two following if statements within
cpulist_parse() are placed in an odd manner.
Just fix this to prevent broken code in the future.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-10 00:00:15 +02:00
Heiko Carstens 68845fed01 lib,cpuset: fix comments for cpu mask/list functions
The comments for cpumask_parse() and cpulist_parse() each describe
the wrong function. Just exchange the comments.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-10 00:00:14 +02:00
Frederik \"Freso\" S. Olesen cbdf0a8165 mount: remove superfluous "an" under ext4 mount options in mount.8
Signed-off-by: Frederik "Freso" S. Olesen <freso@freso.dk>
2011-09-09 23:56:58 +02:00
Heiko Carstens 10829cd73c lscpu: add Hypervisor to output
Some vendors have several hypervisors. Therefore it makes sense to not only
print out the hypervisor vendor but also the name of the hypervisor.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:54:01 +02:00
Heiko Carstens 603e7f10f1 lscpu: add s390 test case
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-09 23:50:55 +02:00
Karel Zak 23e9e95ac3 lscpu: add --online option
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:50:41 +02:00
Heiko Carstens 0ad29ff6b0 lscpu: add --all option
The parsable output includes only lines of online CPUs. To also include
lines for all offline CPUs the "--all" option can be specified.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-09 23:50:01 +02:00
Heiko Carstens a7e5300c97 lscpu: add online state to output
lscpu only prints lines for online CPUs. At least for the human readable
list the offline CPUs are of interest as well. In order to distinguish
between online and offline CPUs introduce the "Online" column.
By default the human readable output now displays online and offline CPUs.
The parsable output is not changed. It will print only lines for online
CPUs as it used to do.

[kzak@redhat.com: - minor changes]

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:49:22 +02:00
Heiko Carstens d231eea114 lscpu: add configured state to output
CPUs may be in a configured or deconfigured state depending if the CPU resource
may be used by the guest.  If a CPU is in configured state the guest may use it
(i.e. set it online). It it is in deconfigured state it cannot use it before
changing its state to configured.  Display this CPU attribute as well.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-09 23:41:25 +02:00
Karel Zak ba45d8c1ea lscpu: add human readable extended cpu table output
Based on patch from Heiko Carstens <heiko.carstens@de.ibm.com>:

lscpu currently only supports a parsable output which contains a row for
each cpu and its attributes. This output contains only comas as separators
and is hard to read for humans.

Therefore add a new option "-e | --extended" which outputs the rows in a
much more readable (and non-parsable) form. Just like for the -p option a
list of columns can be specified that shall be included in the output.

By default this option will print all columns that contain data.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:41:01 +02:00
Karel Zak e3b3a2f3f8 lscpu: use buffer for data and headers
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:40:28 +02:00
Karel Zak e9d659ea85 lscpu: use function to search in cpu masks arrays
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:27:40 +02:00
Karel Zak 8005924a89 lscpu: cleanup output modes
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 07:25:21 +02:00
Heiko Carstens 44de912cdf lscpu: add --version option
Add a --version option like most other tools have it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 06:34:43 +02:00
Heiko Carstens dcdead4271 lscpu: allow read_cache() to be called for offline cpus
First check path before accessing files to be sure they actually exist. This is
necessary when also informations for offline CPUs will be printed.  Since we do
not necessarily know if "cpu is offline" means the same as "path does not
exist" just check for it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-09 06:30:06 +02:00
Heiko Carstens f6512068b2 lscpu: simplify cache column output function
Simplify the logic to "always print a ',' for each cache except if it is the
last one.  This is also a preparation patch for printing the cache column for
offline CPUs where it would print one colon too much because of the current
logic.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-09 06:24:26 +02:00
Heiko Carstens 08cd09415a lscpu: fix cache output for extended parsable output
The extended parsable output prints a colon instead of comma between each
item. The case where a CPU doesn't belong to any cache was not converted.
Just fix this.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-09 06:24:14 +02:00
Heiko Carstens c403ae6a1a lscpu: remove comma operator
Fix typo where the comma operator has been introduced.
Use a semicolon instead so we end up with simple assignment expressions.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-09 06:24:12 +02:00
Karel Zak bb6f91636c mount: fix compiler warning [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-08 19:54:22 +02:00
Karel Zak c672220f1c dmesg: add --file option
This new option is mostly for testing (to test raw logs from another
boxes/kernels).

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-08 19:40:34 +02:00