Re: [libvirt] [PATCH] storage_driver.c: remove two useless calls to virStorageBackendForType

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

 



On Fri, Sep 04, 2009 at 07:04:57PM +0200, Jim Meyering wrote:
> Daniel Veillard wrote:
> >   Hum ... I'm afraid it changes the semantic. If
> >   virStorageBackendForType fails because def->type is not one of the
> >   registered type for storage backend.
> 
> Oh!  of course.  Glad you're alert.
> Here's the corrected patch:
> 
> >From b9821214789025ca9621b2651d326e261a0d14aa Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@xxxxxxxxxx>
> Date: Fri, 4 Sep 2009 17:18:29 +0200
> Subject: [PATCH] storage_driver.c: remove two dead stores to "backend"
> 
> * src/storage_driver.c (storagePoolGetInfo, storagePoolDefine):
> Remove variable, backend, since its value was never used.
> ---
>  src/storage_driver.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/storage_driver.c b/src/storage_driver.c
> index e9ecb20..a14bb88 100644
> --- a/src/storage_driver.c
> +++ b/src/storage_driver.c
> @@ -519,13 +519,12 @@ storagePoolDefine(virConnectPtr conn,
>      virStoragePoolDefPtr def;
>      virStoragePoolObjPtr pool = NULL;
>      virStoragePoolPtr ret = NULL;
> -    virStorageBackendPtr backend;
> 
>      storageDriverLock(driver);
>      if (!(def = virStoragePoolDefParseString(conn, xml)))
>          goto cleanup;
> 
> -    if ((backend = virStorageBackendForType(def->type)) == NULL)
> +    if (virStorageBackendForType(def->type) == NULL)
>          goto cleanup;
> 
>      if (!(pool = virStoragePoolObjAssignDef(conn, &driver->pools, def)))
> @@ -847,7 +846,6 @@ storagePoolGetInfo(virStoragePoolPtr obj,
>                     virStoragePoolInfoPtr info) {
>      virStorageDriverStatePtr driver = obj->conn->storagePrivateData;
>      virStoragePoolObjPtr pool;
> -    virStorageBackendPtr backend;
>      int ret = -1;
> 
>      storageDriverLock(driver);
> @@ -860,7 +858,7 @@ storagePoolGetInfo(virStoragePoolPtr obj,
>          goto cleanup;
>      }
> 
> -    if ((backend = virStorageBackendForType(pool->def->type)) == NULL)
> +    if (virStorageBackendForType(pool->def->type) == NULL)
>          goto cleanup;
> 
>      memset(info, 0, sizeof(virStoragePoolInfo));

  Just fine, ACK :-)

   thanks !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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