[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v6 01/22] block: Add flag bits for image locking
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH v6 01/22] block: Add flag bits for image locking |
Date: |
Fri, 17 Jun 2016 11:05:05 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 03.06.2016 um 10:48 hat Fam Zheng geschrieben:
> Later the block layer will automatically lock the images to avoid unexpected
> concurrent accesses to the same image, which will easily corrupt the metadata
> or user data, unless in some very special cases, like migration.
>
> The exceptional cases like shared storage migration and testing should
> set BDRV_O_SHARED_LOCK or BDRV_O_NO_LOCK to advise an appropriate
> locking mode.
>
> Signed-off-by: Fam Zheng <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
Worth asserting in bdrv_open_common() that BDRV_O_NO_LOCK and
BDRV_O_SHARED_LOCK aren't passed at the same time?
Kevin
> include/block/block.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/block/block.h b/include/block/block.h
> index 70ea299..02b598b 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -94,6 +94,8 @@ typedef struct HDGeometry {
> select an appropriate protocol driver,
> ignoring the format layer */
> #define BDRV_O_NO_IO 0x10000 /* don't initialize for I/O */
> +#define BDRV_O_NO_LOCK 0x20000 /* don't lock image file */
> +#define BDRV_O_SHARED_LOCK 0x40000 /* lock the image file in shared mode */
>
> #define BDRV_O_CACHE_MASK (BDRV_O_NOCACHE | BDRV_O_NO_FLUSH)
>
> --
> 2.8.2
>
[Qemu-block] [PATCH v6 03/22] blockdev: Add and parse "lock-mode" option for image locking, Fam Zheng, 2016/06/03
[Qemu-block] [PATCH v6 05/22] osdep: Add qemu_lock_fd and qemu_unlock_fd, Fam Zheng, 2016/06/03