On Tue, Dec 1, 2020 at 10:53 PM Markus Armbruster <arm...@redhat.com> wrote:
> Doug Evans <1906...@bugs.launchpad.net> writes: > > > Public bug reported: > > > > -device help doesn't report all devices. > > E.g., devices that are instantiated by a board don't get printed in part > because they don't exist when "-device help" is processed. As an experiment > I deferred processing of "-device help" as long as possible and some > devices were still not printed, so there's more going on here. > > > > QEMU commit hash: 944fdc5e27a5b5adbb765891e8e70e88ba9a00ec > > > > Repro: > > $ configure --target-list=arm-softmmu > > $ make > > $ ./qemu-system-arm -device help | grep npcm7xx > > <empty> > > > > I'd expect to see things like npcm7xx-rng in the output. > > Works as intended. > > "-device help" shows the devices that are available with -device. > npcm7xx-rng isn't: > > $ qemu-system-arm -M virt -device npcm7xx-rng > qemu-system-arm: -device npcm7xx-rng: Parameter 'driver' expects > pluggable device type > > Monitor command "info qdm" shows all devices, including npcm7xx-rng: > > $ qemu-system-arm -M virt -monitor stdio > QEMU 5.1.92 monitor - type 'help' for more information > (qemu) info qdm > [...] > name "npcm7xx-rng", bus System, desc "NPCM7xx Random Number > Generator", no-user > [...] > > Note "no-user": it's not available with -device. > > > I can imagine enumerating board-provided devices is a challenge. > > Still, it'd be really nice if "-device help" printed them, and having > > "-device $driver,help" work as well. > > It works: > > $ qemu-system-arm -M virt -device npcm7xx-rng,help > npcm7xx-rng options: > regs[0]=<child<qemu:memory-region>> > > Hope this helps! > Thanks for the reply. It does help, but it's odd that I can't use "-device help" to discover a device, but once discovered I can use it to get help on that device. At least I get why now. Thanks again. Btw, if I may ask another dumb question, I get this: @ruffy:build-arm$ ./qemu-system-arm -M virt -monitor stdio Unable to init server: Could not connect: Connection refused QEMU 5.1.93 monitor - type 'help' for more information (qemu) gtk initialization failed <exit> If I add "-display none" then it works, but it's odd that it's trying to initialize with gtk here ($DISPLAY isn't set, there is no X present). -help output says gtk is the default for -display, I'm guessing you didn't configure with gtk so that's why it works for you. Question: I'm not up on what the current state of the art is here, but given that $DISPLAY is unset, why not punt on gtk and default to "none" ? (printing a warning at startup explaining why if that helps)