Am 28.01.2020 um 11:59 hat Kevin Wolf geschrieben: > > > The other part that it needs to solve is how to be available by default > > > without specifying anything on the command line. Basically, if I press > > > Ctrl-Alt-2, I want to get to a monitor shell. If that shell is > > > implemented internally or by an external Python process, I don't mind. > > > > That is a harder part. (I rarely use Ctrl-Alt-2 actually; I mostly > > use HMP on stdin). > > I don't think it would be that hard, actually. > > If you have a -qmp-shell option that takes a chardev and defaults to vc, > you've solved the part with both stdio and Ctrl-Alt-2. Now all you need > to do is launch the Python child process, pass it a pair of pipes for > communication and forward everything between the pipes and the chardev. > > (That's the theory anyway.)
If someone is interested, I did a quick proof-of-concept hack: https://repo.or.cz/qemu/kevin.git/shortlog/refs/heads/qmp-shell It doesn't clean up anything properly (including the qmp-shell processes it starts), but it spawns a usable qmp-shell on a user-specified character device. stdio seems to work, though without readline functionality (I suppose I still have line-buffering somewhere), vc doesn't really work at all yet. Try it out like this: $ ./qemu-storage-daemon --chardev stdio,id=m --monitor m,mode=qmp-shell monitor_qmp_event: 1 Welcome to the QMP low-level shell! Connected to QEMU 4.2.50 (QEMU) query-version {"return": {"qemu": {"micro": 50, "major": 4, "minor": 2}, "package": "v4.2.0-1188-gd95a3885a9"}} (QEMU) quit (Or use x86_64-softmmu/qemu-system-x86_64, but it's based on the refactorings in the storage daemon branch, so why not try both at once?) Polishing this to make it mergable would still require substantial work, so at the moment I'm not planning to do this. But if someone wants to pick it up, feel free (just let us know). Hm, in fact... A qmp-shell GSoC project? Kevin