* [Qemu-devel] unable to set SATA serial with a spaces @ 2015-02-19 19:48 Alan Latteri 2015-02-19 22:12 ` John Snow 0 siblings, 1 reply; 11+ messages in thread From: Alan Latteri @ 2015-02-19 19:48 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 524 bytes --] I am virtualzing a physical server for which I need to set the SCSI/SATA drive serial. It is comprised of 12 " " spaces then 8 letter/digits. If I exclude the spaces, the drive serial is not accurate. If I include the spaces I get the following error. error: Failed to start domain test1 error: internal error: driver serial ' ABCD1234' contains unsafe characters virsh edit Centos 7.0 3.19.0-1.el7.elrepo.x86_64 QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-60.el7.centos.7), Copyright (c) 2003-2008 Fabrice Bellard [-- Attachment #2: Type: text/html, Size: 1354 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-19 19:48 [Qemu-devel] unable to set SATA serial with a spaces Alan Latteri @ 2015-02-19 22:12 ` John Snow 2015-02-19 22:14 ` Alan Latteri 2015-02-20 7:42 ` Markus Armbruster 0 siblings, 2 replies; 11+ messages in thread From: John Snow @ 2015-02-19 22:12 UTC (permalink / raw) To: Alan Latteri, qemu-devel On 02/19/2015 02:48 PM, Alan Latteri wrote: > I am virtualzing a physical server for which I need to set the SCSI/SATA > drive serial. It is comprised of 12 " " spaces then 8 letter/digits. If > I exclude the spaces, the drive serial is not accurate. If I include the > spaces I get the following error. > > error: Failed to start domain test1 > error: internal error: driver serial ' ABCD1234' contains unsafe characters > > virsh edit > Centos 7.0 > 3.19.0-1.el7.elrepo.x86_64 > QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-60.el7.centos.7), Copyright > (c) 2003-2008 Fabrice Bellard > Are you sure you need to input the spaces? the standard inquiry reply that outputs the serial uses spaces as padding, so even if you use serial "ABCD1234" the inquiry command is going to tell you " ABCD1234". Do you have software that relies on the serial number and can tell the difference between spaces present and no spaces present? --js ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-19 22:12 ` John Snow @ 2015-02-19 22:14 ` Alan Latteri 2015-02-20 7:42 ` Markus Armbruster 1 sibling, 0 replies; 11+ messages in thread From: Alan Latteri @ 2015-02-19 22:14 UTC (permalink / raw) To: John Snow; +Cc: qemu-devel I have a software that I was able to virtualize on VirtualBox by setting the HD serial using the spaces easily. Using the same parameters minus the spaces with QEMU, the software will not license. Only different I can see is this. > On Feb 19, 2015, at 2:12 PM, John Snow <jsnow@redhat.com> wrote: > > > > On 02/19/2015 02:48 PM, Alan Latteri wrote: >> I am virtualzing a physical server for which I need to set the SCSI/SATA >> drive serial. It is comprised of 12 " " spaces then 8 letter/digits. If >> I exclude the spaces, the drive serial is not accurate. If I include the >> spaces I get the following error. >> >> error: Failed to start domain test1 >> error: internal error: driver serial ' ABCD1234' contains unsafe characters >> >> virsh edit >> Centos 7.0 >> 3.19.0-1.el7.elrepo.x86_64 >> QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-60.el7.centos.7), Copyright >> (c) 2003-2008 Fabrice Bellard >> > > Are you sure you need to input the spaces? the standard inquiry reply that outputs the serial uses spaces as padding, so even if you use serial "ABCD1234" the inquiry command is going to tell you > " ABCD1234". > > Do you have software that relies on the serial number and can tell the difference between spaces present and no spaces present? > > --js ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-19 22:12 ` John Snow 2015-02-19 22:14 ` Alan Latteri @ 2015-02-20 7:42 ` Markus Armbruster 2015-02-20 8:04 ` Alan Latteri 2015-02-20 9:18 ` Alan Latteri 1 sibling, 2 replies; 11+ messages in thread From: Markus Armbruster @ 2015-02-20 7:42 UTC (permalink / raw) To: John Snow; +Cc: qemu-devel, Alan Latteri John Snow <jsnow@redhat.com> writes: > On 02/19/2015 02:48 PM, Alan Latteri wrote: >> I am virtualzing a physical server for which I need to set the SCSI/SATA >> drive serial. It is comprised of 12 " " spaces then 8 letter/digits. If >> I exclude the spaces, the drive serial is not accurate. If I include the >> spaces I get the following error. >> >> error: Failed to start domain test1 >> error: internal error: driver serial ' ABCD1234' contains unsafe characters >> >> virsh edit >> Centos 7.0 >> 3.19.0-1.el7.elrepo.x86_64 >> QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-60.el7.centos.7), Copyright >> (c) 2003-2008 Fabrice Bellard >> > > Are you sure you need to input the spaces? the standard inquiry reply > that outputs the serial uses spaces as padding, so even if you use > serial "ABCD1234" the inquiry command is going to tell you > " ABCD1234". Are you sure it pads on the left? padstr() doesn't look like left... [...] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-20 7:42 ` Markus Armbruster @ 2015-02-20 8:04 ` Alan Latteri 2015-02-20 9:28 ` Markus Armbruster 2015-02-20 9:18 ` Alan Latteri 1 sibling, 1 reply; 11+ messages in thread From: Alan Latteri @ 2015-02-20 8:04 UTC (permalink / raw) To: Markus Armbruster; +Cc: John Snow, qemu-devel [-- Attachment #1: Type: text/plain, Size: 2605 bytes --] Yes, left pad. This is a strace of the authorization program via VirtualBox data[96]=["\0\200\0\24 ABCD1234\0\0\0\0\0\0\0\0"…] then the same thing using the serial setting no spaces in QEMU. data[96]=["\0\200\0\024ABCD1234 \0\0\0\0\0\0\0\0"…] The spaces matter here. I tried setting the spaces manually running QEMU from the command line, but that doesn’t work. [root@XXXXX ~]# /usr/libexec/qemu-kvm -name test1 -S -machine rhel6.0.0,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 372419e1-ca68-408f-b809-04ce54450e60 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/test1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device ahci,id=ahci0,bus=pci.0,addr=0xd -drive file=/var/lib/libvirt/images/372419e1-ca68-408f-b809-04ce54450e60-0.img,if=none,id=drive-sata0-0-0,format=qcow2,serial= ABCD1234,cache=none -device ide-hd,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 qemu-kvm: -drive file=/var/lib/libvirt/images/372419e1-ca68-408f-b809-04ce54450e60-0.img,if=none,id=drive-sata0-0-0,format=qcow2,serial=: could not open disk image ABCD1234,cache=none: Could not open file: No such file or directory tried with quotes around the serial value and also using escpare characters. No go. Thanks, Alan > On Feb 19, 2015, at 11:42 PM, Markus Armbruster <armbru@redhat.com> wrote: > > John Snow <jsnow@redhat.com <mailto:jsnow@redhat.com>> writes: > >> On 02/19/2015 02:48 PM, Alan Latteri wrote: >>> I am virtualzing a physical server for which I need to set the SCSI/SATA >>> drive serial. It is comprised of 12 " " spaces then 8 letter/digits. If >>> I exclude the spaces, the drive serial is not accurate. If I include the >>> spaces I get the following error. >>> >>> error: Failed to start domain test1 >>> error: internal error: driver serial ' ABCD1234' contains unsafe characters >>> >>> virsh edit >>> Centos 7.0 >>> 3.19.0-1.el7.elrepo.x86_64 >>> QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-60.el7.centos.7), Copyright >>> (c) 2003-2008 Fabrice Bellard >>> >> >> Are you sure you need to input the spaces? the standard inquiry reply >> that outputs the serial uses spaces as padding, so even if you use >> serial "ABCD1234" the inquiry command is going to tell you >> " ABCD1234". > > Are you sure it pads on the left? padstr() doesn't look like left... > > [...] [-- Attachment #2: Type: text/html, Size: 7796 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-20 8:04 ` Alan Latteri @ 2015-02-20 9:28 ` Markus Armbruster 2015-02-21 3:40 ` Alan Latteri 0 siblings, 1 reply; 11+ messages in thread From: Markus Armbruster @ 2015-02-20 9:28 UTC (permalink / raw) To: Alan Latteri; +Cc: John Snow, qemu-devel Alan Latteri <alan@instinctual.tv> writes: > Yes, left pad. This is a strace of the authorization program via VirtualBox > data[96]=["\0\200\0\24 ABCD1234\0\0\0\0\0\0\0\0"…] > > then the same thing using the serial setting no spaces in QEMU. > > data[96]=["\0\200\0\024ABCD1234 \0\0\0\0\0\0\0\0"…] > > The spaces matter here. > > > I tried setting the spaces manually running QEMU from the command > line, but that doesn’t work. > > [root@XXXXX ~]# /usr/libexec/qemu-kvm -name test1 -S -machine > rhel6.0.0,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp > 1,sockets=1,cores=1,threads=1 -uuid > 372419e1-ca68-408f-b809-04ce54450e60 -no-user-config -nodefaults > -chardev > socket,id=charmonitor,path=/var/lib/libvirt/qemu/test1.monitor,server,nowait > -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc > -no-shutdown -boot strict=on -device > piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device > ahci,id=ahci0,bus=pci.0,addr=0xd -drive > file=/var/lib/libvirt/images/372419e1-ca68-408f-b809-04ce54450e60-0.img,if=none,id=drive-sata0-0-0,format=qcow2,serial= > ABCD1234,cache=none -device > ide-hd,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 > > qemu-kvm: -drive > file=/var/lib/libvirt/images/372419e1-ca68-408f-b809-04ce54450e60-0.img,if=none,id=drive-sata0-0-0,format=qcow2,serial=: > could not open disk image ABCD1234,cache=none: Could not open file: No > such file or directory > > > tried with quotes around the serial value and also using escpare characters. > > No go. Quoting appears to work for me: $ echo -e 'info qtree\nq' | qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -drive if=none,id=drv0,file=tmp.qcow2,serial=' ABCD1234' -device ide-hd,drive=drv0 | grep serial serial = " ABCD1234" Aside: the above uses legacy syntax. The preferred place for serial is -device, like this: -drive if=none,id=drv0,file=tmp.qcow2 -device ide-hd,drive=drv0,serial=' ABCD1234' ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-20 9:28 ` Markus Armbruster @ 2015-02-21 3:40 ` Alan Latteri 2015-02-23 10:18 ` Markus Armbruster 0 siblings, 1 reply; 11+ messages in thread From: Alan Latteri @ 2015-02-21 3:40 UTC (permalink / raw) To: Markus Armbruster; +Cc: John Snow, qemu-devel [-- Attachment #1: Type: text/plain, Size: 2438 bytes --] The left padding is important and necessary to keep for my particular application. This is broken in libvirt, but works fine with direct Qemu invocation. Thank you for the help. Alan > On Feb 20, 2015, at 1:28 AM, Markus Armbruster <armbru@redhat.com> wrote: > > Alan Latteri <alan@instinctual.tv <mailto:alan@instinctual.tv>> writes: > >> Yes, left pad. This is a strace of the authorization program via VirtualBox >> data[96]=["\0\200\0\24 ABCD1234\0\0\0\0\0\0\0\0"…] >> >> then the same thing using the serial setting no spaces in QEMU. >> >> data[96]=["\0\200\0\024ABCD1234 \0\0\0\0\0\0\0\0"…] >> >> The spaces matter here. >> >> >> I tried setting the spaces manually running QEMU from the command >> line, but that doesn’t work. >> >> [root@XXXXX ~]# /usr/libexec/qemu-kvm -name test1 -S -machine >> rhel6.0.0,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp >> 1,sockets=1,cores=1,threads=1 -uuid >> 372419e1-ca68-408f-b809-04ce54450e60 -no-user-config -nodefaults >> -chardev >> socket,id=charmonitor,path=/var/lib/libvirt/qemu/test1.monitor,server,nowait >> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc >> -no-shutdown -boot strict=on -device >> piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device >> ahci,id=ahci0,bus=pci.0,addr=0xd -drive >> file=/var/lib/libvirt/images/372419e1-ca68-408f-b809-04ce54450e60-0.img,if=none,id=drive-sata0-0-0,format=qcow2,serial= >> ABCD1234,cache=none -device >> ide-hd,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 >> >> qemu-kvm: -drive >> file=/var/lib/libvirt/images/372419e1-ca68-408f-b809-04ce54450e60-0.img,if=none,id=drive-sata0-0-0,format=qcow2,serial=: >> could not open disk image ABCD1234,cache=none: Could not open file: No >> such file or directory >> >> >> tried with quotes around the serial value and also using escpare characters. >> >> No go. > > Quoting appears to work for me: > > $ echo -e 'info qtree\nq' | qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -drive if=none,id=drv0,file=tmp.qcow2,serial=' ABCD1234' -device ide-hd,drive=drv0 | grep serial > serial = " ABCD1234" > > Aside: the above uses legacy syntax. The preferred place for serial is > -device, like this: > > -drive if=none,id=drv0,file=tmp.qcow2 > -device ide-hd,drive=drv0,serial=' ABCD1234' [-- Attachment #2: Type: text/html, Size: 11649 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-21 3:40 ` Alan Latteri @ 2015-02-23 10:18 ` Markus Armbruster 2015-02-23 11:41 ` Michal Privoznik 0 siblings, 1 reply; 11+ messages in thread From: Markus Armbruster @ 2015-02-23 10:18 UTC (permalink / raw) To: Alan Latteri; +Cc: John Snow, qemu-devel Alan Latteri <alan@instinctual.tv> writes: > The left padding is important and necessary to keep for my particular > application. This is broken in libvirt, but works fine with direct > Qemu invocation. > > Thank you for the help. Please file a bug against libvirt, so this gets fixed. https://bugzilla.redhat.com/enter_bug.cgi?product=Virtualization%20Tools&component=libvirt http://libvirt.org/bugs.html ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-23 10:18 ` Markus Armbruster @ 2015-02-23 11:41 ` Michal Privoznik 2015-02-24 9:47 ` Alan Latteri 0 siblings, 1 reply; 11+ messages in thread From: Michal Privoznik @ 2015-02-23 11:41 UTC (permalink / raw) To: Markus Armbruster, Alan Latteri; +Cc: John Snow, qemu-devel On 23.02.2015 11:18, Markus Armbruster wrote: > Alan Latteri <alan@instinctual.tv> writes: > >> The left padding is important and necessary to keep for my particular >> application. This is broken in libvirt, but works fine with direct >> Qemu invocation. >> >> Thank you for the help. > > Please file a bug against libvirt, so this gets fixed. > > https://bugzilla.redhat.com/enter_bug.cgi?product=Virtualization%20Tools&component=libvirt > http://libvirt.org/bugs.html > I've just proposed a patch for that: https://www.redhat.com/archives/libvir-list/2015-February/msg00871.html Once you create a bug, I can attach its number into the commit message. Michal ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-23 11:41 ` Michal Privoznik @ 2015-02-24 9:47 ` Alan Latteri 0 siblings, 0 replies; 11+ messages in thread From: Alan Latteri @ 2015-02-24 9:47 UTC (permalink / raw) To: Michal Privoznik; +Cc: John Snow, Markus Armbruster, qemu-devel [-- Attachment #1: Type: text/plain, Size: 909 bytes --] Bug 1195660 <https://bugzilla.redhat.com/show_bug.cgi?id=1195660> has been added to the database > On Feb 23, 2015, at 3:41 AM, Michal Privoznik <mprivozn@redhat.com> wrote: > > On 23.02.2015 11:18, Markus Armbruster wrote: >> Alan Latteri <alan@instinctual.tv> writes: >> >>> The left padding is important and necessary to keep for my particular >>> application. This is broken in libvirt, but works fine with direct >>> Qemu invocation. >>> >>> Thank you for the help. >> >> Please file a bug against libvirt, so this gets fixed. >> >> https://bugzilla.redhat.com/enter_bug.cgi?product=Virtualization%20Tools&component=libvirt >> http://libvirt.org/bugs.html >> > > I've just proposed a patch for that: > > https://www.redhat.com/archives/libvir-list/2015-February/msg00871.html > > Once you create a bug, I can attach its number into the commit message. > > Michal [-- Attachment #2: Type: text/html, Size: 2244 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] unable to set SATA serial with a spaces 2015-02-20 7:42 ` Markus Armbruster 2015-02-20 8:04 ` Alan Latteri @ 2015-02-20 9:18 ` Alan Latteri 1 sibling, 0 replies; 11+ messages in thread From: Alan Latteri @ 2015-02-20 9:18 UTC (permalink / raw) To: Markus Armbruster; +Cc: John Snow, qemu-devel [-- Attachment #1: Type: text/plain, Size: 1218 bytes --] From what I can tell in the code, padstr() is only coded in the IDE section, not SCSI/SATA? > On Feb 19, 2015, at 11:42 PM, Markus Armbruster <armbru@redhat.com> wrote: > > John Snow <jsnow@redhat.com <mailto:jsnow@redhat.com>> writes: > >> On 02/19/2015 02:48 PM, Alan Latteri wrote: >>> I am virtualzing a physical server for which I need to set the SCSI/SATA >>> drive serial. It is comprised of 12 " " spaces then 8 letter/digits. If >>> I exclude the spaces, the drive serial is not accurate. If I include the >>> spaces I get the following error. >>> >>> error: Failed to start domain test1 >>> error: internal error: driver serial ' ABCD1234' contains unsafe characters >>> >>> virsh edit >>> Centos 7.0 >>> 3.19.0-1.el7.elrepo.x86_64 >>> QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-60.el7.centos.7), Copyright >>> (c) 2003-2008 Fabrice Bellard >>> >> >> Are you sure you need to input the spaces? the standard inquiry reply >> that outputs the serial uses spaces as padding, so even if you use >> serial "ABCD1234" the inquiry command is going to tell you >> " ABCD1234". > > Are you sure it pads on the left? padstr() doesn't look like left... > > [...] [-- Attachment #2: Type: text/html, Size: 5788 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-02-24 10:07 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-02-19 19:48 [Qemu-devel] unable to set SATA serial with a spaces Alan Latteri 2015-02-19 22:12 ` John Snow 2015-02-19 22:14 ` Alan Latteri 2015-02-20 7:42 ` Markus Armbruster 2015-02-20 8:04 ` Alan Latteri 2015-02-20 9:28 ` Markus Armbruster 2015-02-21 3:40 ` Alan Latteri 2015-02-23 10:18 ` Markus Armbruster 2015-02-23 11:41 ` Michal Privoznik 2015-02-24 9:47 ` Alan Latteri 2015-02-20 9:18 ` Alan Latteri
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).