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