[libvirt] [PATCH 06/12] storage: On error rmdir created directory in virDirCreate[NoFork]

Peter Krempa pkrempa at redhat.com
Tue Oct 13 12:53:16 UTC 2015


On Fri, Oct 09, 2015 at 09:34:05 -0400, John Ferlan wrote:
> After a successful creation of a directory, if some other call results
> in returning a failure, let's remove the directory we created to
> prevent another round trip or confusion in the caller. In particular, this
> function can be called during a storage backend buildVol, so in order
> to ensure that caller doesn't need to distinguish between failed create
> or some other failure after create, just remove the directory we created.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/util/virfile.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/util/virfile.c b/src/util/virfile.c
> index 51198e2..2cb2469 100644
> --- a/src/util/virfile.c
> +++ b/src/util/virfile.c

...

> @@ -2420,6 +2420,7 @@ virDirCreateNoFork(const char *path,
> @@ -2465,6 +2469,7 @@ virDirCreate(const char *path,

Please document the semantics in the function comments for the two
functions.

ACK with docs.

Peter
-------------- 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/20151013/e9952df9/attachment-0001.sig>


More information about the libvir-list mailing list