If I add following channel in guest VM's xml file

    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>

Would it be possible to use virtio org.qemu.guest_agent.0 for such communication between host and guest? If yes, how can we do it?

Regards,
~Puneet


On Thu, Jun 12, 2014 at 8:20 PM, Eric Blake <eblake@redhat.com> wrote:
On 06/12/2014 08:38 AM, Puneet Bakshi wrote:
> Thanks for responding.

[Please don't top-post on technical lists]

>
> Since I want to work with online guests, unfortunately libguestfs is not an
> option for me. (Otherwise, I might have used virt-copy-in to copy the files
> into guest).
>
> But, for my understanding, please let me know how such things can be done
> in QEMU environment. Basically, how can we do following.
>
>     1. take some bulky file from host to guest

Place the file in a shared filesystem (NFS, gluster, ...) that both the
host and guest can see.  Depending on whether you use a new enough host
and guest kernel, you can even try plan9 9p filesystem passthrough.  Or
you can use qemu MTP MTP filesystem passthrough (which has the bonus of
being supported out-of-the-box for Windows guests):
https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03319.html
https://en.wikipedia.org/wiki/Media_Transfer_Protocol
although I'm not sure if libvirt needs to be taught to expose that better.

>     2. perform some operation on that file
>     3. get the result of that operation.

How would you get a bare-metal machine to perform an operation on a file
it just downloads?  If you would ssh in to a bare-metal machine, then
ssh into your guest.  Otherwise, you'll have to submit patches to the
qemu list to enhance the guest agent to do what you want before libvirt
can even consider adding things to automate yet another way of doing it.

--
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org