On 20.09.2016 12:43, Joao Martins wrote:
> On 09/20/2016 05:14 AM, Michal Privoznik wrote:
>> On 20.09.2016 00:04, Jim Fehlig wrote:
>>> On 09/16/2016 05:43 PM, Joao Martins wrote:
>>>> Additionally what does "state"
>>>> signify for virtio case: is it that the guest agent is connected, or that
>>>> virtio serial is connected? Looking at the qemu driver on
>>>> processSerialChangedEvent it sounds to me like it's about the serial state.
>>> AFAICT you are right, but perhaps Michal is kind enough to confirm. I think
>>> is familiar with this code.
>> That attribute is put by libvirt into live XML so that mgmt apps can
>> query for it. The attribute says whether the guest part of channel is
>> opened by a process running within guest. In case of the qemu-ga whether
>> we have the guest agent up & running. Whenever the guest end of a
>> channel is opened/closed, qemu sends us an event so we can update our
>> internal state and put the correct value when formatting live XML.
>> Therefore, it makes no sense to make this attribute RW (meaning users
>> could set it), obviously.
> Hmm if it refers to qemu agent actually (dis)connected from guest side it
> be difficult to provide the same "state" semantics in libxl driver at least
> without changes on the toolstack. If it referring to virtio-serial state we
> could easily do that by periodically calling libxl_channel_getinfo until state
> is 4 (connected). But it's the actual agent process state as connected in
> case to have "state" attribute we would need to add similar to libxl event
> DOMAIN_CREATE_CONSOLE_AVAILABLE but instead referring to the guest channel.
Well, in qemu it really just means that somebody is listening. Note that
I say "somebody". That is if you kill qemu-ga in the guest and just 'cat
/dev/virtio-ports/org.qemu-ga.' we will report state='connected' (or
what's the path, and yes you can't use cat, but you get my point). We
don't do any checks whether it is actual qemu-ga listening. Moreover, we
report that for all the channels, not just the one used by the guest
agent. So it really means that there is somebody listening in the guest.
libvir-list mailing list