On Tue, Jun 24, 2014 at 06:20:16PM +0530, Puneet Bakshi wrote:Yes, the command does not take raw data, it takes base-64 encoded data.
> 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?
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:
Regards,
> [root@sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"
> execute":"guest-file-write",
> "arguments":{"handle":1000,"buf-b64":"abcdefghijklmnopqrstuvwxyz"}}'
>
> {"return":{"count":18,"eof":false}}
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 :|