server: make sure we clear vdagent and update mouse mode on agent disconnect

The check this patch removes causes us to not set vdagent to NULL, nor
update the mouse mode when the guest agent disconnects when no client is
attached. Which leads to a non working mouse, and on agent reconnect a
"spice_server_char_device_add_interface: vdagent already attached" message
instead of a successful re-add of the agent interface .

hansg: Note this is commit 443994ba from the 0.8 branch, which I did
not forward port back then because it seemed unnecessary on master, but it
turns out that the (wrong) check was just hidden in another place on master.
This commit is contained in:
Hans de Goede 2011-07-21 14:57:35 +02:00
parent 419222f0f3
commit 765948d449

View File

@ -3249,7 +3249,7 @@ static void spice_server_char_device_remove_interface(SpiceBaseInstance *sin)
red_printf("remove CHAR_DEVICE %s", char_device->subtype);
if (strcmp(char_device->subtype, SUBTYPE_VDAGENT) == 0) {
if (vdagent && reds->agent_state.connected) {
if (vdagent) {
reds_agent_remove();
}
}