Re: [PATCH v2 2/4] storage: move block format lookup to shared UpdateVolInfo

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

 



On 03/31/2014 12:50 PM, Cole Robinson wrote:
> ---

Commit message is a bit sparse - it says what but not why.  But looking
at the patch, it looks like the goal was to refactor code that copied
and pasted block format lookup after getting volinfo to instead have
volinfo get everything up front.

>  src/storage/storage_backend.c         | 175 ++++++++++++++++++----------------
>  src/storage/storage_backend.h         |   4 +-
>  src/storage/storage_backend_disk.c    |   2 +-
>  src/storage/storage_backend_fs.c      |   4 +-
>  src/storage/storage_backend_logical.c |   2 +-
>  src/storage/storage_backend_mpath.c   |  36 +------
>  src/storage/storage_backend_scsi.c    |  39 +-------
>  7 files changed, 103 insertions(+), 159 deletions(-)
> 
> diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> index 7795b33..78644f6 100644
> --- a/src/storage/storage_backend.c
> +++ b/src/storage/storage_backend.c
> @@ -1198,6 +1198,80 @@ virStorageFileBackendForType(int type,
>  }
>  
>  
> +struct diskType {
> +    int part_table_type;
> +    unsigned short offset;

So this hunk is code motion;


> @@ -1316,22 +1390,30 @@ int
>  virStorageBackendUpdateVolTargetInfo(virStorageVolTargetPtr target,
>                                       unsigned long long *allocation,
>                                       unsigned long long *capacity,
> +                                     bool withBlockVolFormat,

This hunk adds a new parameter that controls the use of the consolidated
code...

> +++ b/src/storage/storage_backend_disk.c
> @@ -113,7 +113,7 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool,
>      }
>  
>      /* Refresh allocation/capacity/perms */
> -    if (virStorageBackendUpdateVolInfo(vol, true,
> +    if (virStorageBackendUpdateVolInfo(vol, true, false,

...most callers don't need the block lookup

> +++ b/src/storage/storage_backend_mpath.c
> @@ -42,37 +42,6 @@
>  VIR_LOG_INIT("storage.storage_backend_mpath");
>  
>  static int
> -virStorageBackendMpathUpdateVolTargetInfo(virStorageVolTargetPtr target,
> -                                          unsigned long long *allocation,
> -                                          unsigned long long *capacity)
> -{

and those that did now get it from the common function.

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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