qemu: Allow the disk wwn to have "0x" prefix

The recent qemu requires "0x" prefix for the disk wwn, this patch
changes virValidateWWN to allow the prefix, and prepend "0x" if
it's not specified. E.g.

qemu-kvm: -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,wwn=6000c60016ea71ad:
Property 'scsi-hd.wwn' doesn't take value '6000c60016ea71ad'

Though it's a qemu regression, but it's nice to allow the prefix,
and doesn't hurt for us to always output "0x".
This commit is contained in:
Osier Yang
2013-04-17 21:23:44 +08:00
parent 5829054caf
commit 09d2547f96
6 changed files with 20 additions and 10 deletions

View File

@@ -280,7 +280,7 @@
<define name='wwn'>
<data type='string'>
<param name='pattern'>[0-9a-fA-F]{16}</param>
<param name='pattern'>(0x)?[0-9a-fA-F]{16}</param>
</data>
</define>