]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: On error unlink created file in virFileOpen{As|Forked}
authorJohn Ferlan <jferlan@redhat.com>
Thu, 8 Oct 2015 12:39:51 +0000 (08:39 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 13 Oct 2015 22:03:55 +0000 (18:03 -0400)
commit695562154f8720fe2a35d3368e26ff42ef1516d9
tree897f20619fab8e21e85436bb0459a121a58c3763
parentc4dd2a1fafe564d72b50c6e6d2c76a37edfae108
storage: On error unlink created file in virFileOpen{As|Forked}

After a successful creation of a file, if some other call results
in returning a failure, let's unlink the file 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 volume we created.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/util/virfile.c