提交 a0d88ed4 编写于 作者: J John Ferlan

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.
上级 290ffcfb
...@@ -495,8 +495,8 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool, ...@@ -495,8 +495,8 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool,
if (vol->target.format == VIR_STORAGE_VOL_DISK_EXTENDED) { if (vol->target.format == VIR_STORAGE_VOL_DISK_EXTENDED) {
/* make sure we don't have a extended partition already */ /* make sure we don't have a extended partition already */
for (i = 0; i < pool->volumes.count; i++) { for (i = 0; i < pool->volumes.count; i++) {
if (pool->volumes.objs[i]->target.format == if (pool->volumes.objs[i]->source.partType ==
VIR_STORAGE_VOL_DISK_EXTENDED) { VIR_STORAGE_VOL_DISK_TYPE_EXTENDED) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("extended partition already exists")); _("extended partition already exists"));
return -1; return -1;
...@@ -517,8 +517,8 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool, ...@@ -517,8 +517,8 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool,
case VIR_STORAGE_VOL_DISK_TYPE_LOGICAL: case VIR_STORAGE_VOL_DISK_TYPE_LOGICAL:
/* make sure we have a extended partition */ /* make sure we have a extended partition */
for (i = 0; i < pool->volumes.count; i++) { for (i = 0; i < pool->volumes.count; i++) {
if (pool->volumes.objs[i]->target.format == if (pool->volumes.objs[i]->source.partType ==
VIR_STORAGE_VOL_DISK_EXTENDED) { VIR_STORAGE_VOL_DISK_TYPE_EXTENDED) {
if (virAsprintf(partFormat, "logical %s", if (virAsprintf(partFormat, "logical %s",
partedFormat) < 0) partedFormat) < 0)
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册