[parted-devel] [PATCH] libpartd/dasd: improve flag processing for DASD-LDL

Wang Dong dongdwdw at linux.vnet.ibm.com
Fri Mar 24 02:11:12 UTC 2017


DASD-LDL does not support flag now, so all the flags are
unavailable to it.

Signed-off-by: Andre Wild <wild at linux.vnet.ibm.com>
Signed-off-by: Wang Dong <dongdwdw at linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner at linux.vnet.ibm.com>
---
 libparted/labels/dasd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index c61e014..ffa5276 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -785,10 +785,24 @@ dasd_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
 	}
 }
 
+/*
+ * The DASD-LDL does not support flags now.
+ * So just return 0.
+*/
 static int
 dasd_partition_is_flag_available (const PedPartition* part,
                                   PedPartitionFlag flag)
 {
+	DasdDiskSpecific* disk_specific;
+	PED_ASSERT (part != NULL);
+	PED_ASSERT (part->disk != NULL);
+	PED_ASSERT (part->disk->disk_specific != NULL);
+
+	disk_specific = part->disk->disk_specific;
+
+	if (disk_specific->format_type == 1)
+		return 0;
+
 	switch (flag) {
 		case PED_PARTITION_RAID:
 			return 1;
-- 
2.8.4




More information about the parted-devel mailing list