From fec1a93927c860934b4e983dce4ecbbe44485a93 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 14 Apr 2014 16:54:16 -0600 Subject: [PATCH] conf: split schema into more pieces To make schema more maintainable and to allow for moving the pieces to a common file in the future. It relies on the ability to override definitions as part of an include, set up in the previous patch. The diff is a bit hard to read, because it mixes reindentation with refactoring; 'git diff -b --patience' may help. * docs/schemas/domaincommon.rng (disk): Refactor into pieces. (diskSource, diskSourceFile, diskSourceBlock, diskSourceDir) (diskSourceVolume: New defines. (diskSourceNetwork): Revise scope. * docs/schemas/domainsnapshot.rng (disksnapshot): Adjust. * tests/domainsnapshotxml2xmlin/disk-seclabel-invalid.xml, tests/domainsnapshotxml2xmlin/disk-network-seclabel-invalid.xml: New tests to check seclabel is forbidden in domain snapshot by schema. Signed-off-by: Eric Blake Signed-off-by: Jiri Denemark --- docs/schemas/domaincommon.rng | 335 +++++++++--------- docs/schemas/domainsnapshot.rng | 14 +- .../disk-network-seclabel-invalid.xml | 12 + .../disk-seclabel-invalid.xml | 11 + 4 files changed, 197 insertions(+), 175 deletions(-) create mode 100644 tests/domainsnapshotxml2xmlin/disk-network-seclabel-invalid.xml create mode 100644 tests/domainsnapshotxml2xmlin/disk-seclabel-invalid.xml diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index df2c839e34..7739fd818f 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1196,176 +1196,187 @@ - - - - - - file - - - - - - - - - - - - - - - - - - - - - - - block - - - - - - - - - - - - - - - - - - - - - - dir - - - - - - - - - - - - - - - - - - network - - - - - - - - - - - - volume - - - - - - - - - - - - - - host - direct - - - - - - - - - - - - - - - - + - - - - nbd - rbd - sheepdog - gluster - iscsi - http - https - ftp - ftps - tftp - - + + + + + + + + + + + - + + file + - - - - - - - - tcp - rdma - - - - - - - - - - - - - - - - - - unix - - + + + + + - - - - - + + + + + + + + + + + + + + + block + + + + + + + + + + + + + + + + + + + + + + + + dir + + + + + + + + + + + + + + + + + + + + network + + + + + + nbd + rbd + sheepdog + gluster + iscsi + http + https + ftp + ftps + tftp + + + + + + + + + + + + + tcp + rdma + + + + + + + + + + + + + + + + + + unix + + + + + + + + + + + + + + + + + volume + + + + + + + + + + + + + + host + direct + + + + + + + + + + + + + + + (ioemu:)?(fd|hd|sd|vd|xvd|ubd)[a-zA-Z0-9_]+ diff --git a/docs/schemas/domainsnapshot.rng b/docs/schemas/domainsnapshot.rng index bec12dbe24..4ab1b828f2 100644 --- a/docs/schemas/domainsnapshot.rng +++ b/docs/schemas/domainsnapshot.rng @@ -173,19 +173,7 @@ - - - network - - - - - - - - - - + diff --git a/tests/domainsnapshotxml2xmlin/disk-network-seclabel-invalid.xml b/tests/domainsnapshotxml2xmlin/disk-network-seclabel-invalid.xml new file mode 100644 index 0000000000..de0de10865 --- /dev/null +++ b/tests/domainsnapshotxml2xmlin/disk-network-seclabel-invalid.xml @@ -0,0 +1,12 @@ + + my snap name + !@#$%^ + + + + + + + + + diff --git a/tests/domainsnapshotxml2xmlin/disk-seclabel-invalid.xml b/tests/domainsnapshotxml2xmlin/disk-seclabel-invalid.xml new file mode 100644 index 0000000000..528c646a1e --- /dev/null +++ b/tests/domainsnapshotxml2xmlin/disk-seclabel-invalid.xml @@ -0,0 +1,11 @@ + + my snap name + !@#$%^ + + + + + + + +