Hi Jason,
Jason Zhao wrote: > Hi, Jan and William > > You are enjoying a very good new year holiday, aren't you? > Wish you happy new year. :) > Thank you :-) > I am developing the test cases for libtd, and here I met with > some questions about disk discovery cases. > 1. about mtype attribute > As I remember, in dwarf caiman project, libtd could find media > type of each disks, but it only could discover "FIXED" one. Does > it have any changes for OpenSolaris(i.e., could it find some devices > which media type is not "FIXED"?). There are no changes in libtd with respect to this behavior in OpenSolaris. libtd itself doesn't filter out disks with 'mtype' other than 'FIXED' - those are excluded later in orchestrator: http://src.opensolaris.org/source/xref/caiman/slim_source/usr/src/lib/liborchestrator/target_discovery.c#432 > Besides "FIXED", are there any > other types "media type"? Yes, for full list of supported values which can be assigned to 'mtype' see http://src.opensolaris.org/source/xref/caiman/slim_source/usr/src/lib/libtd/td_api.h#99 > Following example is I tried on > OpenSolaris x86 box. > # test_td -d -v > Disk discovery > Total number of disks: 3 > ------------------------------------------------------------------------------- > num | name| vendor| ctype| mtype| rem| lbl| bsize|#of blocks|size [MB]| > ------------------------------------------------------------------------------- > 1 | c1t0d0| Netac| usb| FIXED| Yes| F| 512| 3904768| 1906| > 2 |* c4d0| unknown| ata| FIXED| No| VF| 512| 312576768| 152625| > 3 | swap| unknown|unknown| UNKN| No| GF| 512| 1048576| 512| > ------------------------------------------------------------------------------- > > > 2. About removable attribute > As it can be seen from above example that removable > attribute is largely connected to the disk type(e.g., > usb or CDROM). How can I get if a device is removable? > Through "rmformat"? It seems that there are mismatch > between the output of "libtd" and the output of "rmformat" > command. > libtd takes 'removable' attribute from libdiskmgt - looking at the implementation, among other things libdiskmgt takes a look at 'removable-media' property in device tree. If this property is set, libdiskmgt reports media as removable - please see following source code for implementation details and other cases when libdiskmgt considers media to be removable (ZIP, JAZ, ...): http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdiskmgt/common/findevs.c Based on this, you could check output of 'prtconf -v' for determining if device is considered as removable by libdiskmgt (and libtd) - if appropriate disk has 'removable-media' property defined, libtd should report it as removable. > # test_td -d -v > Disk discovery > Total number of disks: 3 > ------------------------------------------------------------------------------- > num | name| vendor| ctype| mtype| rem| lbl| bsize|#of blocks|size [MB]| > ------------------------------------------------------------------------------- > 1 | c1t0d0| IC25N040| usb| FIXED| No| F| 512| 78140160| 38154| <-- not > removable > 2 |* c4d0| unknown| ata| FIXED| No| VF| 512| 312576768| 152625| > 3 | swap| unknown|unknown| UNKN| No| GF| 512| 1048576| 512| > ------------------------------------------------------------------------------- > # rmformat > Looking for devices... > 1. Logical Node: /dev/rdsk/c1t0d0p0 > Physical Node: /pci at 0,0/pci17aa,20ab at 1d,7/storage at 1/disk at 0,0 > Connected Device: IC25N040 ATMR04-0 0811 > Device Type: Removable <------ removable from rmformat. > Bus: USB > Size: 38.2 GB > Label: <Unknown> > Access permissions: Medium is not write protected. > ...... > > > 3. From the design document v0.10, it seems like the > libtd library could print out the disk status(up/down). > But current test_td driver could not print out the > status attribute. Does the "status" attribute still > work? > TD_DISK_ATTR_STATUS attribute is currently not reported by libtd. I will remove reference to it from the design specification. Thank you for catching this. > If yes, what does it mean and how can I verify the > attribute? > > 4. When I insert a CD into my DVD Drive, it seems > like the test_td could not discover it as *CDROM*. > Is it OK? Yes, that is correct, CD/DVD and floppy drives are filtered out and excluded from list of valid targets by libtd: http://src.opensolaris.org/source/xref/caiman/slim_source/usr/src/lib/libtd/td_dd.c#1100 Thank you, Jan > I attach the output of my "prtconf -D -v". > As following example. > # mount | grep media > /media/Nokia N95 on /dev/dsk/c5t0d0s2 ...... <---- my CDROM > # test_td -d -v > Disk discovery > Total number of disks: 3 > ------------------------------------------------------------------------------- > num | name| vendor| ctype| mtype| rem| lbl| bsize|#of blocks|size [MB]| > ------------------------------------------------------------------------------- > 1 | c1t0d0| Netac| usb| FIXED| Yes| F| 512| 3904768| 1906| > 2 |* c4d0| unknown| ata| FIXED| No| VF| 512| 312576768| 152625| > 3 | swap| unknown|unknown| UNKN| No| GF| 512| 1048576| 512| > ------------------------------------------------------------------------------- > > > Thanks > Jason > > >
