.title VDDEASSGN .sbttl Deassigns Virtual Disk Driver from Disk File .ident /091588/ ; ;+ ;***** ; ; VDDEASSGN -- Performs all required operations to disassociate a ; virtual disk driver unit from the contiguous "container" file ; on a physical VMS volume. Input command syntax is ; similar to the "DEASSIGN" DCL command: ; ; VDDEASSGN VDan: ; ; where: ; VDan: = Valid device name of VDDRIVER unit to be disassociated ; from the container file. ; ;- ;***** ; ; Paul Sorenson ; AEP/Engineering Computer Support Center ; 1 Riverside Plaza ; Columbus, OH 43215 ; ;***** ; VD$IODEF ; define special VDDRIVER QIO functions .psect $LRWDATA,RD,WRT,NOEXE ; ASSIGN_LIST: $ASSIGN devnam=VD_DESC,- chan=VD_CHAN ; GET_FOREIGN_LIST: .long 4 ; # arguments .address IN_DESC ; input buffer descriptor .address P1_DESC ; 1st prompt string descriptor .address IN_SIZE ; place for output length .address PROMPT ; initial "force-prompt" value ; QIO_LIST: $QIO efn=0,- func=IO$_SETMODE!IO$M_VD_SHUTDOWN,- iosb=IOSB ; IN_SIZE: .long 0 IN_DESC: .long IN_BUF_LENGTH .address IN_BUF IN_BUF: .blkb 128 IN_BUF_LENGTH = .-IN_BUF ; IOSB: .BLKL 2 ; PROMPT: .long 0 P1_DESC: ; 1st command line parameter prompt .ascid /Device ? / ; VD_CHAN: ; channel # assigned to VDan: .blkl 1 VD_DESC: ; descriptor of virtual disk device .long 0 .address IN_BUF ; .psect $CODE,RD,WRT,EXE ; .page .sbttl ; ; .entry VD_DEASSIGN,^M<> ; ; *** Start by retrieving command line from the CLI prompting for ; required input. ; 1$: CALLG GET_FOREIGN_LIST,G^LIB$GET_FOREIGN CMPL R0,#RMS$_EOF ; end-of-file ?? BEQL EXIT ; branch if yes ;* BNEQ 5$ ; branch if not, continue ;* BRW EXIT ; else, exit ;*5$: MOVL IN_SIZE,R0 ; recover size of string MOVL IN_DESC+4,R1 ; and start address MOVL #1,PROMPT ; force prompting from here on SKPC #^A/ /,R0,(R1) ; skip leading spaces BEQL 1$ ; prompt again if null MOVL R1,VD_DESC+4 ; set start address of "VDan:" string LOCC #^A/ /,R0,(R1) ; find next space or end-of-string SUBL3 VD_DESC+4,R1,VD_DESC ; set length of string ; ; *** Assign channel to VDDRIVER and then issue IO$_SETMODE!IO$M_VD_SHUTDOWN ; to VDDRIVER to disassociate the device from the container file. ; $ASSIGN_G ASSIGN_LIST ; assign channel to VDDRIVER BLBC R0,ERROR ; branch on error MOVZWL VD_CHAN,QIO_LIST+QIO$_CHAN ; copy channel number to QIO list $QIOW_G QIO_LIST ; issue "shutdown" request to VDDRIVER BLBC R0,ERROR ; branch on error MOVZWL IOSB,R0 ; pickup I/O status BLBS R0,EXIT ; branch on success, all done ERROR: PUSHL R0 ; setup error status CALLS #1,G^LIB$SIGNAL ; signal the condition EXIT: $EXIT_S ; .end VD_DEASSIGN