Commit Graph

1878 Commits

Author SHA1 Message Date
John Ferlan
0b7ec61bcc storage: Better describe logical pool creation/definition parameters
https://bugzilla.redhat.com/show_bug.cgi?id=1398087

Clean up the virsh man page description for --pool-create-as in order
to better describe how the various arguments are used when creating
(or defining) a logical pool.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2017-03-28 13:19:47 +02:00
Ján Tomko
fcb90d72ab Revert "storage: Better describe logical pool creation/definition parameters"
This reverts commit ca4515d263
which also included a functional change that broke logical storage pools
not named after their volume groups.
2017-03-28 13:19:47 +02:00
John Ferlan
ca4515d263 storage: Better describe logical pool creation/definition parameters
https://bugzilla.redhat.com/show_bug.cgi?id=1398087

Clean up the virsh man page description for --pool-create-as in order
to better describe how the various arguments are used when creating
(or defining) a logical pool.

Also modify the storage pool XML parsing algorithm to check for the
mismatched "name" and "source-name".
2017-03-27 14:31:42 -04:00
John Ferlan
5d5380cf66 virsh.pod: Move the positional --print-xml for pool-{define|create}-as
Move the --print-xml to the end of the qualifiers since it's not
properly positionally situated for both --pool-create-as and --pool-define-as
and could be miscontrued as being the 3rd positional argument.
2017-03-27 14:31:42 -04:00
Ján Tomko
df6551feb4 virsh: reject more negative numbers
Be more positive and reject negative numbers where we don't
allow them by using the virStrToLong variants with 'p'.

https://bugzilla.redhat.com/show_bug.cgi?id=1436119
2017-03-27 17:20:03 +02:00
Peter Krempa
91c3d430c9 qemu: stats: Display the block threshold size in bulk stats
Management tools may want to check whether the threshold is still set if
they missed an event. Add the data to the bulk stats API where they can
also query the current backing size at the same time.
2017-03-27 10:35:20 +02:00
Peter Krempa
97148962b5 virsh: Implement 'domblkthreshold' command to call virDomainSetBlockThreshold
Add a simple wrapper which will allow to set the threshold for
delivering the event.
2017-03-27 10:15:55 +02:00
Peter Krempa
085e794a86 lib: Introduce event for tracking disk backing file write threshold
When using thin provisioning, management tools need to resize the disk
in certain cases. To avoid having them to poll disk usage introduce an
event which will be fired when a given offset of the storage is written
by the hypervisor. Together with the API which will be added later, it
will allow registering thresholds for given storage backing volumes and
this event will then notify management if the threshold is exceeded.
2017-03-27 09:29:57 +02:00
John Ferlan
6a8d898de6 Add new migration flag VIR_MIGRATE_TLS
Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-03-25 08:19:49 -04:00
Roman Bogorodskiy
321ff4087c virt-host-validate: add bhyve support
Add bhyve support to virt-host-validate(1). It checks for the
essential kernel modules to be available so that user can actually
start VMs, have networking and console access.

It uses the kldnext(2)/kldstat(2) routines to retrieve modules list.
As bhyve is only available on FreeBSD and these routines were available
long before bhyve appeared, not adding any specific configure checks
for that.

Also, update tools/Makefile.am to add
virt-host-validate-$driver.[hc] to the build only if the
appropriate driver is enabled.
2017-03-11 21:22:58 +04:00
Nitesh Konkar
0265bbeee3 perf: add emulation_faults software perf event support
This patch adds support and documentation
for the emulation_faults perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:05 -05:00
Nitesh Konkar
6780791f18 perf: add alignment_faults software perf event support
This patch adds support and documentation
for the alignment_faults perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:05 -05:00
Nitesh Konkar
43a54cedf6 perf: add page_faults_maj software perf event support
This patch adds support and documentation
for the page_faults_maj perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:05 -05:00
Nitesh Konkar
d216e9ad77 perf: add page_faults_min software perf event support
This patch adds support and documentation
for the page_faults_min perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:04 -05:00
Nitesh Konkar
8110c6a567 perf: add cpu_migrations software perf event support
This patch adds support and documentation
for the cpu_migrations perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:04 -05:00
Nitesh Konkar
99cc3dc6a2 perf: add context_switches software perf event support
This patch adds support and documentation
for the context_switches perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:04 -05:00
Nitesh Konkar
6ef2c7e00f perf: add page_faults software perf event support
This patch adds support and documentation
for the page_faults perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:04 -05:00
Nitesh Konkar
20dc690865 perf: add task_clock software perf event support
This patch adds support and documentation for
the task_clock perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:04 -05:00
Nitesh Konkar
f372a862ac perf: add cpu_clock software perf event support
This patch adds support and documentation for
the cpu_clock perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-07 13:51:04 -05:00
Nitesh Konkar
78d2bb7486 Don't print extra newline in virsh domstats output
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-03-06 11:40:21 -05:00
Daniel P. Berrange
5d84f5961b Add ATTRIBUTE_FALLTHROUGH for switch cases without break
In GCC 7 there is a new warning triggered when a switch
case has a conditional statement (eg if ... else...) and
some of the code paths fallthrough to the next switch
statement. e.g.

