qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 2/3] block: tell drivers about an image resize
Date: Fri, 21 Jan 2011 11:41:16 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10

Am 19.01.2011 18:02, schrieb Christoph Hellwig:
> Extend the change_cb callback with a reason argument, and use it
> to tell drivers about size changes.
> 
> Signed-off-by: Christoph Hellwig <address@hidden>
> 
> Index: qemu/block.c
> ===================================================================
> --- qemu.orig/block.c 2011-01-18 20:54:45.246021572 +0100
> +++ qemu/block.c      2011-01-18 20:56:54.117255612 +0100
> @@ -645,7 +645,7 @@ int bdrv_open(BlockDriverState *bs, cons
>          /* call the change callback */
>          bs->media_changed = 1;
>          if (bs->change_cb)
> -            bs->change_cb(bs->change_opaque);
> +            bs->change_cb(bs->change_opaque, CHANGE_MEDIA);
>      }
>  
>      return 0;
> @@ -684,7 +684,7 @@ void bdrv_close(BlockDriverState *bs)
>          /* call the change callback */
>          bs->media_changed = 1;
>          if (bs->change_cb)
> -            bs->change_cb(bs->change_opaque);
> +            bs->change_cb(bs->change_opaque, CHANGE_MEDIA);
>      }
>  }
>  
> @@ -1135,6 +1135,8 @@ int bdrv_truncate(BlockDriverState *bs,
>      ret = drv->bdrv_truncate(bs, offset);
>      if (ret == 0) {
>          ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);
> +        if (bs->change_cb)
> +            bs->change_cb(bs->change_opaque, CHANGE_SIZE);

Braces are missing here.

Apart from that and Stefan's s/id/device/ the series looks good to me.

Kevin



reply via email to

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