On Mon, Apr 21, 2014 at 05:17:50PM -0600, Eric Blake wrote: > On 04/10/2014 11:54 AM, Chunyan Liu wrote: > > Change block layer to support both QemuOpts and QEMUOptionParameter. > > After this patch, it will change backend drivers one by one. At the end, > > QEMUOptionParameter will be removed and only QemuOpts is kept. > > > > Signed-off-by: Dong Xu Wang <wdon...@linux.vnet.ibm.com> > > Signed-off-by: Chunyan Liu <cy...@suse.com> > > --- > > > @@ -419,8 +420,27 @@ static void coroutine_fn bdrv_create_co_entry(void > > *opaque) > > > > CreateCo *cco = opaque; > > > + if (cco->drv->bdrv_create2) { > > + QemuOptsList *opts_list = NULL; > > + QemuOpts *opts = NULL; > > + if (!cco->opts) { > > Isn't your conversion pair-wise per driver, in that you always pair > bdrv_create2 with options, and bdrv_create with opts? That is, won't > cco->opts always be false if cco->drv->bdrv_create2 is non-NULL, since > we already guaranteed that there is at most one of the two creation > function callbacks defined? Maybe you have a missing assertion at the > point where the callbacks are registered? [1]
I think you're right but not sure it's worth changing since this is temporary code that gets removed later in the patch series anyway. Stefan