Re: [PATCH 11/11] storage_scsi: Allow the omitted 'unique_id'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/07/2013 01:03 PM, Osier Yang wrote:
> ---
>  src/storage/storage_backend_scsi.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
> index 5635f73..da6a5dd 100644
> --- a/src/storage/storage_backend_scsi.c
> +++ b/src/storage/storage_backend_scsi.c
> @@ -760,18 +760,14 @@ getAdapterName(virStoragePoolSourceAdapter adapter)
>  
>      if (adapter.type != VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST) {
>          if (adapter.data.scsi_host.parent) {
> -            if (!adapter.data.scsi_host.has_unique_id) {
> -                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> -                               _("'unique_id' is not specified for "
> -                                 "scsi_host adapter"));
> +            if (!(addr = getScsiHostParentAddress(adapter.data.scsi_host.parent)))

I don't understand the code churn that takes place for getAdapterName -
is it really required to make the change in 7/11 especially since you're
just undoing it here?  That is between patches 7-10 if getAdapterName()
didn't support the parent fields, would it matter?


>                  return NULL;
> -            } else {
> -                if (!(addr = getScsiHostParentAddress(adapter.data.scsi_host.parent)))
> -                    return NULL;
>  
> +            if (!adapter.data.scsi_host.has_unique_id)
> +                name = virGuessStableScsiHostName(NULL, addr);
> +            else
>                  name = virParseStableScsiHostAddress(NULL, addr,
>                                                       adapter.data.scsi_host.unique_id);

Still need to VIR_FREE(addr);

John
> -            }
>          } else if (adapter.data.scsi_host.name) {
>              if (VIR_STRDUP(name, adapter.data.scsi_host.name) < 0)
>                  return NULL;
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]