schema: Allow space character in disk vendor/product

Message ID 316686d0a065d96829a22d15aeddfc17d425d26e.1461679277.git.crobinso@redhat.com
State New
Headers show

Commit Message

Cole Robinson April 26, 2016, 2:01 p.m.
The hex range already tried to allow for it, but it doesn't work
for reasons I can't figure out. Use a plain character range instead,
and test it
---
 docs/schemas/domaincommon.rng                                  | 2 ++
 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-disk-vpd.xml | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Cole Robinson April 26, 2016, 2:09 p.m. | #1
On 04/26/2016 10:09 AM, Ján Tomko wrote:
> On Tue, Apr 26, 2016 at 10:01:17AM -0400, Cole Robinson wrote:

>> The hex range already tried to allow for it, but it doesn't work

>> for reasons I can't figure out. Use a plain character range instead,

>> and test it

>> ---

>>  docs/schemas/domaincommon.rng                                  | 2 ++

>>  tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-disk-vpd.xml | 4 ++--

>>  2 files changed, 4 insertions(+), 2 deletions(-)

>>

> 

> 

> This patch does not apply and only tries to add comments.

> 


Sigh, sorry, forgot to squash

- Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Cole Robinson April 26, 2016, 2:14 p.m. | #2
On 04/26/2016 10:13 AM, Daniel P. Berrange wrote:
> On Tue, Apr 26, 2016 at 10:01:17AM -0400, Cole Robinson wrote:

>> The hex range already tried to allow for it, but it doesn't work

>> for reasons I can't figure out. Use a plain character range instead,

>> and test it

>> ---

>>  docs/schemas/domaincommon.rng                                  | 2 ++

>>  tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-disk-vpd.xml | 4 ++--

>>  2 files changed, 4 insertions(+), 2 deletions(-)

>>

>> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng

>> index 4ad2236..6c80b66 100644

>> --- a/docs/schemas/domaincommon.rng

>> +++ b/docs/schemas/domaincommon.rng

>> @@ -1165,6 +1165,7 @@

>>        <optional>

>>          <element name="vendor">

>>            <data type="string">

>> +            <!-- All printable characters -->

>>              <param name="pattern">[ -~]{0,8}</param>

>>            </data>

>>          </element>

>> @@ -1172,6 +1173,7 @@

>>        <optional>

>>          <element name="product">

>>            <data type="string">

>> +            <!-- All printable characters -->

>>              <param name="pattern">[ -~]{0,16}</param>

>>            </data>

>>          </element>

> 

> Maybe I'm missing something but you don't appear to have changed

> the schema at all, merely added a comment ???

> 


Jan pointed that out a minute ago :) Forgot to finish squashing my patches,
check v2

- Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Patch

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4ad2236..6c80b66 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1165,6 +1165,7 @@ 
       <optional>
         <element name="vendor">
           <data type="string">
+            <!-- All printable characters -->
             <param name="pattern">[ -~]{0,8}</param>
           </data>
         </element>
@@ -1172,6 +1173,7 @@ 
       <optional>
         <element name="product">
           <data type="string">
+            <!-- All printable characters -->
             <param name="pattern">[ -~]{0,16}</param>
           </data>
         </element>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-disk-vpd.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-disk-vpd.xml
index 42c7bcd..9e1e7af 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-disk-vpd.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-disk-vpd.xml
@@ -26,8 +26,8 @@ 
       <source dev='/dev/HostVG/QEMUGuest2'/>
       <target dev='sdb' bus='scsi'/>
       <readonly/>
-      <vendor>SEAGATE</vendor>
-      <product>ST3567807GD</product>
+      <vendor>SEA GATE</vendor>
+      <product>ST67 807GD</product>
       <address type='drive' controller='1' bus='0' target='0' unit='0'/>
     </disk>
     <controller type='usb' index='0'>