[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [QGA] Bug of qga?
From: |
Sam |
Subject: |
Re: [Qemu-devel] [QGA] Bug of qga? |
Date: |
Tue, 29 Aug 2017 13:52:47 +0800 |
I could repeat this several times, I think it's mis-order of qmp in qga
socket.
2017-08-25 11:09 GMT+08:00 Sam <address@hidden>:
> Also I found:
>
> when I use `socat` to take a qga socket, then I use `socat` to communicate
> it will got error.
> But also SOMETIMES, I will not got error and will communicate OK.
>
> If one user take qga socket, another user should got error, is it? But why
> sometimes, the communicate is OK?
>
> 2017-08-25 10:11 GMT+08:00 Sam <address@hidden>:
>
>> Hi all,
>>
>> I'm using qga to send `route -n` and `ping` command to guest. But I found
>> SOMETIMES, the second `ping` command's result is the same as `route -n`
>> command.
>>
>> So I guess is there some cache mechanism of qga command result? So when I
>> send the second command, and receive from qga socket, I receive the result
>> of first command.
>>
>> Or is this bug happened because of I use async mechanism of python code
>> to operate qga socket?
>>
>> This is the python code I use to operate on this qga socket:
>>
>> try:
>>> sock=socket(AF_UNIX, SOCK_STREAM)
>>> sock.settimeout(20)
>>> sock.connect(vm_qga_sockpath)
>>> sock.send(cmd)
>>> while True:
>>> res = sock.recv(1024)
>>> if len(res):
>>> break
>>> except Exception as e:
>>> res = -1
>>> finally:
>>> sock.settimeout(None)
>>> sock.close()
>>
>>
>