On 07/08/2014 09:29 AM, Peter Krempa wrote:
VIR_DOMAIN_BLOCK_REBASE_RELATIVE works only when @base is specified.
Check it right in libvirt.c as it's not expected to change across
hypervisors.
---
src/libvirt.c | 7 +++++++
src/qemu/qemu_driver.c | 7 -------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 6bf260a..edf2f8b 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -19817,6 +19817,13 @@ virDomainBlockRebase(virDomainPtr dom, const char *disk,
goto error;
}
+ if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE && !base) {
+ virReportInvalidArg(base, "%s",
+ _("flag VIR_DOMAIN_BLOCK_REBASE_RELATIVE is valid
"
+ "only with non-null base"));
+ goto error;
+ }
I'd shorten this to:
if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE)
virCheckNonNullArgGoto(params, error);
for consistency with other validity checks in this file.
I'd also like to see this restriction mentioned in the libvirt.c docs.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org