How can I run qmp commands on the fly?

How can I run qmp commands or enter monitor mode of a running vm?
I need to perform balloon operation on a Windows vm.

You can resize the balloon through the limits.memory option.
If you need direct QMP access, you’ll need to use raw.qemu to set up a new QMP listener.