libvirt/tools
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
..
nss nss: Need to check error condition on virJSONValueArraySize 2016-12-08 14:58:31 -05:00
wireshark wireshark: Drop glib dependency 2016-08-01 12:02:51 +02:00
libvirt_win_icon_16x16.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_32x32.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_48x48.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_64x64.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt-guests.init.in Fix LSB requirements in service script and sync them 2016-01-11 15:49:13 +01:00
libvirt-guests.service.in libvirtd: systemd: add special target for system shutdown 2016-11-23 11:13:53 +03:00
libvirt-guests.sh.in tools: Exclude Xen dom0 from libvirt-guests.sh list 2016-10-10 16:52:08 +08:00
libvirt-guests.sysconf libvirt-guests: Allow time sync on guests resume 2015-02-23 08:49:21 +01:00
Makefile.am nss: Introduce libvirt-guest module 2016-12-06 13:34:00 +01:00
virsh_win_icon.rc Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virsh-console.c tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-console.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-domain-monitor.c qemu: expand domain memory statistics with 'last-update' timestamp 2016-07-26 17:30:01 +02:00
virsh-domain-monitor.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-domain.c virsh: Display perf enabled/disabled message for set operations 2017-01-09 17:55:59 -05:00
virsh-domain.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-edit.c tools: Replace vshPrint with vshPrintExtra on places we forgot about 2016-11-14 12:14:11 +01:00
virsh-host.c virsh: maxvcpus: Always fall back to the old command if domain caps fail 2016-12-09 15:57:16 +01:00
virsh-host.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-interface.c tools: Replace vshPrint with vshPrintExtra on places we forgot about 2016-11-14 12:14:11 +01:00
virsh-interface.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-network.c tools: Replace vshPrint with vshPrintExtra on places we forgot about 2016-11-14 12:14:11 +01:00
virsh-network.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-nodedev.c Fix minor typos 2016-12-02 09:25:13 +01:00
virsh-nodedev.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-nwfilter.c tools: Replace vshPrint with vshPrintExtra on places we forgot about 2016-11-14 12:14:11 +01:00
virsh-nwfilter.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-pool.c storage: Fix implementation of no-overwrite for file system backend 2017-01-10 08:44:50 -05:00
virsh-pool.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh-secret.c secret: add support for value change events 2017-01-09 16:42:04 +00:00
virsh-secret.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-snapshot.c virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
virsh-snapshot.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-volume.c virsh: Allow display of the physical volume size 2016-12-20 13:54:03 -05:00
virsh-volume.h tools: Introduce new client generic module vsh 2015-08-14 15:45:44 +02:00
virsh.c virsh: Move cmdSelfTest to vsh 2016-09-14 13:18:07 +02:00
virsh.h virsh: Add support for text based polkit authentication 2016-03-01 06:50:16 -05:00
virsh.pod storage: Fix implementation of no-overwrite for file system backend 2017-01-10 08:44:50 -05:00
virt-admin.c virt-admin: Wire-up the logging APIs 2016-12-15 10:36:23 +01:00
virt-admin.h Revert "admin: Rename virAdmConnect to virAdmDaemon" 2015-12-21 10:07:59 +01:00
virt-admin.pod virt-admin: Wire-up the logging APIs 2016-12-15 10:36:23 +01:00
virt-host-validate-common.c virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
virt-host-validate-common.h headers: Remove unnecessary keyword extern from function declaration 2016-05-11 09:06:32 +02:00
virt-host-validate-lxc.c host-validate: Fix suggestion for missing cpu cgroup 2016-03-30 09:41:54 +02:00
virt-host-validate-lxc.h headers: Remove unnecessary keyword extern from function declaration 2016-05-11 09:06:32 +02:00
virt-host-validate-qemu.c virt-host-validate: fix build with clang 2016-06-14 08:02:45 +03:00
virt-host-validate-qemu.h headers: Remove unnecessary keyword extern from function declaration 2016-05-11 09:06:32 +02:00
virt-host-validate.c build: Extract pod from source files 2016-04-25 15:40:43 +02:00
virt-host-validate.pod man: Fix links 2016-04-25 15:40:44 +02:00
virt-login-shell.c virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
virt-login-shell.conf virt-login-shell: add ability to auto-detect shell from container 2016-06-10 11:03:02 +01:00
virt-login-shell.pod virt-login-shell: add ability to auto-detect shell from container 2016-06-10 11:03:02 +01:00
virt-pki-validate.in build: Extract pod from source files 2016-04-25 15:40:43 +02:00
virt-pki-validate.pod man: Fix links 2016-04-25 15:40:44 +02:00
virt-sanlock-cleanup.in build: Extract pod from source files 2016-04-25 15:40:43 +02:00
virt-sanlock-cleanup.pod man: Fix links 2016-04-25 15:40:44 +02:00
virt-xml-validate.in build: Extract pod from source files 2016-04-25 15:40:43 +02:00
virt-xml-validate.pod man: Fix links 2016-04-25 15:40:44 +02:00
vsh.c vsh: Mark some function arguments as unused 2016-12-09 10:52:29 +01:00
vsh.h virt-admin: Tweak command parsing logic so that aliases point to new commands 2016-09-20 15:17:46 +02:00