Skip to contentSkip to conversation

Unable to parse -device drivers containing commas?

Qemu-devel Mark Cave-Ayland 2 participants 3 messages May 30, 2013 – May 31, 2013

lore
Share & tools
lore
#0 lore raw

Hi all,

I found that the QEMU -device command line parser doesn't seem to like driver names containing a comma such as "SUNW,tcx" for the video driver on qemu-system-sparc:

$ ./qemu-system-sparc -device SUNW,tcx,help
qemu-system-sparc: -device SUNW,tcx,help: Parameter 'driver' expects device type
$ ./qemu-system-sparc -device 'SUNW,tcx',help
qemu-system-sparc: -device SUNW,tcx,help: Parameter 'driver' expects device type
$ ./qemu-system-sparc -device "SUNW,tcx",help
qemu-system-sparc: -device SUNW,tcx,help: Parameter 'driver' expects device type

If I try temporarily removing the comma from the TypeInfo name field in hw/display/tcx.c then all is fine:

$ ./qemu-system-sparc -device 'SUNWtcx',help
SUNWtcx.vram_size=hex32
SUNWtcx.width=uint16
SUNWtcx.height=uint16
SUNWtcx.depth=uint16
$ ./qemu-system-sparc -device SUNWtcx,help
SUNWtcx.vram_size=hex32
SUNWtcx.width=uint16
SUNWtcx.height=uint16
SUNWtcx.depth=uint16

Note that there are a couple of other devices in the SPARC32 device tree with this problem, since the general device naming convention on SPARC is in the form <manufacturer>,<device>. Is there a way of escaping the commas on the command line so that it is possible to list properties for drivers named in this way?

Many thanks,

Mark.

#1 lore raw
Quoted 11 lines · Mark Cave-Ayland

Hi all,

I found that the QEMU -device command line parser doesn't seem to like driver names containing a comma such as "SUNW,tcx" for the video driver on qemu-system-sparc:

$ ./qemu-system-sparc -device SUNW,tcx,help

Is there a way of escaping the
commas on the command line so that it is possible to list properties for drivers named in this way?

Commas are escaped by doubling them. Try ./qemu-system-sparc -device SUNW,,tcx,help

That's the generic quoting we've used for escaping commas in all new command line options, although there may be some older options that still need to be taught to honor that escaping.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#2 lore raw
Quoted 10 lines · Eric Blake
Quoted 3 lines

Is there a way of escaping the
commas on the command line so that it is possible to list properties for drivers named in this way?

Commas are escaped by doubling them. Try ./qemu-system-sparc -device SUNW,,tcx,help

That's the generic quoting we've used for escaping commas in all new command line options, although there may be some older options that still need to be taught to honor that escaping.

Hi Eric,

Yes that works absolutely fine here - thanks for the pointer!

Many thanks,

Mark.