conf/domain_conf.c: In function 'virDomainChrEquals':
conf/domain_conf.c:14926:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
         if (src->targetTypeAttr != tgt->targetTypeAttr)
            ^
conf/domain_conf.c:14928:5: note: here
     case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
     ^~~~
conf/domain_conf.c: In function 'virDomainChrDefFormat':
conf/domain_conf.c:22143:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
         if (def->targetTypeAttr) {
            ^
conf/domain_conf.c:22151:5: note: here
     default:
     ^~~~~~~

GCC introduced a __attribute__((fallthrough)) to let you
indicate that this is intentionale behaviour rather than
a bug.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-23 10:11:16 +00:00
John Ferlan
ff029e4434 virsh: Alter formatting a bit for output of domstats fields
Alter the formatting of each line to not give the appearance of
one long run-on sentence and to be consistent between the various
elements of collected/displayed data. The formatting should fit
within the 80 character display. This removes the need for commas
at the end of each line.
2017-02-22 15:18:46 -05:00
Peter Krempa
f0326d6dd9 virsh: Implement command for virDomainSetVcpu called setvcpu
Add a simple virsh command handler which makes use of the new API.
2017-02-21 15:06:59 +01:00
Michal Privoznik
78c018693b nodedev: Introduce new drm cap
After 7f1bdec5fa our nodedev driver is capable of
determining DRM devices (DRM stands for Direct Render Manager not
Digital rights management). There is still one bit missing
though: virConnectListAllNodeDevices() is capable of listing
either all devices or just those with specified capability. Well,
DRM capability is missing there.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-02-17 16:09:15 +01:00
Martin Kletzander
862bea96d9 virsh: Use consistent naming for blkdeviotune options
All options started with underscores, but we switched them to dashes
later on, making the style consistent.  The latest addition, however,
did not respect that, so let's change that as well.  It is tempting to
just change the name instead of adding alias, especially since nobody
ever used it, which we know thanks to the fact that it didn't work.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2017-01-29 19:57:12 +01:00
Martin Kletzander
a20e8bcad5 virsh: Actually make blkdeviotune --group_name work
Function vshCommandOptStringReq() returns -1 on error and 0 on
success.  The code, however, used the 'group_name' variable only if it
returned 1 (never).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2017-01-29 19:57:12 +01:00
Nitesh Konkar
a4ec42805c virsh: Fix manpage typo
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-01-26 15:13:58 -05:00
Nitesh Konkar
1c1e6c1e18 virsh: Modify description for LIBVIRT_DEBUG=4 in manpage
As LIBVIRT_DEBUG=4 logs only error messages and there
are no levels above it, adjusting the description in
the man page accordingly.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-01-26 15:13:58 -05:00
Nitesh Konkar
4dd19ea913 docs: Reword virsh manpage for --uuid --name --details options
This commit is similar to commit 0977ada8.The virsh manpage
lists options --uuid and --name as mutually exclusive if
option --details is specified when actually the option
--details is mutually exclusive and can't go with options
--uuid and/or --name. This patch rewords the virsh manpage
to state the correct meaning.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-01-26 15:13:58 -05:00
Olga Krishtal
e590d5301e storage: Introduce Virtuozzo vstorage backend
Added general definitions for vstorage pool backend including
the build options to add --with-storage-vstorage checking.
In order to use vstorage as a backend for a storage pool
vstorage tools (vstorage and vstorage-mount) need to be installed.

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
2017-01-26 10:43:42 -05:00
Andrea Bolognani
5fff7b99db nss: Remove RES_USE_INET6 usage
The recent deprecation in glibc (commit b76e065991ec) means the
module will fail to build entirely:

  nss/libvirt_nss.c: In function '_nss_libvirt_gethostbyname_r':
  nss/libvirt_nss.c:363:13: error: RES_USE_INET6 is deprecated [-Werror]
     int af = ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This resolver option was removed shortly after being introduced,
and application using it are already broken anyway.
2017-01-19 13:46:20 +01:00
Chen Hanxiao
b5817855c0 virsh: pool-list: allow both --uuid and --name in one cmd
This patch will allow --uuid and --name in one cmd.
The pool's UUID and name will be printed side by side.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-18 09:12:31 -05:00
Chen Hanxiao
0d9bcd6ffa virsh: pool-list: introduce --name for printing pool's name only
This patch will introduce option --name.
If specified, only name of pools will be printed out.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-18 08:46:14 -05:00
Chen Hanxiao
3fe791f8c9 virsh: pool-list: introduce --uuid for printing pool's UUID only
This patch will introduce option --uuid.
If specified, only UUID of pools will be printed out.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-18 08:46:14 -05:00
Daniel P. Berrange
2d0c4947ab Revert "perf: Add cache_l1d perf event support"
This reverts commit ae16c95f1b.
2017-01-16 16:54:34 +00:00
Chen Hanxiao
b29f7528ec virsh: pool-info: introduce option --bytes
By default, pool-info will convert sizes to human friendly units.

This patch will introduce option [--bytes].
If specified, the raw sizes will be in the output.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-10 19:24:41 -05:00
John Ferlan
f573f84eb7 storage: Add overwrite flag checking for logical pool
https://bugzilla.redhat.com/show_bug.cgi?id=1373711

Add support and documentation for the [NO_]OVERWRITE flags for the
logical backend.

Update virsh.pod with a description of the process for usage of
the flags and building of the pool's volume group.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-01-10 08:44:50 -05:00
John Ferlan
a48c674fba storage: Move and rename disk backend label checking
Rather than have the Disk code having to use PARTED to determine if
there's something on the device, let's use the virStorageBackendDeviceProbe.
and only fallback to the PARTED probing if the BLKID code isn't built in.

This will also provide a mechanism for the other current caller (File
System Backend) to utilize a PARTED parsing algorithm in the event that
BLKID isn't built in to at least see if *something* exists on the disk
before blindly trying to use. The PARTED error checking will not find
file system types, but if there is a partition table set on the device,
it will at least cause a failure.

Move virStorageBackendDiskValidLabel and virStorageBackendDiskFindLabel
to storage_backend and rename/rework the code to fit the new model.

Update the virsh.pod description to provide a more generic description
of the process since we could now use either blkid or parted to find
data on the target device.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-01-10 08:44:50 -05:00
John Ferlan
f23d4bbce3 storage: Fix implementation of no-overwrite for file system backend
https://bugzilla.redhat.com/show_bug.cgi?id=1363586

Commit id '27758859' introduced the "NO_OVERWRITE" flag check for
file system backends; however, the implementation, documentation,
and algorithm was inconsistent. For the "flag" description for the
API the flag was described as "Do not overwrite existing pool";
however, within the storage backend code the flag is described
as "it probes to determine if filesystem already exists on the
target device, renurning an error if exists".

The code itself was implemented using the paradigm to set up the
superblock probe by creating a filter that would cause the code
to only search for the provided format type. If that type wasn't
found, then the algorithm would return success allowing the caller
to format the device. If the format type already existed on the
device, then the code would fail indicating that the a filesystem
of the same type existed on the device.

The result is that if someone had a file system of one type on the
device, it was possible to overwrite it if a different format type
was specified in updated XML effectively trashing whatever was on
the device already.

This patch alters what NO_OVERWRITE does for a file system backend
to be more realistic and consistent with what should be expected when
the caller requests to not overwrite the data on the disk.

Rather than filter results based on the expected format type, the
code will allow success/failure be determined solely on whether the
blkid_do_probe calls finds some known format on the device. This
adjustment also allows removal of the virStoragePoolProbeResult
enum that was under utilized.

If it does find a formatted file system different errors will be
generated indicating a file system of a specific type already exists
or a file system of some other type already exists.

In the original virsh support commit id 'ddcd5674', the description
for '--no-overwrite' within the 'pool-build' command help output
has an ambiguous "of this type" included in the short description.
Compared to the longer description within the "Build a given pool."
section of the virsh.pod file it's more apparent that the meaning
of this flag would cause failure if a probe of the target already
has a filesystem.

So this patch also modifies the short description to just be the
antecedent of the 'overwrite' flag, which matches the API description.
This patch also modifies the grammar in virsh.pod for no-overwrite
as well as reworking the paragraph formats to make it easier to read.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-01-10 08:44:50 -05:00
Laine Stump
24d4a0a1fb docs: fix list of domain states in virsh manpage
The virsh manpage lists "shutdown" and "dying" as two of the possible
domain states that could be listed in the output of the "virsh list"
command. However, a domain that is being shutdown will be listed as
"in shutdown", and the "dying" state doesn't even exist (and never
has, as far as I can tell from looking through git history - it was
shown in the original import of the virsh.pod file in 2006; there was
no VIR_DOMAIN_DYING state then, there wasn't one when those lines of
virsh.pod were tweaked in 2008, and there still isn't one
today. Apparently it was just something that sounded like a good idea
to someone at some time, but was never implemented...)

