AG> Hi Stephen,
AG> I am still struggling with TEMU automation. As you said I tried to
AG> use -after-loadvm option but I did not get anything.
AG> I use the following command:
AG> ./tracecap/temu -snapshot -monitor stdio -m 512
AG> /home/hossein/windowsxp.qcow -after-loadvm :foo.trace::::foo.exe
AG> Then vm started and I manually run the foo.exe in vm but I did not
AG> get any trace output.
AG> Could you please help me what should I do?
I think the most basic issue is that the -after-loadvm option is
intended to be used together with the -loadvm option. The terminology
is a bit confusing, because both what the -snapshot option does and
what the loadvm/savevm commands/options do are called snapshots, but
they're actually incompatible. The idea of a loadvm/savevm snapshot
mechanism is to save a running state of the VM, so that rather than
repeatedly booting it, you can just start it running right from right
before you're going to do something new. This is particularly valuable
because booting under TEMU can be quite slow.
AG> Also I am thinking in manual tracing that I need to load_plugin
AG> tracecap.so and the use "tracebyname foo.exe foo.trace" and
AG> finally "trace_stop". So when I using -after-loadvm option do not
AG> I need to load_plugin or trace_stop?? and If I need them how can I
AG> add it in my automation process?
If you do savevm after a plugin has been loaded, TEMU will remember
the plugin in the information and automatically reload it when you
loadvm.
To automate calling trace_stop, TEMU has a few pieces of functionality
that may be applicable. In at least some cases I think it will know to
automatically stop tracing when the corresponding process exits in the
guest OS. Plus there's a more flexible detection system which can take
one of several actions on one of several events using the "detect" and
"action" commands.
AG> I also saw this error when I use -after-loadvm option.
AG> Could not open '/dev/kqemu' - QEMU acceleration layer not
AG> activated: No such file or directory
This warning is common when running on modern systems. KQEMU was a
kernel-based acceleration module that used to allow TEMU (and other
old versions of QEMU) to run faster when the guest and host had the
same architecture. However it has been superseded in modern QEMU
versions and kernels with KVM and so is usually no longer available.