[libvirt] Regarding guest-file-write

Puneet Bakshi bakshi.puneet at gmail.com
Tue Jun 24 13:10:29 UTC 2014


1. In that case, I hope it allow sending binary data (non-ASCII) also.

2. If I encode my data in base-64 form, is there a limit on size of the
data I can pass (or I can pass arbitrarily large amount of data).

​Regards​,
~Puneet

On Tue, Jun 24, 2014 at 6:27 PM, Daniel P. Berrange <berrange at redhat.com>
wrote:

> On Tue, Jun 24, 2014 at 06:20:16PM +0530, Puneet Bakshi wrote:
> > Hi,
> >
> > >From host, I wrote 26 alphabets in guest file (/tmp/testqga) using
> > guest-file-write guest agent command (logs pasted below). I faced 2
> issues
> > when doing that.
> >
> > 1a. It could wrote only 18bytes! Why could it not write all 26
> characters?
> > Are we supposed to track how much data is written and need to resend the
> > remaining one?
> >
> > 1b. What is the limit of data, I can send in one guest-file-write
> command?
> >
> > 2. In the guest, file data seems to be different. Am I doing something
> > wrong here?
>
> Yes, the command does not take raw data, it takes base-64 encoded data.
> So those 26 characters you specified were base64 decoded which gives
> you 18 bytes of raw data.
>
> The clue is in the variable name 'buf-b64' - a shorthand for base64:
>
> > [root at sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"
> > execute":"guest-file-write",
> > "arguments":{"handle":1000,"buf-b64":"abcdefghijklmnopqrstuvwxyz"}}'
> >
> > {"return":{"count":18,"eof":false}}
>
> Regards,
> Daniel
> --
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/
> :|
> |: http://libvirt.org              -o-             http://virt-manager.org
> :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/
> :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc
> :|
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140624/f9878e83/attachment-0001.htm>


More information about the libvir-list mailing list