mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
ui/vdagent: keep "connected" state
During post-load of migration, virtio will notify of fe_open state. However vdagent code will handle this as a reconnection. This will trigger a connection reset/caps with the agent. Check if the state actually changed before resetting the connection. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
ac5e2bc910
commit
688ff4cbdf
1 changed files with 7 additions and 0 deletions
|
@ -40,6 +40,7 @@ struct VDAgentChardev {
|
|||
bool clipboard;
|
||||
|
||||
/* guest vdagent */
|
||||
bool connected;
|
||||
uint32_t caps;
|
||||
VDIChunkHeader chunk;
|
||||
uint32_t chunksize;
|
||||
|
@ -858,6 +859,7 @@ static void vdagent_disconnect(VDAgentChardev *vd)
|
|||
{
|
||||
trace_vdagent_disconnect();
|
||||
|
||||
vd->connected = false;
|
||||
g_byte_array_set_size(vd->outbuf, 0);
|
||||
vdagent_reset_bufs(vd);
|
||||
vd->caps = 0;
|
||||
|
@ -876,6 +878,10 @@ static void vdagent_chr_set_fe_open(struct Chardev *chr, int fe_open)
|
|||
|
||||
trace_vdagent_fe_open(fe_open);
|
||||
|
||||
if (vd->connected == fe_open) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fe_open) {
|
||||
trace_vdagent_close();
|
||||
vdagent_disconnect(vd);
|
||||
|
@ -885,6 +891,7 @@ static void vdagent_chr_set_fe_open(struct Chardev *chr, int fe_open)
|
|||
return;
|
||||
}
|
||||
|
||||
vd->connected = true;
|
||||
vdagent_send_caps(vd, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue