Hi Alex,

the fix looks good with respect to the overall approach taken
and the chosen scope at this point, I have only couple of
comments/nits related to the implementation - please see below.

Also, could you please updated bug with this information
(chosen solution and scope) and put it into at least
FIXUNDERSTOOD state ?

Thank you,
Jan


ti_api.h
--------
77 - this new milestone should not be added - it is only used
     in scenario where TI target is determined implicitly
     (TI_ATTR_TARGET_TYPE attribute is not specified) which
     is not the case here - TI_ATTR_TARGET_TYPE has to be set
     to TI_TARGET_TYPE_DISK_LABEL.

ti_dm.c
-------

nit:
1479          * Obtain disk name. It can be provided by TI_ATTR_LABEL_DISK_NAME
->
1479          * Obtain disk name. It is provided by TI_ATTR_LABEL_DISK_NAME

 
...
1504                 if (errno == ENOTSUP) {
1505 
1506                     /* EFI label */
...
Just checking - is this check reliable ?


1521-1524 - since we know at this point disk already has SMI label,
   should we proceed with 'format' or could we just return
   with success ?




Alexander Eremin wrote:
> Please review the following for 3136 - TI fails to create VTOC on
> unlabeled disk on Sparc
>
> Created new TI target - disk label. This time Sparc only supported and
> SMI labeling as default.
>
> Tests:
> #./test_ti_static 
> usage: test_ti [-h] [-x 0-3] [-c] [-t target_type] ... [-R]
>   -h                print this help
>   -x [0-3]          set debug level (0=emerg, 3=info)
>   -c                commit changes - switch off dry run
>   -t target_type    specify target type: f=fdisk, x=disk label, v=vtoc,
> b=BE, p|P=ZFS pool, m=ZFS filesystem, l=ZFS volume, r=ramdisk,
> d=directory
>  fdisk options (select fdisk type: option "-t f")
>   -w                Solaris2 partition created on whole disk
>   -f file           create fdisk partition table from file
>   -d disk_name      disk name - e.g c1t0d0
>  disk label options (select disk label type: option "-t x")
>   -d disk_name      disk name - e.g c1t0d0
>  VTOC options (select VTOC type: option "-t v")
> ....
>
>
> #./test_ti_static -c -x 3 -t x -d c0t3d0     
> Test TI started in real mode...
> Target type specified: disk label
> disk label target prepared successfully
> disk label target created successfully
> #
>
> Disk c0t3d0 was unlabeled before:
>
> <TIMM_I Oct 21 06:07:52> Target type to be created: DISK_LABEL
> <TIDM_I Oct 21 06:07:52> Disk c0t3d0 is unlabeled
> <TIDM_I Oct 21 06:07:52> format: Creating SMI label for c0t3d0
> <TIDM_I Oct 21 06:07:52> dm cmd: printf 'label
> y
> q
> '| /usr/sbin/format -d c0t3d0 2>&1 1>/dev/null
>
> Disk c0t3d0 was labeled as EFI before:
>
> <TIMM_I Oct 21 06:08:43> Target type to be created: DISK_LABEL
> <TIDM_I Oct 21 06:08:43> Disk c0t3d0 has an EFI label
> <TIDM_I Oct 21 06:08:43> format: Creating SMI label for c0t3d0
> <TIDM_I Oct 21 06:08:43> dm cmd: printf 'label
> 0
>
>
> q
> '| /usr/sbin/format -e  -d  c0t3d0 2>&1 1>/dev/null
>
>
>
>
> webrev: http://cr.opensolaris.org/~alhazred/3136/
>


Reply via email to