[libvirt] [PATCH v3 1/6] storage: Fix setting mode in virStorageBackendCreateExecCommand

Ján Tomko jtomko at redhat.com
Wed Nov 4 08:54:11 UTC 2015


On Tue, Nov 03, 2015 at 12:09:48PM -0500, John Ferlan wrote:
> Currently the code does not handle the NFS root squash environment
> properly since if the file gets created, then the subsequent chmod
> will fail in a root squash environment where we're creating a file
> in the pool with qemu tools, such as seen via:
> 
>    $ virsh vol-create-from $pool $file.xml file.img --inputpool $pool
> 
> assuming $file.xml is creating a file of "<format type='qcow2'"> from
> an existing file.img in the pool of "<format type='raw'>".
> 
> This patch will utilize the virCommandSetUmask when creating the file
> in the NETFS pool. The virCommandSetUmask API was added in commit id
> '0e1a1a8c4', which was after the original code was developed in commit
> id 'e1f27784' to attempt to handle the root squash environment.
> 
> Also, rather than blindly attempting to chmod, check to see if the
> st_mode bits from the stat match what we're trying to set and only
> make the chmod if they don't.
> 
> Also, a slight adjustment to the fallback algorithm to move the
> virCommandSetUID/virCommandSetGID inside the if (!filecreated) since
> they're only useful if we need to attempt to create the file again.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
> 

ACK

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151104/cbaf1997/attachment-0001.sig>


More information about the libvir-list mailing list