qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Regarding guest-file-write
@ 2014-06-24 12:50 Puneet Bakshi
  2014-06-24 12:57 ` [Qemu-devel] [libvirt] " Daniel P. Berrange
  2014-06-24 15:32 ` [Qemu-devel] " Eric Blake
  0 siblings, 2 replies; 5+ messages in thread
From: Puneet Bakshi @ 2014-06-24 12:50 UTC (permalink / raw)
  To: libvir-list, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2246 bytes --]

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?


Host (file write)

[root@sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"
execute":"guest-file-open", "arguments":{"path":"/tmp/testqga","mode":"w
+"}}'

{"return":1000}


[root@sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"
execute":"guest-file-write",
"arguments":{"handle":1000,"buf-b64":"abcdefghijklmnopqrstuvwxyz"}}'

{"return":{"count":18,"eof":false}}


[root@sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"
execute":"guest-file-close", "arguments":{"handle":1000}}'

{"return":{}}


Host (file read)

[root@sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"
execute":"guest-file-open", "arguments":{"path":"/tmp/testqga","mode":"r"}}'

{"return":1001}


[root@sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"
execute":"guest-file-read", "arguments":{"handle":1001,"count":18}}'

{"return":{"count":18,"buf-b64":"abcdefghijklmnopqrstuvwx","eof":false}}


[root@sdsr720-14 ~]# virsh qemu-agent-command vm_04 '{"
execute":"guest-file-close", "arguments":{"handle":1001}}'

{"return":{}}

Guest

[root@vm04 qga]# ll /tmp/testqga

-rw-rw-rw-. 1 root root 18 Jun 24 15:06 /tmp/testqga


[root@vm04 qga]# cat /tmp/testqga

i�^]y�!�9%�z)��-��1[root@vm04 qga]#


[root@vm04 qga]# od -x /tmp/testqga

0000000 b769 791d 21f8 398a 9a25 297a bbaa ba2d

0000020 31fc

0000022

     [root@vm04 qga]# strings /tmp/testqga

     [root@vm04 qga]# hexdump /tmp/testqga
     0000000 b769 791d 21f8 398a 9a25 297a bbaa ba2d
     0000010 31fc
     0000012

     [root@vm04 qga]# hexdump -c /tmp/testqga
     0000000   i 267 035   y 370   ! 212   9   % 232   z   ) 252 273   - 272
     0000010 374   1
     0000012
     [root@vm04 qga]#

Regards,
~Puneet

[-- Attachment #2: Type: text/html, Size: 16507 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-24 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24 12:50 [Qemu-devel] Regarding guest-file-write Puneet Bakshi
2014-06-24 12:57 ` [Qemu-devel] [libvirt] " Daniel P. Berrange
2014-06-24 13:10   ` Puneet Bakshi
2014-06-24 15:34     ` Eric Blake
2014-06-24 15:32 ` [Qemu-devel] " Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).