]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: align disk serial check to schema
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Tue, 28 Mar 2017 08:10:53 +0000 (11:10 +0300)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 2 Aug 2017 23:19:55 +0000 (19:19 -0400)
Disk serial schema has extra '.+' allowed characters in comparison
with check in code. Looks like there is no reason for that as qemu
allows any character AFAIK for serial. This discrepancy is originated
in commit id '85d15b51' where the ability to add serial was added.

Alter the disk-serial test to add a disk with all the possible
characters listed as the serial value.

src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-disk-serial.args
tests/qemuxml2argvdata/qemuxml2argv-disk-serial.xml

index da6ddff6cbb22c1573852eb07706e96961ea834d..768b1847940f34bbc7b2d648c7c55c9a8f763c25 100644 (file)
@@ -475,7 +475,7 @@ qemuBuildIoEventFdStr(virBufferPtr buf,
 }
 
 #define QEMU_SERIAL_PARAM_ACCEPTED_CHARS \
-  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ "
+  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ .+"
 
 static int
 qemuSafeSerialParamValue(const char *value)
index 6f512352bea3cb7eb9f24aa9efea0d5a635856fa..a44af97fb735d4750ca04f9af4f390ff9afe0f9e 100644 (file)
@@ -22,4 +22,7 @@ server,nowait \
 -drive 'file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1,\
 serial=\ \ WD-WMAP9A966149' \
 -device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
+-drive 'file=/dev/HostVG/AllSerialChars,format=raw,if=none,id=drive-ide0-0-2,\
+serial=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_\ .+' \
+-device ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 9c214439219f56f283b707c5ef47394e2a6965df..ccd78204bf3a1927023dce65cd9999ab504d9d0a 100644 (file)
       <serial>  WD-WMAP9A966149</serial>
       <address type='drive' controller='0' bus='0' target='0' unit='1'/>
     </disk>
+    <disk type='block' device='disk'>
+      <source dev='/dev/HostVG/AllSerialChars'/>
+      <target dev='hdb' bus='ide'/>
+      <serial>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ .+</serial>
+      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
+    </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <memballoon model='virtio'/>