On 09/25/2015 12:17 AM, Wen Congyang wrote: > For block replication, we have such backing chain: > secondary disk <-- hidden disk <-- active disk > secondary disk is top BDS(use bacing reference), so it can be opened in
s/BDS(use bacing/BDS (use backing/ > read-write mode. But hidden disk is read only, and we need to write to > hidden disk(backup job will write data to it). s/disk(/disk (/ > > TODO: support opening backing file in read-write mode if the BDS is > created by QMP command blockdev-add. > > Signed-off-by: Wen Congyang <we...@cn.fujitsu.com> > Signed-off-by: zhanghailiang <zhang.zhanghaili...@huawei.com> > Signed-off-by: Gonglei <arei.gong...@huawei.com> > --- > block.c | 41 ++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 40 insertions(+), 1 deletion(-) > I really don't like this patch. We are able to automatically (re-)open backing files for write during block-commit, without having to expose a knob to the user then, so exposing a knob to the user here feels wrong. > +#define ALLOW_WRITE_BACKING_FILE "allow-write-backing-file" > +static QemuOptsList backing_file_opts = { > + .name = "backing_file", > + .head = QTAILQ_HEAD_INITIALIZER(backing_file_opts.head), > + .desc = { > + { > + .name = ALLOW_WRITE_BACKING_FILE, > + .type = QEMU_OPT_BOOL, > + .help = "allow writes to backing file", > + }, And even if we DO need this knob (which I doubt), you need corresponding documentation of the knob in qapi/block-core.json, since we are trying to keep the command line and QMP in sync when it comes to adding new options. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature