diff mbox series

[2/4] block: Mark 'block_resize' as coroutine

Message ID 20200109183545.27452-3-kwolf@redhat.com
State New
Headers show
Series qmp: Optionally run handlers in coroutines | expand

Commit Message

Kevin Wolf Jan. 9, 2020, 6:35 p.m. UTC
block_resize is safe to run in a coroutine, so use it as an example for
the new 'coroutine': true annotation in the QAPI schema.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 qapi/block-core.json | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stefan Hajnoczi Jan. 13, 2020, 4:56 p.m. UTC | #1
On Thu, Jan 09, 2020 at 07:35:43PM +0100, Kevin Wolf wrote:
> block_resize is safe to run in a coroutine, so use it as an example for
> the new 'coroutine': true annotation in the QAPI schema.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  qapi/block-core.json | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 7ff5e5edaf..1dbb2a9901 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -1341,7 +1341,8 @@
>  { 'command': 'block_resize',
>    'data': { '*device': 'str',
>              '*node-name': 'str',
> -            'size': 'int' } }
> +            'size': 'int' },
> +  'coroutine': true }
>  
>  ##
>  # @NewImageMode:

coroutine_fn is missing on
blockdev.c:void qmp_block_resize(bool has_device, const char *device,
Kevin Wolf Jan. 13, 2020, 5:10 p.m. UTC | #2
Am 13.01.2020 um 17:56 hat Stefan Hajnoczi geschrieben:
> On Thu, Jan 09, 2020 at 07:35:43PM +0100, Kevin Wolf wrote:
> > block_resize is safe to run in a coroutine, so use it as an example for
> > the new 'coroutine': true annotation in the QAPI schema.
> > 
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > ---
> >  qapi/block-core.json | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index 7ff5e5edaf..1dbb2a9901 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -1341,7 +1341,8 @@
> >  { 'command': 'block_resize',
> >    'data': { '*device': 'str',
> >              '*node-name': 'str',
> > -            'size': 'int' } }
> > +            'size': 'int' },
> > +  'coroutine': true }
> >  
> >  ##
> >  # @NewImageMode:
> 
> coroutine_fn is missing on
> blockdev.c:void qmp_block_resize(bool has_device, const char *device,

It wouldn't even be true until after patch 4. Should I reorder the
patches so I can add coroutine_fn?

Kevin
Stefan Hajnoczi Jan. 14, 2020, 4:30 p.m. UTC | #3
On Mon, Jan 13, 2020 at 06:10:09PM +0100, Kevin Wolf wrote:
> Am 13.01.2020 um 17:56 hat Stefan Hajnoczi geschrieben:
> > On Thu, Jan 09, 2020 at 07:35:43PM +0100, Kevin Wolf wrote:
> > > block_resize is safe to run in a coroutine, so use it as an example for
> > > the new 'coroutine': true annotation in the QAPI schema.
> > > 
> > > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > > ---
> > >  qapi/block-core.json | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > > index 7ff5e5edaf..1dbb2a9901 100644
> > > --- a/qapi/block-core.json
> > > +++ b/qapi/block-core.json
> > > @@ -1341,7 +1341,8 @@
> > >  { 'command': 'block_resize',
> > >    'data': { '*device': 'str',
> > >              '*node-name': 'str',
> > > -            'size': 'int' } }
> > > +            'size': 'int' },
> > > +  'coroutine': true }
> > >  
> > >  ##
> > >  # @NewImageMode:
> > 
> > coroutine_fn is missing on
> > blockdev.c:void qmp_block_resize(bool has_device, const char *device,
> 
> It wouldn't even be true until after patch 4. Should I reorder the
> patches so I can add coroutine_fn?

Yes, please.

Stefan
diff mbox series

Patch

diff --git a/qapi/block-core.json b/qapi/block-core.json
index 7ff5e5edaf..1dbb2a9901 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1341,7 +1341,8 @@ 
 { 'command': 'block_resize',
   'data': { '*device': 'str',
             '*node-name': 'str',
-            'size': 'int' } }
+            'size': 'int' },
+  'coroutine': true }
 
 ##
 # @NewImageMode: