mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
storage: Fix check for partition type for disk backing volumes
While checking the existing partitions in virStorageBackendDiskPartFormat, the code would erroneously compare the volume target format type (eg, the virStoragePartedFsType) rather than the source partition type (eg, the virStorageVolTypeDisk) which is set during virStorageBackendDiskReadPartitions.
This commit is contained in:
parent
290ffcfbbc
commit
a0d88ed4e7
@ -495,8 +495,8 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool,
|
||||
if (vol->target.format == VIR_STORAGE_VOL_DISK_EXTENDED) {
|
||||
/* make sure we don't have a extended partition already */
|
||||
for (i = 0; i < pool->volumes.count; i++) {
|
||||
if (pool->volumes.objs[i]->target.format ==
|
||||
VIR_STORAGE_VOL_DISK_EXTENDED) {
|
||||
if (pool->volumes.objs[i]->source.partType ==
|
||||
VIR_STORAGE_VOL_DISK_TYPE_EXTENDED) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("extended partition already exists"));
|
||||
return -1;
|
||||
@ -517,8 +517,8 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool,
|
||||
case VIR_STORAGE_VOL_DISK_TYPE_LOGICAL:
|
||||
/* make sure we have a extended partition */
|
||||
for (i = 0; i < pool->volumes.count; i++) {
|
||||
if (pool->volumes.objs[i]->target.format ==
|
||||
VIR_STORAGE_VOL_DISK_EXTENDED) {
|
||||
if (pool->volumes.objs[i]->source.partType ==
|
||||
VIR_STORAGE_VOL_DISK_TYPE_EXTENDED) {
|
||||
if (virAsprintf(partFormat, "logical %s",
|
||||
partedFormat) < 0)
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user