avatartwo / avatar2

Python core of avatar²
Apache License 2.0
518 stars 98 forks source link

PyPanda: disable -monitor #101

Open grant-h opened 2 years ago

grant-h commented 2 years ago

PyPanda's Panda() top-level class by default creates an interactive monitor like -monitor unix:/tmp/pypanda_mbwril7yr,server,nowait. I dont believe monitor is not the same as QMP, but a text based protocol

There are couple of ideas:

The main reason for disabling this is that running PyPanda many times can end up polluting /tmp

rawsample commented 2 years ago

Hi!

Disabling PyPanda's monitor should be currently possible via additional_args in the QemuTarget because of assemble_cmd_line() here.

But i would be in favor on changing the default behavior via a new option in PyPanda target.

grant-h commented 2 years ago

I tried that, but doesn't raw_monitor needs to be passed as a kwarg, not an array of strings. Can you show me?

rawsample commented 2 years ago

My bad, it's kwargs from init_target that should be used. Unfortunately this would not work using Avatar's init_targets() :/

from avatar2 import Avatar
from avatar2.targets import PyPandaTarget

av = Avatar()
pp = PyPandaTarget(av)

pp.init(raw_monitor=True)

pp.shutdown()