From d5f853c460f04961fa9f7cb42c48c9f2f9341e5e Mon Sep 17 00:00:00 2001 From: Thomas Richter Date: Mon, 14 Nov 2022 14:00:52 +0100 Subject: [PATCH] vmur: Remove option -c for dump file conversion Remove option -c for implicit dump file conversion from vmdump format to lkcd format. If option -c is specified, an error message is printed and the program terminates. A hint to the new conversion tool zgetdump is shown. Option -c is not listed in the help text. The man page is also updated to reflect this change. With zgetdump tool now supporting vmdump file format there is no need to convert a vmdump file while extracting it from the reader device. Use commands 1. vmur rec VMDUMP_FILE 2. zgetdump VMDUMP_FILE ELF_FILE to extract a vmdump file from the reader and convert it to elf format. Note to Maintainer: The rename of file vmur.cpp to vmur.c triggers the pre-commit checking of git-format-clang. This checking fails. This is intended. The patch shows the changes for this line item. The pre-commit checking fails on many, many changes not touched for changed by this patch. The pre-commit failure should be fixed with a follow-on patch. Suggested-by: Heiko Carstens Signed-off-by: Thomas Richter Acked-by: Jan Hoeppner Signed-off-by: Steffen Eiden --- vmur/Makefile | 5 ++--- vmur/vmur.8 | 25 ++++++++++++++++--------- vmur/{vmur.cpp => vmur.c} | 34 ++++++---------------------------- 3 files changed, 24 insertions(+), 40 deletions(-) rename vmur/{vmur.cpp => vmur.c} (98%) diff --git a/vmur/Makefile b/vmur/Makefile index 2c1c2d53..6667ed7f 100644 --- a/vmur/Makefile +++ b/vmur/Makefile @@ -5,13 +5,12 @@ LDLIBS += -lz all: vmur -libs = $(rootdir)/libvmdump/libvmdump.a \ - $(rootdir)/libvmcp/libvmcp.a $(rootdir)/libutil/libutil.a +libs = $(rootdir)/libvmcp/libvmcp.a $(rootdir)/libutil/libutil.a objects = vmur.o vmur: $(objects) $(libs) - $(LINKXX) $(ALL_LDFLAGS) $^ $(LDLIBS) -o $@ + $(LINK) $(ALL_LDFLAGS) $^ $(LDLIBS) -o $@ install: all $(INSTALL) -d -m 755 $(DESTDIR)$(USRSBINDIR) $(DESTDIR)$(MANDIR)/man8 diff --git a/vmur/vmur.8 b/vmur/vmur.8 index f0a03de3..f2ebd509 100644 --- a/vmur/vmur.8 +++ b/vmur/vmur.8 @@ -50,7 +50,7 @@ Position a file at the top of a spool file queue The \*v program requires the vmcp kernel module as prerequisite. For the receive, punch, and print commands the vmur kernel module is also required, and the corresponding z/VM virtual unit record devices -(in most cases 000c as reader, 000d as punch, and 000e as printer) +(in most cases 000c as reader, 000d as punch, and 000e as printer) must be set online. See .BR chccwdev (8) @@ -77,7 +77,7 @@ respective command context. .IP "" 0 Synopsis: .IP "" 2 -receive [-fH] [-d dev_node] [-C class] [-t | -b sep.pad | -c] +receive [-fH] [-d dev_node] [-C class] [-t | -b sep.pad] spoolid [-O | outfile] .PP @@ -124,7 +124,7 @@ If omitted, /dev/vmrdr-0.0.000c is assumed. .IP "" 0 \fB-t or --text\fR .IP "" 2 -Specifies that a text file requiring EBCDIC-to-ASCII conversion is to be +Specifies that a text file requiring EBCDIC-to-ASCII conversion is to be received. Character sets IBM037 and ISO-8859-1 are used for the conversion. An ASCII line feed character (0x0a) is inserted for each 80-byte input record read from the z/VM reader. Trailing EBCDIC blanks (0x40) in the @@ -150,8 +150,14 @@ using the appropriate character sets, for example: .IP "" 0 \fB-c or --convert\fR .IP "" 2 -Specifies to convert the VMDUMP spool file into a -format appropriate for further analysis with crash or lcrash. +Dump file conversion has been removed from +.BR vmur (8) +and -c is no longer a valid option. +An error message is displayed and the program terminates. +Use +.BR zgetdump (8) +to convert VMDUMP files to a format +appropriate for further analysis with crash. .SP .IP "" 0 \fB-O or --stdout\fR @@ -299,7 +305,7 @@ residual of the record is filled up with the specified padding byte. If a line exceeds the record length, an error is printed. .br .BR iconv (1) -output can be piped to punch or print, for example: +output can be piped to punch or print, for example: .IP "" 2 # iconv xyz -f ISO-8859-1 -t EBCDIC-US | vmur pun -b 0x25,0x40 -N abc .SP @@ -403,7 +409,7 @@ The following command argument is supported by \fBlist\fR: \fBspoolid\fR .IP "" 2 Identifies the z/VM spool file to be listed. -If omitted, all spool files on the specified queue are listed +If omitted, all spool files on the specified queue are listed .PD .IP "" 0 .SP @@ -530,7 +536,7 @@ In the example below, the spool ID is 398: .in +0.25in .nf # vmcp sp cons clo \(rs* rdr -RDR FILE 0398 SENT FROM LINUX025 CON WAS 0398 RECS 1872 +RDR FILE 0398 SENT FROM LINUX025 CON WAS 0398 RECS 1872 .fi .in -0.25in .ft @@ -605,6 +611,7 @@ Prepare re-IPL from the z/VM reader and reboot: .SH "SEE ALSO" .BR chccwdev (8), .BR vmcp (8), -.BR iconv (1) +.BR iconv (1), +.BR zgetdump (8) .I "Linux on System z - Device Drivers, Features, and Commands" diff --git a/vmur/vmur.cpp b/vmur/vmur.c similarity index 98% rename from vmur/vmur.cpp rename to vmur/vmur.c index 5aedd85d..eec34066 100644 --- a/vmur/vmur.cpp +++ b/vmur/vmur.c @@ -77,7 +77,6 @@ struct vmur { int force_specified; int stdout_specified; int hold_specified; - int convert_specified; enum ur_action action; int devno; int ur_reclen; @@ -183,8 +182,6 @@ static char HELP_TEXT[] = "-t, --text Indicates text data causing EBCDIC to ASCII\n" " conversion.\n" "-b, --blocked Use blocked mode.\n" -"-c, --convert Specifies to convert VMDUMP file into a format\n" -" appropriate for further analysis with (l)crash.\n" "-O, --stdout Write spool file to stdout.\n" "-f, --force Overwrite files without prompt.\n" "-H, --hold Hold spool file in reader after receive.\n" @@ -814,7 +811,10 @@ static void parse_opts_receive(struct vmur *info, int argc, char *argv[]) ++info->hold_specified; break; case 'c': - ++info->convert_specified; + fprintf(stderr, "%s: Option '-c' is no longer valid. " + "Use zgetdump for dump file conversion.\n", + prog_name); + std_usage_exit(); break; case 'C': set_spool_class(info, optarg, 1); @@ -834,14 +834,12 @@ static void parse_opts_receive(struct vmur *info, int argc, char *argv[]) CHECK_SPEC_MAX(info->force_specified, 1, "force"); CHECK_SPEC_MAX(info->hold_specified, 1, "hold"); CHECK_SPEC_MAX(info->stdout_specified, 1, "stdout"); - CHECK_SPEC_MAX(info->convert_specified, 1, "convert"); CHECK_SPEC_MAX(info->spool_class_specified, 1, "class"); if (info->stdout_specified && info->file_name_specified) ERR_EXIT("File name not allowed, when --stdout specified!\n"); - if (info->blocked_specified + info->text_specified + - info->convert_specified > 1) - ERR_EXIT("Conflicting options: -b, -t and -c are mutually " + if (info->blocked_specified + info->text_specified) + ERR_EXIT("Conflicting options: -b and -t are mutually " "exclusive.\n"); if (!info->spool_class_specified) set_spool_class(info, "*", 1); @@ -1749,25 +1747,6 @@ static void ur_receive(struct vmur *info) } type = get_spoolfile_fmt(info, &sfdata[0]); - if (info->convert_specified) { - if (type != TYPE_VMDUMP) { - ERR("Reader file %s does not have VMDUMP format, " - "conversion not possible.\n", info->spoolid); - goto fail; - } else { - close(fhi); - if (info->stdout_specified) - rc = vmdump_convert(info->devnode, NULL, - prog_name); - else - rc = vmdump_convert(info->devnode, - info->file_name, prog_name); - if (rc) - goto fail; - else - goto vm_convert_done; - } - } if (type == TYPE_VMDUMP) ERR("INFO: Reader file %s has VMDUMP format.\n", info->spoolid); if (type == TYPE_NETDATA) @@ -1819,7 +1798,6 @@ static void ur_receive(struct vmur *info) if (fho != STDOUT_FILENO) close(fho); close(fhi); -vm_convert_done: if (info->hold_specified) close_reader(info, "HOLD"); else