From cb7583e161570a8ae5dfdf83635f797edc7e77c2 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 28 Feb 2012 21:16:28 -0700 Subject: [PATCH] xml: share 'unit' in RNG The code supported unit='E' for "exabyte", but the RNG did not; conversely, the RNG supported "z" and "y" but the code did not (I'm jealous if you have that much storage, particularly since it won't fit in 64-bit off_t). Also, the code supported , but not the RNG. In an effort to make 'unit' more worthwhile in future patches, it's easier to share it between files. In making this factorization, note that absFilePath is more permissive than 'path', so storage pools and storage volumes will now validate with a wider set of file names than before. I don't think this should be a problem in practice. * docs/schemas/storagepool.rng: Include basic types, rather than repeating things here. * docs/schemas/storagevol.rng: Likewise. * docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix to match storage code. --- docs/schemas/basictypes.rng | 11 +++++++ docs/schemas/storagepool.rng | 47 +++++++++--------------------- docs/schemas/storagevol.rng | 56 +++++++++++------------------------- 3 files changed, 41 insertions(+), 73 deletions(-) diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng index 3b4b952f26..4f16fa7d21 100644 --- a/docs/schemas/basictypes.rng +++ b/docs/schemas/basictypes.rng @@ -8,6 +8,11 @@ [0-9]+ + + + [0-9]+ + + @@ -133,4 +138,10 @@ + + + [kKmMgGtTpPeE] + + + diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index 330147296a..6399f12e34 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -2,6 +2,7 @@ + @@ -127,7 +128,7 @@ - + @@ -135,17 +136,17 @@ - + - + - + @@ -154,13 +155,13 @@ - + - + - + @@ -175,7 +176,7 @@ - + @@ -200,7 +201,7 @@ - + @@ -226,10 +227,10 @@ - + - + @@ -238,7 +239,7 @@ - + @@ -454,28 +455,6 @@ [a-zA-Z0-9_\+\-]+ - - - - [a-fA-F0-9]{32} - - - [a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12} - - - - - - - [0-9]+ - - - - - - /[a-zA-Z0-9_\+\-/%]+ - - diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng index 994004d997..d06884c930 100644 --- a/docs/schemas/storagevol.rng +++ b/docs/schemas/storagevol.rng @@ -1,6 +1,8 @@ + + @@ -35,12 +37,17 @@ - + - + + + + + + @@ -49,13 +56,13 @@ - + - + - + @@ -70,7 +77,7 @@ - + @@ -84,7 +91,7 @@ - + @@ -103,7 +110,7 @@ - + @@ -116,10 +123,10 @@ - + - + @@ -180,33 +187,4 @@ - - - [0-9]+ - - - - - - /[a-zA-Z0-9_\+\-\./%]+ - - - - - - [kKmMgGtTpPyYzZ] - - - - - - - [a-fA-F0-9]{32} - - - [a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12} - - - -