Including qemu-devel also.
I
have a project environment where guest VMs are getting created and
destroyed based on some (irrelevant) parameters (these guest VMs are
instantiated with QEMU guest agent running and with any possible changes
in that). There is a module in host which is controlling all this. I
need to do following things from within that module.
1. Whenever a new guest VM is created, take (predefined) RPM packages from host to guest VM and install them.
2. Start a script in guest VM (at certain events).
3. Start a process in guest VM (at certain events).
I thought to address above issues by having a QEMU guest agent
running inside guest VM which has one new command, to which I somehow
pass RPMs using "virsh qemu-guest-agent ..." command.
"virsh qemu-agent-command vm_01 \
'{"execute":"guest-rpm-install", \
"arguments":{"path":"/usr/local/bin/ABC.rpm"}}
In
existing qemu-ga code, I saw some examples where they fork() and
execle() some stuff. I think I can achieve [2] and [3] using the same
way.
But, I was getting stuck at [1] in how to transfer files from host
to guest and do something with them. I thought I should be able to
transfer files using channel like socket/virtio, but was not getting the
clue on how to use them. Basically how can I do following.
1. take some bulky file from host to guest
2. perform some operation on that file
3. get the result of that operation.
Regards,
~Puneet