avatar2 icon indicating copy to clipboard operation
avatar2 copied to clipboard

PyPanda: disable -monitor

Open grant-h opened this issue 3 years ago • 3 comments

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:

  • Always disable PyPanda's monitor by passing raw_monitor=True (https://github.com/panda-re/panda/blob/716b782f3f604d990f361cbab3186b4e0c73540f/panda/python/core/pandare/panda.py#L59)
  • Provide an option to PyPanda target creation to disable this by default, but still enable it if needed

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

grant-h avatar Feb 16 '22 21:02 grant-h

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.

rawsample avatar Feb 17 '22 09:02 rawsample

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

grant-h avatar Feb 17 '22 23:02 grant-h

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()

rawsample avatar Feb 18 '22 14:02 rawsample