diff options
author | Wang Dong <dongdwdw@linux.vnet.ibm.com> | 2017-03-24 11:20:09 +0100 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2017-05-01 15:05:37 -0700 |
commit | ee2c0c20fb215af43b12195e8cd645cc1a0bd96e (patch) | |
tree | a2c5b568321c19ca0772d37b9f17f99165c7239a /libparted/labels | |
parent | 1545d6d4db29fa20f0c611786a094521e8974d4a (diff) | |
download | parted-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.c | 6 |
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); |