mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl/src: implement --dry-run option for device-based DASD dumps
Tested-by: Mikhail Zaslonko <zaslonko@linux.ibm.com> Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com> Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
f8ccd56bf1
commit
bd5f03d1c4
@@ -552,6 +552,9 @@ ask_for_confirmation(const char* fmt, ...)
|
||||
/* Always assume positive answer in non-interactive mode */
|
||||
if (!interactive)
|
||||
return 0;
|
||||
if (dry_run)
|
||||
/* nothing to confirm */
|
||||
return 0;
|
||||
/* Print question */
|
||||
va_start(args, fmt);
|
||||
vprintf(fmt, args);
|
||||
@@ -1169,8 +1172,7 @@ install_dump(const char *device, struct job_target_data *target, uint64_t mem,
|
||||
disk_free_info(info);
|
||||
return -1;
|
||||
}
|
||||
mfd.fd = open(tempdev, O_RDWR);
|
||||
if (mfd.fd == -1) {
|
||||
if (misc_open_device(tempdev, &mfd, dry_run) == -1) {
|
||||
error_text("Could not open temporary device node '%s'",
|
||||
tempdev);
|
||||
misc_free_temp_dev(tempdev);
|
||||
|
||||
@@ -181,11 +181,6 @@ main(int argc, char* argv[])
|
||||
if (!job_dump_is_ngdump(job) &&
|
||||
(disk_is_tape(job->data.dump.device) ||
|
||||
!disk_type_is_scsi(&ext_type))) {
|
||||
if (dry_run) {
|
||||
error_text("Option '--dry-run' is not implemented for this type of dump");
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
rc = install_dump(job->data.dump.device, &job->target,
|
||||
job->data.dump.mem, job->data.dump.no_compress);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user