On Tue, Aug 17, 2021 at 12:38:09PM +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <[email protected]>
---
docs/formatdomain.rst                         | 21 ++++++++++++
docs/schemas/domaincommon.rng                 | 14 ++++++++
src/conf/domain_conf.c                        |  9 ++++-
src/conf/domain_conf.h                        |  1 +
src/conf/domain_validate.c                    | 34 +++++++++++++++++++
.../fibrechannel-appid.xml                    | 21 ++++++++++++
tests/genericxml2xmltest.c                    |  2 ++
7 files changed, 101 insertions(+), 1 deletion(-)
create mode 100644 tests/genericxml2xmlindata/fibrechannel-appid.xml

diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index a9e4519b1a..d656716ea9 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -55,6 +55,37 @@ virDomainDefBootValidate(const virDomainDef *def)
}


+#define APPID_LEN_MIN 1
+#define APPID_LEN_MAX 128
+
+static int
+virDomainDefResourceValidate(const virDomainDef *def)
+{
+    if (!def->resource)
+        return 0;
+
+    if (def->resource->appid) {
+        int len;
+
+        if (!virStringIsPrintable(def->resource->appid)) {
+            virReportError(VIR_ERR_XML_ERROR, "%s",
+                           _("Fibre Channel 'appid' is not printable string"));

"not a printable string"

Reviewed-by: Martin Kletzander <[email protected]>

Attachment: signature.asc
Description: PGP signature

Reply via email to