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 On Thu, Jun 12, 2014 at 9:37 PM, Puneet Bakshi <bakshi.pun...@gmail.com> wrote: > Forgot to mention that these guest VMs can be UNIX based or Windows. > > > On Thu, Jun 12, 2014 at 9:36 PM, Puneet Bakshi <bakshi.pun...@gmail.com> > wrote: > >> Thanks Dale for responding. >> >> Actually, these guest VMs may or may not have scp, ftp, etc. What is >> assured is that they have the QEMU guest agent running and there is a >> possibility of having additional commands if required. >> >> Let me put up my problem. >> >> 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. >> >> In existing qemu-ga code, I saw some examples where they fork() and >> execle() some stuff. I though 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. >> >> Regards, >> >> >> On Thu, Jun 12, 2014 at 8:42 PM, Dale R. Worley <wor...@alum.mit.edu> >> wrote: >> >>> > From: Puneet <bakshi.pun...@gmail.com> >>> >>> > I am able to pass arguments from host to guest VM but how am I >>> supposed to >>> > pass the whole RPM image from host to guest (which the guest agent can >>> > receive and install)? >>> >>> What occurs to me is: >>> >>> scp /usr/local/bin/ABC.rpm root@guest:/usr/local/bin/ABC.rpm >>> ssh root@guest rpm --install -p /usr/local/bin/ABC.rpm >>> >>> Dale >>> >> >> >