Re: [PATCH v1 08/37] Adapt to VIR_ALLOC and virAsprintf in src/esx/*

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

 



On 07/04/2013 02:06 PM, Michal Privoznik wrote:
> ---
>  src/esx/esx_driver.c                | 62 ++++++++---------------------
>  src/esx/esx_network_driver.c        | 16 ++------
>  src/esx/esx_storage_backend_iscsi.c |  4 +-
>  src/esx/esx_storage_backend_vmfs.c  | 78 +++++++++----------------------------
>  src/esx/esx_util.c                  |  4 +-
>  src/esx/esx_vi.c                    | 50 +++++++-----------------
>  src/esx/esx_vi.h                    |  3 +-
>  src/esx/esx_vi_types.c              |  3 +-
>  8 files changed, 60 insertions(+), 160 deletions(-)
> 

> @@ -614,10 +612,8 @@ esxStoragePoolListVolumes(virStoragePoolPtr pool, char **const names,
>                  if (VIR_STRDUP(names[count], fileInfo->path) < 0)
>                      goto cleanup;
>              } else if (virAsprintf(&names[count], "%s/%s", directoryAndFileName,
> -                                   fileInfo->path) < 0) {
> -                virReportOOMError();
> +                                   fileInfo->path) < 0)
>                  goto cleanup;
> -            }

Leave the braces since the 'if' branch has them too.

>  
>              ++count;
>          }

> @@ -788,16 +782,12 @@ esxStorageVolLookupByKey(virConnectPtr conn, const char *key)
>                          goto cleanup;
>                  } else if (virAsprintf(&volumeName, "%s/%s",
>                                         directoryAndFileName,
> -                                       fileInfo->path) < 0) {
> -                    virReportOOMError();
> +                                       fileInfo->path) < 0)
>                      goto cleanup;
> -                }

Same here.

>  
>                  if (virAsprintf(&datastorePath, "[%s] %s", datastoreName,
> -                                volumeName) < 0) {
> -                    virReportOOMError();
> +                                volumeName) < 0)
>                      goto cleanup;
> -                }
>  
>                  if (esxVI_VmDiskFileInfo_DynamicCast(fileInfo) == NULL) {
>                      /* Only a VirtualDisk has a UUID */

ACK

Jan

--
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]