]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Allow to delete device mapper disk partition
authorOsier Yang <jyang@redhat.com>
Thu, 17 Feb 2011 07:29:07 +0000 (15:29 +0800)
committerOsier Yang <jyang@redhat.com>
Thu, 17 Feb 2011 07:29:07 +0000 (15:29 +0800)
commitdf1011ca8ee8160a2c60b2a639392e9d86fcf262
tree1f2df56ed20a60bd98597768602d6548d53d7297
parent43f8773c1ffbd6cf746a60ddb856b6708f82d0bb
storage: Allow to delete device mapper disk partition

The name convention of device mapper disk is different, and 'parted'
can't be used to delete a device mapper disk partition. e.g.

Name                 Path
-----------------------------------------
3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1

Error: Expecting a partition number.

This patch introduces 'dmsetup' to fix it.

Changes:
  - New function "virIsDevMapperDevice" in "src/utils/utils.c"
  - remove "is_dm_device" in "src/storage/parthelper.c", use
    "virIsDevMapperDevice" instead.
  - Requires "device-mapper" for 'with-storage-disk" in "libvirt.spec.in"
  - Check "dmsetup" in 'configure.ac' for "with-storage-disk"
  - Changes on "src/Makefile.am" to link against libdevmapper
  - New entry for "virIsDevMapperDevice" in "src/libvirt_private.syms"

Changes from v1 to v3:
  - s/virIsDeviceMapperDevice/virIsDevMapperDevice/g
  - replace "virRun" with "virCommand"
  - sort the list of util functions in "libvirt_private.syms"
  - ATTRIBUTE_NONNULL(1) for virIsDevMapperDevice declaration.

e.g.

Name                 Path
-----------------------------------------
3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1

Vol /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 deleted

Name                 Path
-----------------------------------------
configure.ac
libvirt.spec.in
src/Makefile.am
src/libvirt_private.syms
src/storage/parthelper.c
src/storage/storage_backend_disk.c
src/util/util.c
src/util/util.h