On 01/11/2018 01:52 PM, Kevin Wolf wrote: > This adds a synchronous x-blockdev-create QMP command that can create > qcow2 images on a given node name. > > We don't want to block while creating an image, so this is not the final > interface in all aspects, but BlockdevCreateOptionsQcow2 and > .bdrv_co_create() are what they actually might look like in the end. In > any case, this should be good enough to test whether we interpret > BlockdevCreateOptions as we should. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > qapi/block-core.json | 12 ++++++++++++ > include/block/block_int.h | 2 ++ > block.c | 48 > +++++++++++++++++++++++++++++++++++++++++++++++ > block/qcow2.c | 3 ++- > 4 files changed, 64 insertions(+), 1 deletion(-) > > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 9341f6708d..93357a4d5d 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -3415,6 +3415,18 @@ > } } > > ## > +# @x-blockdev-create: > +# > +# Create an image format on a given node. > +# TODO Replace with something asynchronous (block job?) > +# > +# Since: 2.12 > +## > +{ 'command': 'x-blockdev-create', > + 'data': 'BlockdevCreateOptions', > + 'boxed': true } > +
So simple, compared to all the prep work in earlier patches ;) I like the approach. As you say, there's still more work before we can remove the x- prefix, but I think you're headed on a good track. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature