]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Error out earlier if the volume target path already exists
authorOsier Yang <jyang@redhat.com>
Wed, 5 Dec 2012 04:44:11 +0000 (12:44 +0800)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:53:42 +0000 (16:53 -0500)
commit9b625cbcf036e042989b6af9cb1e470cf53e1924
tree55415ed1bf6a3572e1ca51dd9129e9ece0ede229
parent977434356419a5fc22ba20f4a792a3eeadd0c94c
storage: Error out earlier if the volume target path already exists

https://bugzilla.redhat.com/show_bug.cgi?id=832302

It's odd to fall through to buildVol, and the existed file is
removed when buildVol fails. This checks if the volume target
path already exists in createVol. The reason for not using
error like "Volume already exists" is that there isn't volume
maintained by libvirt for the path until a operation like
pool-refresh, using error like that will just cause confusion.
(cherry picked from commit d1f3d14974b4213193130d4b01d4449ad1533cbb)
src/storage/storage_backend_fs.c