Resolves: https://bugzilla.redhat.com/1408778
2017-01-10 03:41:09 -05:00
Nitesh Konkar
ae16c95f1b perf: Add cache_l1d perf event support
This patch adds support and documentation for
a generalized hardware cache event called cache_l1d
perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-01-09 18:15:31 -05:00
Nitesh Konkar
0977ada851 docs: Reword virsh manpage for --uuid --name --table options
The virsh manpage lists options --uuid and --name as
mutually exclusive along option --table when actually
the option --table is mutually exclusive and can't go
with options --uuid and/or --name. This patch rewords the
virsh manpage to state the correct meaning.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-01-09 18:03:19 -05:00
Nitesh Konkar
0289b8b2ba virsh: Display perf enabled/disabled message for set operations
When setting perf events, the enabled/disabled perf events are not
listed. Since we know which events were changed it's possible to
print out the values on successful set, such as :

    virsh perf Domain --enable instructions --disable cache_misses
    instructions   : enabled
    cache_misses   : disabled

Created a helper to print the messages - use the vshPrintExtra to
adhere to the --quiet|-q option being set by some script. This will
cause the get code to print nothing, but will return success/failure.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2017-01-09 17:55:59 -05:00
Nitesh Konkar
779073c575 virsh: Fix English grammar in the virsh perf manpage 2017-01-09 17:38:59 -05:00
Daniel P. Berrange
42241208d9 secret: add support for value change events
Emit an event whenever a secret value changes

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-01-09 16:42:04 +00:00
Daniel P. Berrange
d6398c869c virsh: add secret lifecycle event handling
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-01-09 15:53:49 +00:00
Daniel P. Berrange
c50070173d Add domain event for metadata changes
When changing the metadata via virDomainSetMetadata, we now
emit an event to notify the app of changes. This is useful
when co-ordinating different applications read/write of
custom metadata.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-01-09 15:53:00 +00:00
Chen Hanxiao
96b1f091e7 virsh: Fix grammar - s/rather then/rather than
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-07 09:09:54 -05:00
John Ferlan
f62e418c86 virsh: Allow display of the physical volume size
Add a new qualifier '--physical' to the 'vol-info' command in order to
dispaly the physical size of the volume. The size can differ from the
allocation value depending on the volume file time. In particular, qcow2
volumes will have a physical value larger than allocation. This also occurs
for sparse files, although for those the capacity is the largest size;
whereas, for qcow2 capacity is the logical size.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2016-12-20 13:54:03 -05:00
Nitesh Konkar
71bbe65311 perf: add ref_cpu_cycles perf event support
This patch adds support and documentation for
the ref_cpu_cycles perf event.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2016-12-15 17:32:03 -05:00