Daniel P. Berrange wrote:
A couple of extra things needed
- Addition to tests/qemuxml2argvtest.c to validate the XML to
struct to QEMU ARGV conversion.
- Addition to tests/qemuxml2xmltest.c to validate XML to
struct to XML round-trip conversions.
- Addition to the docs/libvirt.rng XML schema.
Ok. Let's address the above
when we're satisfied with
the state of the patch as we have at least one open
issue (as below).
This static map & function are not required. Instead the int
to char * conversion (and its reverse) are automatically generated
through use of our built-in enum support macros
Yes you mentioned this in your
earlier (off list) reply
to me. I did produce a patch version using the
VIR_ENUM_DECL/VIR_ENUM_IMPL macros but thought they may
not be the most natural fit for the task since there
is no way to multiply define a particular enum value
(eg: cache "none" || "off"). Also a given hypervisor will
likely support only a subset of the internally enumerated
option space forcing dummy-out of unused cache modes. But
that is speculative and I don't have a strong bias either
way. So I've reverted to use of VIR_ENUM_DECL/VIR_ENUM_IMPL
here.
There have been two differnet syntaxes supported in QEMU for caching,
so we need to detect this and switch between them. Originally there
was just
cache=on & cache=off (writethrough and no caching)
Now it supports
cache=writeback, cache=writethrough and cache=none|off
So, if we detect the earlier syntax we need to raise an error if
the user requested writeback (or translate it to 'cache=off' for
safety sake).
I was trying to address part of this as above. But in general
I don't see how we can force an error in advance of launching
qemu without some information beforehand of whether we're
dealing with an old vs. new syntax qemu. One way to do so is
to test launch "qemu --help" and let it tell us what it accepts.
Alternatively we can just let qemu error exit in the case an
old/new qemu version doesn't recognize the alternate syntax.
Other than the above I believe I've incorporated all of
your remaining suggestions. Attached is an updated patch.
-john
--
john.cooper(a)redhat.com