diff mbox

[v7,02/20] qapi: Add lock-mode in blockdev-add options

Message ID 1470662013-19785-3-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng Aug. 8, 2016, 1:13 p.m. UTC
To allow overriding the default locking behavior when opening the image.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 qapi/block-core.json | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Comments

Kevin Wolf Sept. 6, 2016, 4:18 p.m. UTC | #1
Am 08.08.2016 um 15:13 hat Fam Zheng geschrieben:
> To allow overriding the default locking behavior when opening the image.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  qapi/block-core.json | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 5e2d7d7..d1eb197 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -2151,6 +2151,20 @@
>              '*debug-level': 'int' } }
>  
>  ##
> +# @BlockdevLockMode
> +#
> +# Describes how QEMU should lock the image.
> +#
> +# @off:       Disabled
> +# @shared:    Use shared lock for both RO and RW images.
> +# @auto:      Use exclusive lock for RW images, and shared lock for RO images.
> +#
> +# Since: 2.7
> +##
> +{ 'enum': 'BlockdevLockMode',
> +  'data': [ 'off', 'shared', 'auto' ] }

You decided to drop 'exclusive'? Didn't we agree last time that we
should have both a real 'exclusive' and 'auto'?

Kevin
Fam Zheng Sept. 7, 2016, 2:19 a.m. UTC | #2
On Tue, 09/06 18:18, Kevin Wolf wrote:
> Am 08.08.2016 um 15:13 hat Fam Zheng geschrieben:
> > To allow overriding the default locking behavior when opening the image.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  qapi/block-core.json | 19 ++++++++++++++++++-
> >  1 file changed, 18 insertions(+), 1 deletion(-)
> > 
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index 5e2d7d7..d1eb197 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -2151,6 +2151,20 @@
> >              '*debug-level': 'int' } }
> >  
> >  ##
> > +# @BlockdevLockMode
> > +#
> > +# Describes how QEMU should lock the image.
> > +#
> > +# @off:       Disabled
> > +# @shared:    Use shared lock for both RO and RW images.
> > +# @auto:      Use exclusive lock for RW images, and shared lock for RO images.
> > +#
> > +# Since: 2.7
> > +##
> > +{ 'enum': 'BlockdevLockMode',
> > +  'data': [ 'off', 'shared', 'auto' ] }
> 
> You decided to drop 'exclusive'? Didn't we agree last time that we
> should have both a real 'exclusive' and 'auto'?

I must have misunderstood it. I can add exclusive back.

Fam
Eric Blake Sept. 22, 2016, 2:58 p.m. UTC | #3
On 08/08/2016 08:13 AM, Fam Zheng wrote:
> To allow overriding the default locking behavior when opening the image.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  qapi/block-core.json | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 5e2d7d7..d1eb197 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -2151,6 +2151,20 @@
>              '*debug-level': 'int' } }
>  
>  ##
> +# @BlockdevLockMode
> +#
> +# Describes how QEMU should lock the image.
> +#
> +# @off:       Disabled
> +# @shared:    Use shared lock for both RO and RW images.
> +# @auto:      Use exclusive lock for RW images, and shared lock for RO images.
> +#
> +# Since: 2.7

Just a reminder to update this to 2.8 (probably throughout the series).

> @@ -2185,7 +2201,8 @@
>              '*cache': 'BlockdevCacheOptions',
>              '*aio': 'BlockdevAioOptions',
>              '*read-only': 'bool',
> -            '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
> +            '*detect-zeroes': 'BlockdevDetectZeroesOptions',
> +            '*lock-mode': 'BlockdevLockMode' },
>    'discriminator': 'driver',
>    'data': {
>        'archipelago':'BlockdevOptionsArchipelago',
> 

Will this need (yet another) rebase on top of Kevin's blockdev-add work?
Fam Zheng Sept. 23, 2016, 4:01 a.m. UTC | #4
On Thu, 09/22 09:58, Eric Blake wrote:
> On 08/08/2016 08:13 AM, Fam Zheng wrote:
> > To allow overriding the default locking behavior when opening the image.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  qapi/block-core.json | 19 ++++++++++++++++++-
> >  1 file changed, 18 insertions(+), 1 deletion(-)
> > 
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index 5e2d7d7..d1eb197 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -2151,6 +2151,20 @@
> >              '*debug-level': 'int' } }
> >  
> >  ##
> > +# @BlockdevLockMode
> > +#
> > +# Describes how QEMU should lock the image.
> > +#
> > +# @off:       Disabled
> > +# @shared:    Use shared lock for both RO and RW images.
> > +# @auto:      Use exclusive lock for RW images, and shared lock for RO images.
> > +#
> > +# Since: 2.7
> 
> Just a reminder to update this to 2.8 (probably throughout the series).

Good point, thanks!

> 
> > @@ -2185,7 +2201,8 @@
> >              '*cache': 'BlockdevCacheOptions',
> >              '*aio': 'BlockdevAioOptions',
> >              '*read-only': 'bool',
> > -            '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
> > +            '*detect-zeroes': 'BlockdevDetectZeroesOptions',
> > +            '*lock-mode': 'BlockdevLockMode' },
> >    'discriminator': 'driver',
> >    'data': {
> >        'archipelago':'BlockdevOptionsArchipelago',
> > 
> 
> Will this need (yet another) rebase on top of Kevin's blockdev-add work?

Yes, I think so..

Fam
diff mbox

Patch

diff --git a/qapi/block-core.json b/qapi/block-core.json
index 5e2d7d7..d1eb197 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2151,6 +2151,20 @@ 
             '*debug-level': 'int' } }
 
 ##
+# @BlockdevLockMode
+#
+# Describes how QEMU should lock the image.
+#
+# @off:       Disabled
+# @shared:    Use shared lock for both RO and RW images.
+# @auto:      Use exclusive lock for RW images, and shared lock for RO images.
+#
+# Since: 2.7
+##
+{ 'enum': 'BlockdevLockMode',
+  'data': [ 'off', 'shared', 'auto' ] }
+
+##
 # @BlockdevOptions
 #
 # Options for creating a block device.  Many options are available for all
@@ -2172,6 +2186,8 @@ 
 # @detect-zeroes: #optional detect and optimize zero writes (Since 2.1)
 #                 (default: off)
 #
+# @lock-mode: #optional how to lock the image. (default: auto) (Since 2.7)
+#
 # Remaining options are determined by the block driver.
 #
 # Since: 1.7
@@ -2185,7 +2201,8 @@ 
             '*cache': 'BlockdevCacheOptions',
             '*aio': 'BlockdevAioOptions',
             '*read-only': 'bool',
-            '*detect-zeroes': 'BlockdevDetectZeroesOptions' },
+            '*detect-zeroes': 'BlockdevDetectZeroesOptions',
+            '*lock-mode': 'BlockdevLockMode' },
   'discriminator': 'driver',
   'data': {
       'archipelago':'BlockdevOptionsArchipelago',