On Tue, Jun 23, 2026 at 13:03:46 +0200, Peter Krempa wrote:
> On Tue, Jun 23, 2026 at 10:55:16 +0100, Daniel P. Berrangé via Devel wrote:
> > Conceptually -object and object_add/object_del should be sufficient
> > for essentially all QEMU configuration....if only we ported all our
> > internal custom backends/devices/etc to QOM. That is of course a big
> > job which is why it hasn't happened.
> >
> > This series started with the premise that the monitor is one of the
> > easier areas to convert since we have no more than three classes,
> > a common base, and QMP and HMP subclasses[1]. So why not give it a
> > go and thus unlock the ability to dynamically create/delete monitors
> > in QMP/HMP.
> >
> > This series does the conversion in a great many small steps to better
> > understand the implications at each stage.
> >
> > The high level outcome of this series is
> >
> > * HMP and QMP monitors are QOM objects, 'monitor-hmp' and
> > 'monitor-qmp' respectively
> >
> > * Both can be cold plugged and hot plugged. QMP only, can
> > also be hot unplugged.
> >
> > * '-mon' is obsolete, deprecated and replaced by '-object',
> > but -monitor, -qmp and kept as high level syntax sugar
>
> I was giving this a spin by implementing libvirt support for it. The
> basic usage seems to work well but I've encoutered a regression in
> behaviour which happens both when the QMP monitor is instantiated using
> the new syntax but also the old one
> ( -mon chardev=charmonitor,id=monitor,mode=control)
>
> When libvirt wants to re-connect to a qemu running with these patches it
> re-issues a 'qmp_capabilities' command after connecting.
>
> With these patches qemu does not respond to that command even when the
> old syntax is used. This makes libvirt stuck when re-connecting to VMs.
>
> The log on libvirt's side is not very interesting:
>
> 2026-06-23 11:00:11.229+0000: 529808: debug :
> virSecuritySELinuxSetDaemonSocketLabel:3190 : Setting VM ha socket context
> unconfined_u:unconfined_r:unconfined_t:s0:c677,c680
> 2026-06-23 11:00:11.229+0000: 529807: info : qemuMonitorOpenInternal:608 :
> QEMU_MONITOR_NEW: mon=0x7fff94001b80 fd=35
> 2026-06-23 11:00:11.229+0000: 529807: debug :
> qemuDomainObjEnterMonitorInternal:5165 : Entering monitor (mon=0x7fff94001b80
> vm=0x7fffac185b60 name=cd)
> 2026-06-23 11:00:11.229+0000: 529807: debug : qemuMonitorSetCapabilities:1437
> : mon:0x7fff94001b80 vm:0x7fffac185b60 monfd:35
> 2026-06-23 11:00:11.229+0000: 529807: info : qemuMonitorSend:822 :
> QEMU_MONITOR_SEND_MSG: mon=0x7fff94001b80
> msg={"execute":"qmp_capabilities","id":"libvirt-1"}^M
>
> as nothing else ever comes from monitor 0x7fff94001b80
I'll post the libvirt patches as rfc to the libvirt list in a while.