All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Alon Levy <alevy@redhat.com>
Cc: amit shah <amit.shah@redhat.com>,
	aliguori@us.ibm.com, qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/2] spice-qemu-char: register interface on post load
Date: Fri, 22 Mar 2013 09:55:47 +0100	[thread overview]
Message-ID: <514C1C93.5060207@redhat.com> (raw)
In-Reply-To: <1746253387.13066488.1363940210526.JavaMail.root@redhat.com>

Hi,

On 03/22/2013 09:16 AM, Alon Levy wrote:
>> Ji,
>
> Ji,
>
>>
>> On 03/21/2013 05:35 PM, Alon Levy wrote:
>>> The target has not seen the guest_connected event via
>>> spice_chr_guest_open or spice_chr_write, and so spice server
>>> wrongly
>>> assumes there is no agent active, while the client continues to
>>> send
>>> motion events only by the agent channel, which the server ignores.
>>> The
>>> net effect is that the mouse is static in the guest.
>>>
>>> By registering the interface on post load spice server will pass on
>>> the
>>> agent messages fixing the mouse behavior after migration.
>>>
>>> Note that qemu_be_is_fe_connected is called when the vm is already
>>> running, to avoid any possible order of vmstate loading issue, i.e.
>>> device loading after chardev post_load being called back.
>>
>> This seems needlessly complicated, I agree you should wait with
>> calling qemu_be_is_fe_connected till the vm is running, but why not
>> simply use qemu_add_vm_change_state_handler for that, and in the
>> handler check for state == RUN_STATE_RUNNING ?
>
> If I do that I should register it on post load and unregister it after it's done

Why, you can simply always have it there:

1) All it will do is, if transitioning to running and qemu_be_is_fe_connected returns
true, call vmc_register_interface, which is protected against being called multiple
times and if qemu_be_is_fe_connected returns true the vmc should always be registered.

2) The code will call qemu_be_is_fe_connected whenever the state changes to RUNNING,
this happens on vm-start and post-migrate, on vm-start qemu_be_is_fe_connected will
always return 0, so the whole thing is a nop.

Regards,

Hans

  reply	other threads:[~2013-03-22  8:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20  9:55 [Qemu-devel] [PATCH v2 0/4] for spice post load char device hook Alon Levy
2013-03-20  9:55 ` [Qemu-devel] [PATCH 1/4] char: add a post_load callback Alon Levy
2013-03-20 13:08   ` Anthony Liguori
2013-03-20 16:59     ` Alon Levy
2013-03-21  6:53       ` Gerd Hoffmann
2013-03-21  8:54         ` Alon Levy
2013-03-20 17:05     ` Alon Levy
2013-03-20 18:59       ` Anthony Liguori
2013-03-21  8:27         ` Hans de Goede
2013-03-21  8:36           ` Hans de Goede
2013-03-21 16:35         ` [Qemu-devel] [PATCH v3 0/2] spice-qemu-char fix agent mouse after migration Alon Levy
2013-03-21 16:35           ` [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected Alon Levy
2013-03-21 18:18             ` Anthony Liguori
2013-03-21 18:35               ` Alon Levy
2013-03-21 19:24                 ` Anthony Liguori
2013-03-21 21:55                   ` Alon Levy
2013-03-21 22:05                     ` Alon Levy
2013-03-22  7:56               ` Hans de Goede
2013-03-22 13:50                 ` Anthony Liguori
2013-03-22 15:53                   ` Gerd Hoffmann
2013-03-22 16:50                   ` Hans de Goede
2013-03-22 17:11                     ` Anthony Liguori
2013-03-24 12:37                       ` Hans de Goede
2013-03-22  8:25               ` Gerd Hoffmann
2013-03-22  8:58                 ` Hans de Goede
2013-03-22 13:33                 ` Anthony Liguori
2013-03-21 16:35           ` [Qemu-devel] [PATCH 2/2] spice-qemu-char: register interface on post load Alon Levy
2013-03-22  8:07             ` Hans de Goede
2013-03-22  8:16               ` Alon Levy
2013-03-22  8:55                 ` Hans de Goede [this message]
2013-03-20  9:55 ` [Qemu-devel] [PATCH 2/4] virtio-serial: add a post_load callback implemented by port Alon Levy
2013-03-20  9:55 ` [Qemu-devel] [PATCH 3/4] virtio-console: implement post_load to call to qemu_chr_fe_post_load Alon Levy
2013-03-20  9:55 ` [Qemu-devel] [PATCH 4/4] spice-qemu-char: register interface on post load Alon Levy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=514C1C93.5060207@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=alevy@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=amit.shah@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.