Am 13.12.2013 um 18:10 hat Max Reitz geschrieben: > Allow specifying a reference to an existing block device (by name) for > bdrv_file_open() instead of a filename and/or options. > > Signed-off-by: Max Reitz <mre...@redhat.com>
> @@ -872,6 +873,24 @@ int bdrv_file_open(BlockDriverState **pbs, const char > *filename, > options = qdict_new(); > } > > + if (reference) { > + if (filename || qdict_size(options)) { > + error_setg(errp, "Cannot reference an existing block device with > " > + "additional options or a new filename"); > + return -EINVAL; > + } I suspect this could in fact be an assertion. Users shouldn't have any way to provoke a call with a reference _and_ options/filename set. Doesn't make the code less correct, of course, so: Reviewed-by: Kevin Wolf <kw...@redhat.com>