qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] block: Additional info string in ImageInfo


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/3] block: Additional info string in ImageInfo and BDI
Date: Wed, 18 Sep 2013 16:59:18 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Sep 05, 2013 at 02:05:13PM +0200, Max Reitz wrote:
> diff --git a/block.c b/block.c
> index 26639e8..9fd9f3a 100644
> --- a/block.c
> +++ b/block.c
> @@ -1921,7 +1921,7 @@ void bdrv_round_to_clusters(BlockDriverState *bs,
>                              int64_t *cluster_sector_num,
>                              int *cluster_nb_sectors)
>  {
> -    BlockDriverInfo bdi;
> +    BlockDriverInfo bdi = { .info_string = NULL };
>  
>      if (bdrv_get_info(bs, &bdi) < 0 || bdi.cluster_size == 0) {
>          *cluster_sector_num = sector_num;
> @@ -1932,6 +1932,7 @@ void bdrv_round_to_clusters(BlockDriverState *bs,
>          *cluster_nb_sectors = QEMU_ALIGN_UP(sector_num - *cluster_sector_num 
> +
>                                              nb_sectors, c);
>      }
> +    g_free(bdi.info_string);
>  }

This function is called in the I/O path.  It's not appropriate to
generate an options string each time this gets called :).

Together with Eric's comments it seems like this change needs a
different interface that is QMP-friendly and not in the I/O path.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]