]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Fix virStorageBackendDiskDeleteVol for device mapper
authorJohn Ferlan <jferlan@redhat.com>
Tue, 26 Apr 2016 12:53:57 +0000 (08:53 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 11 May 2016 13:23:31 +0000 (09:23 -0400)
commit8cdff0b93f732256df8d4a5c4eb418f37c707291
tree24eacb8d2822e5b071a4df64fb3cfe9b698d7e7b
parente7bde8d319d86305ee542e554118139f06239094
storage: Fix virStorageBackendDiskDeleteVol for device mapper

Commit id 'df1011ca8' modified virStorageBackendDiskDeleteVol to use
"dmsetup remove --force" to remove the volume, but left things in an
inconsistent state since the partition still existed on the disk and
only the device mapper device (/dev/dm-#) was removed.

Prior to commit '1895b421' (or '1ffd82bb' and '471e1c4e'), this could
go unnoticed since virStorageBackendDiskRefreshPool wasn't called.
However, the pool would be unusable since the /dev/dm-# device would
be removed even though the partition was not removed unless a multipathd
restart reset the link. That would of course make the volume appear again
in the pool after a refresh or pool start after libvirt reload.

This patch removes the 'dmsetup' logic and re-implements the partition
deletion logic for device mapper devices. The removal of the partition
via 'parted rm --script #' will cause udev device change logic to allow
multipathd to handle removing the dm-* device associated with the partition.
configure.ac
src/storage/parthelper.c
src/storage/storage_backend_disk.c