• O
    storage: Allow to delete device mapper disk partition · df1011ca
    Osier Yang 提交于
    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
    -----------------------------------------
    df1011ca
util.c 79.5 KB