[libvirt] [PATCH v3 22/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/storage/*

Ján Tomko jtomko at redhat.com
Fri May 10 09:32:27 UTC 2013


On 05/03/2013 04:53 PM, Michal Privoznik wrote:
> ---
>  src/storage/parthelper.c               |  5 ++---
>  src/storage/storage_backend.c          | 22 ++++++----------------
>  src/storage/storage_backend_disk.c     | 26 +++++++-------------------
>  src/storage/storage_backend_fs.c       | 34 ++++++++++------------------------
>  src/storage/storage_backend_iscsi.c    | 17 ++++-------------
>  src/storage/storage_backend_logical.c  | 32 ++++++++++----------------------
>  src/storage/storage_backend_mpath.c    |  5 +----
>  src/storage/storage_backend_rbd.c      |  5 ++---
>  src/storage/storage_backend_scsi.c     | 19 +++++++------------
>  src/storage/storage_backend_sheepdog.c |  6 +-----
>  src/storage/storage_driver.c           | 18 ++++++------------
>  11 files changed, 56 insertions(+), 133 deletions(-)
> 

> diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
> index 316043f..aceb650 100644
> --- a/src/storage/storage_backend_logical.c
> +++ b/src/storage/storage_backend_logical.c
> @@ -358,13 +350,9 @@ virStorageBackendLogicalFindPoolSourcesFunc(virStoragePoolObjPtr pool ATTRIBUTE_
>      virStoragePoolSourceDevicePtr dev;
>      virStoragePoolSource *thisSource;
>  
> -    pvname = strdup(groups[0]);
> -    vgname = strdup(groups[1]);
> -
> -    if (pvname == NULL || vgname == NULL) {
> -        virReportOOMError();
> +    if (VIR_STRDUP(pvname, groups[0]) < 0 ||
> +        VIR_STRDUP(vgname, groups[1]) < 0)
>          goto err_no_memory;

err_no_memory should be renamed to error. But that's pre-existing.

> -    }
>  
>      thisSource = NULL;
>      for (i = 0 ; i < sourceList->nsources; i++) {

ACK

Jan




More information about the libvir-list mailing list