mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
storage: When delete extended partition, need to refresh pool
When removing a volume that is the extended partition, all the logical volume partitions that exist within the extended partition will also be removed, so we need to refresh the pool to have the updated list
This commit is contained in:
parent
bce671b731
commit
471e1c4e2a
@ -654,7 +654,7 @@ virStorageBackendDiskPartBoundaries(virStoragePoolObjPtr pool,
|
||||
|
||||
|
||||
static int
|
||||
virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virStorageBackendDiskDeleteVol(virConnectPtr conn,
|
||||
virStoragePoolObjPtr pool,
|
||||
virStorageVolDefPtr vol,
|
||||
unsigned int flags)
|
||||
@ -721,6 +721,15 @@ virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* If this was the extended partition, then all the logical partitions
|
||||
* are then lost. Make it easy on ourselves and just refresh the pool
|
||||
*/
|
||||
if (vol->source.partType == VIR_STORAGE_VOL_DISK_TYPE_EXTENDED) {
|
||||
virStoragePoolObjClearVols(pool);
|
||||
if (virStorageBackendDiskRefreshPool(conn, pool) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
cleanup:
|
||||
VIR_FREE(devpath);
|
||||
|
Loading…
x
Reference in New Issue
Block a user