Regarding guest-file-write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]