Re: [PATCH 06/15] storage file: add qcow2 data-file path parsing from header

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

 



On Wed, Nov 20, 2024 at 18:48:41 +0300, Nikolai Barybin via Devel wrote:
> In qcow2 header data file is represented by incompitible feature bit
> and its path is saved to header extension table.
> Thus, we implement here the logic similar to backing file probing.
> 
> Signed-off-by: Nikolai Barybin <nikolai.barybin@xxxxxxxxxxxxx>
> ---
>  src/storage_file/storage_file_probe.c | 46 ++++++++++++++++++++++++---
>  1 file changed, 42 insertions(+), 4 deletions(-)

[...]

> +static int
> +qcow2GetDataFile(char **res,
> +                 virBitmap *features,
> +                 char *buf,
> +                 size_t buf_size)
> +{
> +    *res = NULL;
> +
> +    if (buf_size < QCOW2v3_HDR_FEATURES_INCOMPATIBLE + 8)
> +        return 0;
> +
> +    if (features && virBitmapIsBitSet(features, VIR_STORAGE_FILE_FEATURE_DATA_FILE)) {
> +        if (qcow2GetExtensions(buf, buf_size, NULL, res) < 0)
> +            return 0;

This should be 'return -1'

> +    }
> +
> +    return 0;
> +}
> +
> +
>  static int
>  vmdk4GetBackingStore(char **res,
>                       int *format,

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>



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

  Powered by Linux