]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Set the perms if the pool target already exists for fs pools
authorOsier Yang <jyang@redhat.com>
Tue, 19 Jun 2012 08:15:27 +0000 (16:15 +0800)
committerOsier Yang <jyang@redhat.com>
Thu, 21 Jun 2012 03:06:41 +0000 (11:06 +0800)
commite4cfe5f699579e8eaebb6d0bb0f100e7d83a120b
treeef9d0aea1f17f71d25bf4bcdcd3fdac9e3206a64
parentd4edc089f582dc060762242d08c48f9bddb1ba9d
storage: Set the perms if the pool target already exists for fs pools

The comment says:

/* Now create the final dir in the path with the uid/gid/mode
 * requested in the config. If the dir already exists, just set
 * the perms.
 */

However, virDirCreate is only invoked if the target path doesn't
exist yet (which is opposite with the comment), or the uid from
the config is not -1 (I don't understand why, think it's just
another mistake). And the result is the perms of the pool won't
be changed if one tries to build the pool with different perms
again.

Besides these logic error fix, if no uid and gid are specified in
the config, the practical used uid, gid are reflected.
src/storage/storage_backend_fs.c