On 10/20/22 16:37, Peter Krempa wrote:
The node device APIs which get XML from the user don't yet
support XML
validation flags. Introduce virNodeDeviceCreateXMLFlags and
virNodeDeviceDefineXMLFlags with the appropriate flags and add virsh
support for the new flags.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
docs/manpages/virsh.rst | 10 ++++++++--
include/libvirt/libvirt-nodedev.h | 19 +++++++++++++++++++
src/libvirt-nodedev.c | 4 ++--
tools/virsh-nodedev.c | 20 ++++++++++++++++++--
4 files changed, 47 insertions(+), 6 deletions(-)
+
+/**
+ * virNodeDeviceDefineXMLFlags:
+ *
+ * Since: 8.10.0
+ */
+typedef enum {
+ VIR_NODE_DEVICE_DEFINE_XML_VALIDATE = 1 << 0, /* Validate the XML document
against schema (Since: 8.10.0) */
+} virNodeDeviceDefineXMLFlags;
+
I know you already pushed these, but I am just wondering whether we
ought to drop the _XML_ infix as it diverges from the rest of _VALIDATE
flags.
libvirt.git $ git grep VALIDATE -- include/ | grep _XML_
include/libvirt/libvirt-nodedev.h: VIR_NODE_DEVICE_CREATE_XML_VALIDATE = 1 << 0,
/* Validate the XML document against schema (Since: 8.10.0) */
include/libvirt/libvirt-nodedev.h: VIR_NODE_DEVICE_DEFINE_XML_VALIDATE = 1 << 0,
/* Validate the XML document against schema (Since: 8.10.0) */
Michal