Blame SOURCES/0074-libparted-dasd-add-an-exception-for-changing-DASD-LD.patch

003ee8
From c6ada23e466d824efcaff699a3de2923895c2244 Mon Sep 17 00:00:00 2001
003ee8
From: Wang Dong <dongdwdw@linux.vnet.ibm.com>
003ee8
Date: Fri, 24 Mar 2017 11:20:09 +0100
003ee8
Subject: [PATCH 74/75] libparted/dasd: add an exception for changing DASD-LDL
003ee8
 partition table
003ee8
003ee8
The partition table of DASD-LDL device with the dasd disk label
003ee8
should not be changed according to its character in Linux.
003ee8
When the user tries to modify the partition table, an exception
003ee8
will be raised to inform user of this character.
003ee8
003ee8
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
003ee8
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
003ee8
---
003ee8
 libparted/labels/dasd.c | 6 +++++-
003ee8
 1 file changed, 5 insertions(+), 1 deletion(-)
003ee8
003ee8
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
003ee8
index e246ecb..632ec8e 100644
003ee8
--- a/libparted/labels/dasd.c
003ee8
+++ b/libparted/labels/dasd.c
003ee8
@@ -619,8 +619,12 @@ dasd_write (const PedDisk* disk)
003ee8
 	PDEBUG;
003ee8
 
003ee8
 	/* If not formated in CDL, don't write anything. */
003ee8
-	if (disk_specific->format_type == 1)
003ee8
+	if (disk_specific->format_type == 1) {
003ee8
+		ped_exception_throw (PED_EXCEPTION_ERROR,
003ee8
+				     PED_EXCEPTION_CANCEL,
003ee8
+				     _("The partition table of DASD-LDL device cannot be changed.\n"));
003ee8
 		return 1;
003ee8
+	}
003ee8
 
003ee8
 	/* initialize the anchor */
003ee8
 	fdasd_initialize_anchor(&anchor);
003ee8
-- 
003ee8
2.9.3
003ee8