]> xenbits.xensource.com Git - libvirt.git/commit
storage: Add fs pool formatting
authorOsier Yang <jyang@redhat.com>
Wed, 31 Aug 2011 13:54:07 +0000 (21:54 +0800)
committerOsier Yang <jyang@redhat.com>
Fri, 2 Sep 2011 13:16:58 +0000 (21:16 +0800)
commit27758859c7192603d803fe0733ac9c141304c762
tree2e69ac3fa5af4066f2c8b8da4618b9f8be1dc89a
parent660cb2530f5bf15183475da54980eb260454000a
storage: Add fs pool formatting

This patch adds the ability to make the filesystem for a filesystem
pool during a pool build.

The patch adds two new flags, no overwrite and overwrite, to control
when mkfs gets executed.  By default, the patch preserves the
current behavior, i.e., if no flags are specified, pool build on a
filesystem pool only makes the directory on which the filesystem
will be mounted.

If the no overwrite flag is specified, the target device is checked
to determine if a filesystem of the type specified in the pool is
present.  If a filesystem of that type is already present, mkfs is
not executed and the build call returns an error.  Otherwise, mkfs
is executed and any data present on the device is overwritten.

If the overwrite flag is specified, mkfs is always executed, and any
existing data on the target device is overwritten unconditionally.
include/libvirt/libvirt.h.in
include/libvirt/virterror.h
src/Makefile.am
src/libvirt.c
src/storage/storage_backend_fs.c
src/storage/storage_backend_fs.h
src/util/virterror.c