On 05/30/2014 02:37 AM, Peter Krempa wrote:
Introduce flag for the block rebase API to allow the rebase operation
to
leave the chain relatively addressed. Also adds a virsh switch to enable
this behavior.
---
include/libvirt/libvirt.h.in | 2 ++
tools/virsh-domain.c | 22 +++++++++++++++++++---
tools/virsh.pod | 4 ++++
3 files changed, 25 insertions(+), 3 deletions(-)
Again, missing doc changes in libvirt.c mentioning the flag.
- else
+ if (base) {
+ if (vshCommandOptBool(cmd, "keep-relative"))
+ flags |= VIR_DOMAIN_BLOCK_REBASE_RELATIVE;
Why not parse this flag unconditionally, to check that the code has a
sane error path if the flag is present but base was not specified? In
other words, filtering at the virsh level is too high when it comes to
validating lower levels.
+ {.name = "keep-relative",
+ .type = VSH_OT_BOOL,
+ .help = N_("keep the backing chain relative if it was relatively "
+ "referenced if it was before")
s/if it was before/before/
@@ -2091,6 +2100,13 @@ cmdBlockPull(vshControl *ctl, const vshCmd
*cmd)
bool quit = false;
int abort_flags = 0;
+ if (vshCommandOptBool(cmd, "keep-relative") &&
+ !vshCommandOptBool(cmd, "base")) {
+ vshError(ctl, "%s", _("--keep-relative is supported only with
partial "
+ "pull operations with --base specified"));
Again, let the lower level flag this, to prove that error message is sane.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org