On 2018-03-13 15:47, Kevin Wolf wrote: > This adds the .bdrv_co_create driver callback to vhdx, which > enables image creation over QMP. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > qapi/block-core.json | 40 +++++++++- > block/vhdx.c | 216 > ++++++++++++++++++++++++++++++++++++++------------- > 2 files changed, 203 insertions(+), 53 deletions(-)
Reviewed-by: Max Reitz <mre...@redhat.com> > diff --git a/block/vhdx.c b/block/vhdx.c > index d82350d07c..f1b97f4b49 100644 > --- a/block/vhdx.c > +++ b/block/vhdx.c [...] > @@ -1792,59 +1797,71 @@ exit: > * .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------. > * 1MB > */ > -static int coroutine_fn vhdx_co_create_opts(const char *filename, QemuOpts > *opts, > - Error **errp) > +static int coroutine_fn vhdx_co_create(BlockdevCreateOptions *opts, > + Error **errp) > { [...] > /* These are pretty arbitrary, and mainly designed to keep the BAT > * size reasonable to load into RAM */ > - if (block_size == 0) { > + if (vhdx_opts->has_block_size) { > + block_size = vhdx_opts->block_size; > + } else { Ah, good. I have to admit I was a bit worried you'd keep the special meaning of cluster_size == 0. Max > if (image_size > 32 * TiB) { > block_size = 64 * MiB; > } else if (image_size > (uint64_t) 100 * GiB) {
signature.asc
Description: OpenPGP digital signature