qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [V5 PATCH 1/4] net: announce self after vm start


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [V5 PATCH 1/4] net: announce self after vm start
Date: Fri, 16 Mar 2012 10:43:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

Il 16/03/2012 09:54, Jason Wang ha scritto:
> qemu_announce_self() were moved to vm_start(). This is because we may
> want to let guest to send the gratuitous packets. After this change,
> we need to check the previous run state (RUN_STATE_INMIGRATE) to
> decide whether an announcement is needed.
> 
> Signed-off-by: Jason Wang <address@hidden>
> ---
>  migration.c |    1 -
>  vl.c        |    4 ++++
>  2 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/migration.c b/migration.c
> index 00fa1e3..1ce6b5c 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -88,7 +88,6 @@ void process_incoming_migration(QEMUFile *f)
>          fprintf(stderr, "load of migration failed\n");
>          exit(0);
>      }
> -    qemu_announce_self();
>      DPRINTF("successfully loaded vm state\n");
>  
>      /* Make sure all file formats flush their mutable metadata */
> diff --git a/vl.c b/vl.c
> index 65f11f2..4742b1b 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1261,11 +1261,15 @@ void vm_state_notify(int running, RunState state)
>  void vm_start(void)
>  {
>      if (!runstate_is_running()) {
> +        RunState prev_run_state = current_run_state;
>          cpu_enable_ticks();
>          runstate_set(RUN_STATE_RUNNING);
>          vm_state_notify(1, RUN_STATE_RUNNING);
>          resume_all_vcpus();
>          monitor_protocol_event(QEVENT_RESUME, NULL);
> +        if (prev_run_state == RUN_STATE_INMIGRATE) {
> +            qemu_announce_self();
> +        }
>      }
>  }
>  
> 

I tihnk this won't work with -S, did you test it?  Perhaps it's possible
simply to change

    if (autostart) {
        vm_start();
    } else {
        runstate_set(RUN_STATE_PRELAUNCH);
    }

to remain in INMIGRATE state:

    if (autostart) {
        vm_start();
    }

Otherwise looks good.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]