27.12.2012 Views

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

*| parm 1: source |*/<br />

/*| parm 2: target |*/<br />

/*| parm 3: label |*/<br />

/*+------------------------------------------------------------------+*/<br />

arg dasd<br />

/* create a list of reserved dasd - this is somewhat hokey to be sure<br />

but it's better to be hokey than to <strong>for</strong>mat system minidisks! */<br />

resvd1 = "0122 0123 0124 0125 0190 0191 0193 0194 019D 019E 0201 02A2"<br />

resvd2 = "02A4 02A6 02C2 02C4 02CC 02D2 0319 03A2 03A4 03A6 03B2 03C2"<br />

resvd3 = "03C4 03D2 0400 0401 0402 0405 0490 0493 049B 049E 04A2 04A4"<br />

resvd4 = "04A6 04B2 04C2 04C4 04D2 0500 051D 05A2 05A4 05A6 05B2 05C2"<br />

resvd5 = "05C4 05D2 05E5 05E6 06A2 06A4 06A6 06B2 06C2 06C4 06D2 07A2"<br />

resvd6 = "07A4 07A6 07B2 07C2 07C4 07D2 0CF1 0CF2 0CF3"<br />

reserved = resvd1 resvd2 resvd3 resvd4 resvd5 resvd6<br />

if (index(reserved, dasd) 0) then /* MAINT minidisk - ABORT! */<br />

do<br />

say 'Minidisk' dasd 'is a reserved MAINT minidisk'<br />

say 'This must be <strong>for</strong>matted manually using a different vaddr'<br />

exit 4<br />

end /* if dasd is reserved */<br />

return /* from checkReserved */<br />

/*+------------------------------------------------------------------+*/<br />

doReport: procedure expose dasds <strong>for</strong>matted<br />

/*| Report on the newly labelled DASD |*/<br />

/*| parm 1: <strong>for</strong>matSuccess - 0=all is well, non-0= a <strong>for</strong>mat failed |*/<br />

/*| retVal: 0 = success |*/<br />

/*+------------------------------------------------------------------+*/<br />

arg <strong>for</strong>matSuccess<br />

if (<strong>for</strong>matSuccess ^= 0) then<br />

say 'Error was encountered! retVal from CPFMTXA =' <strong>for</strong>matSuccess<br />

if (<strong>for</strong>matted = '') then<br />

say "No DASD were successfully <strong>for</strong>matted"<br />

else<br />

say "DASD successfully <strong>for</strong>matted:" <strong>for</strong>matted<br />

'DETACH' dasds<br />

'ATTACH' dasds '*'<br />

say ''<br />

say 'DASD status after:'<br />

'CP Q MDISK' dasds 'LOCATION'<br />

return 0 /* from doReport */<br />

/*+------------------------------------------------------------------+*/<br />

<strong>for</strong>matOne: procedure<br />

/*| Format a DASD via DDR |*/<br />

/*| parm 1: disk - the vaddr to be <strong>for</strong>matted |*/<br />

/*| parm 2: type - PAGE, SPOL or PERM |*/<br />

/*| parm 3: label - the six character label |*/<br />

/*+------------------------------------------------------------------+*/<br />

arg disk type label<br />

queue 'FORMAT'<br />

queue disk<br />

queue '0 END'<br />

queue label<br />

queue 'YES'<br />

queue type '0 END'<br />

queue 'END'<br />

'CPFMTXA'<br />

retVal = rc<br />

Appendix B. Source code 247

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!