summaryrefslogtreecommitdiff
path: root/libparted/labels
diff options
context:
space:
mode:
authorWang Dong <dongdwdw@linux.vnet.ibm.com>2017-03-24 11:20:09 +0100
committerBrian C. Lane <bcl@redhat.com>2017-05-01 15:05:37 -0700
commitee2c0c20fb215af43b12195e8cd645cc1a0bd96e (patch)
treea2c5b568321c19ca0772d37b9f17f99165c7239a /libparted/labels
parent1545d6d4db29fa20f0c611786a094521e8974d4a (diff)
downloadparted-ee2c0c20fb215af43b12195e8cd645cc1a0bd96e.tar.gz
libparted/dasd: add an exception for changing DASD-LDL partition table
The partition table of DASD-LDL device with the dasd disk label should not be changed according to its character in Linux. When the user tries to modify the partition table, an exception will be raised to inform user of this character. Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com> Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Diffstat (limited to 'libparted/labels')
-rw-r--r--libparted/labels/dasd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index e246ecb..632ec8e 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -619,8 +619,12 @@ dasd_write (const PedDisk* disk)
PDEBUG;
/* If not formated in CDL, don't write anything. */
- if (disk_specific->format_type == 1)
+ if (disk_specific->format_type == 1) {
+ ped_exception_throw (PED_EXCEPTION_ERROR,
+ PED_EXCEPTION_CANCEL,
+ _("The partition table of DASD-LDL device cannot be changed.\n"));
return 1;
+ }
/* initialize the anchor */
fdasd_initialize_anchor(&anchor);