[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] migration: notify runstate immediately before v
From: |
Yan Zhao |
Subject: |
Re: [Qemu-devel] [PATCH] migration: notify runstate immediately before vcpu stops |
Date: |
Thu, 25 Jul 2019 20:12:52 -0400 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Thu, Jul 25, 2019 at 06:39:07PM +0800, Dr. David Alan Gilbert wrote:
> * Yan Zhao (address@hidden) wrote:
> > for some devices to do live migration, it is needed to do something
> > immediately before vcpu stops. add a notification here.
> >
> > Signed-off-by: Yan Zhao <address@hidden>
> > ---
> > cpus.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/cpus.c b/cpus.c
> > index b09b702..d5d4abe 100644
> > --- a/cpus.c
> > +++ b/cpus.c
> > @@ -1068,6 +1068,7 @@ static int do_vm_stop(RunState state, bool send_stop)
> > int ret = 0;
> >
> > if (runstate_is_running()) {
> > + vm_state_notify(1, state);
>
> SO that's quite interesting in that you'll end up getting a
> notificatiion like 'running=true, state=RUN_STATE_SHUTDOWN'
> that might be unexpected by existing callers.
>
> Have you checked existing callers? Also does this cause another event
> to be sent on the QMP - if so we need to chekc if this would confuse
> libvirt.
>
> Dave
hi Dave
yes, this may cause problem for existing handlers as this is an
unexpected condition. like for ide's ide_restart_cb.
So, do you think it's a better that do the notification earlier, before
vm_stop_force_state() in migration.c and call
notifier_list_notify(&migration_state_notifiers, s)
to notify migration state instead ?
Thanks
Yan
>
> > cpu_disable_ticks();
> > pause_all_vcpus();
> > runstate_set(state);
> > --
> > 2.7.4
> >
> --
> Dr. David Alan Gilbert / address@hidden / Manchester, UK
Re: [Qemu-devel] [PATCH] migration: notify runstate immediately before vcpu stops, no-reply, 2019/07/17
Re: [Qemu-devel] [PATCH] migration: notify runstate immediately before vcpu stops, Dr. David Alan Gilbert, 2019/07/25
- Re: [Qemu-devel] [PATCH] migration: notify runstate immediately before vcpu stops,
Yan Zhao <=