<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">1. In that case, I hope it allow sending binary data (non-ASCII) also.<br><br>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).<br>
</div><div class="gmail_extra"><br><div class="gmail_default" style="font-family:courier new,monospace">​Regards​,<br></div><div class="gmail_default" style="font-family:courier new,monospace">~Puneet<br></div><br><div class="gmail_quote">
On Tue, Jun 24, 2014 at 6:27 PM, Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On Tue, Jun 24, 2014 at 06:20:16PM +0530, Puneet Bakshi wrote:<br>
> Hi,<br>
><br>
> >From host, I wrote 26 alphabets in guest file (/tmp/testqga) using<br>
> guest-file-write guest agent command (logs pasted below). I faced 2 issues<br>
> when doing that.<br>
><br>
> 1a. It could wrote only 18bytes! Why could it not write all 26 characters?<br>
> Are we supposed to track how much data is written and need to resend the<br>
> remaining one?<br>
><br>
> 1b. What is the limit of data, I can send in one guest-file-write command?<br>
><br>
> 2. In the guest, file data seems to be different. Am I doing something<br>
> wrong here?<br>
<br>
</div>Yes, the command does not take raw data, it takes base-64 encoded data.<br>
So those 26 characters you specified were base64 decoded which gives<br>
you 18 bytes of raw data.<br>
<br>
The clue is in the variable name 'buf-b64' - a shorthand for base64:<br>
<div class=""><br>
> [root@sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"<br>
> execute":"guest-file-write",<br>
> "arguments":{"handle":1000,"buf-b64":"abcdefghijklmnopqrstuvwxyz"}}'<br>
><br>
> {"return":{"count":18,"eof":false}}<br>
<br>
</div>Regards,<br>
Daniel<br>
<span class="HOEnZb"><font color="#888888">--<br>
|: <a href="http://berrange.com" target="_blank">http://berrange.com</a>      -o-    <a href="http://www.flickr.com/photos/dberrange/" target="_blank">http://www.flickr.com/photos/dberrange/</a> :|<br>
|: <a href="http://libvirt.org" target="_blank">http://libvirt.org</a>              -o-             <a href="http://virt-manager.org" target="_blank">http://virt-manager.org</a> :|<br>
|: <a href="http://autobuild.org" target="_blank">http://autobuild.org</a>       -o-         <a href="http://search.cpan.org/%7Edanberr/" target="_blank">http://search.cpan.org/~danberr/</a> :|<br>
|: <a href="http://entangle-photo.org" target="_blank">http://entangle-photo.org</a>       -o-       <a href="http://live.gnome.org/gtk-vnc" target="_blank">http://live.gnome.org/gtk-vnc</a> :|<br>
</font></span></blockquote></div><br></div></div>