On Thu, Oct 20, 2016 at 15:17:50 -0500, Eric Blake wrote:
On 10/20/2016 10:25 AM, Peter Krempa wrote:
> From: Prasanna Kumar Kalever <prasanna.kalever(a)redhat.com>
>
> Teach qemu driver to detect whether qemu supports specifying debug level
> for gluster volumes.
>
> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever(a)redhat.com>
> Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
> ---
> src/qemu/qemu_capabilities.c | 3 ++-
> src/qemu/qemu_capabilities.h | 1 +
> tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
> 3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 97e29db..7f0a47b 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -347,6 +347,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
> "machine-iommu",
> "virtio-vga",
> "query-qmp-schema",
> + "gluster.debug_level",
> );
>
>
> @@ -1694,7 +1695,7 @@ static struct virQEMUCapsStringFlags
virQEMUCapsObjectPropsUSBNECXHCI[] = {
> };
>
> static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
> - { "bogus/path/to/satisfy/compiler", 0 },
> + { "blockdev-add/arg-type/options/+gluster/debug-level",
QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
Okay, I see how you plan to use this.
BIG WARNING FLAG - in qemu 2.7, blockdev-add is unstable (it should have
been named x-blockdev-add; but we goofed); but you can use the existence
of x-blockdev-del as a witness that blockdev-add is incomplete.
In qemu 2.8, we are taking advantage of the fact that 2.7 wasn't
complete in order to get rid of the 'options' nesting layer; the plan is
to also rename x-blockdev-add at the same time. Which means this probe,
as written, will only succeed for 2.7.
So. Should I add both? One with the "options" indirection and one
without? Since there is no other way to access the structure than via
blockdev-add and I really don't want to add a version check I see it as
the only option.