]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Fallback to use lvchange first if lvremove fails
authorChang Liu <lingjiao.lc@taobao.com>
Tue, 22 Nov 2011 07:24:25 +0000 (15:24 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 22 Nov 2011 07:24:25 +0000 (15:24 +0800)
commit3c5405149b00c84814712c2d22eb794ed45ac748
tree44f1d2b3c012b17eef1d87a907559b3b5fb6bef0
parente352b1640090b06149b13fc8d49cf56f9c31caf8
storage: Fallback to use lvchange first if lvremove fails

virStorageBackendLogicalDeleteVol() could not remove the lv with error
"could not remove open logical volume" sometimes. Generally it's caused
by the volume is still active, even if lvremove tries to remove it with
option "--force".

This patch is to fix it by disbale the lv first using "lvchange -aln"
and "lvremove -f" afterwards if the direct "lvremove -f" failed.
configure.ac
src/storage/storage_backend_logical.c