qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com,
	quintela@redhat.com, rusty@rustcorp.com.au,
	qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [V5 PATCH 1/4] net: announce self after vm start
Date: Fri, 16 Mar 2012 18:13:46 +0800	[thread overview]
Message-ID: <4F63125A.1020005@redhat.com> (raw)
In-Reply-To: <4F630B44.5000102@redhat.com>

On 03/16/2012 05:43 PM, Paolo Bonzini wrote:
> 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<jasowang@redhat.com>
>> ---
>>   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

Yes, it does not work.
>
>      if (autostart) {
>          vm_start();
>      } else {
>          runstate_set(RUN_STATE_PRELAUNCH);
>      }
>
> to remain in INMIGRATE state:
>
>      if (autostart) {
>          vm_start();
>      }
>
> Otherwise looks good.
>
> Paolo

The problem with staying in the INMIGRATE is that we can not figure out 
when the migration is completed when using '-S', so this kind of 
transition were forbidden by qmp_cont().

Looks like we need a new state such as RUN_STATE_MIGRATE_PRELAUNCH?

  reply	other threads:[~2012-03-16 10:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16  8:54 [Qemu-devel] [V5 PATCH 0/4] Send gratuitous packets by guest Jason Wang
2012-03-16  8:54 ` [Qemu-devel] [V5 PATCH 1/4] net: announce self after vm start Jason Wang
2012-03-16  9:43   ` Paolo Bonzini
2012-03-16 10:13     ` Jason Wang [this message]
2012-03-16 10:45       ` Paolo Bonzini
2012-03-16 15:23         ` Jason Wang
2012-03-16 16:31           ` Paolo Bonzini
2012-03-19  3:12             ` Jason Wang
2012-03-16  8:55 ` [Qemu-devel] [V5 PATCH 2/4] net: model specific announcing support Jason Wang
2012-03-16  8:55 ` [Qemu-devel] [V5 PATCH 3/4] virtio-net: notify guest to annouce itself Jason Wang
2012-03-16  8:55 ` [Qemu-devel] [V5 PATCH 4/4] virtio-net: compat guest announce support Jason Wang
2012-03-26 22:10 ` [Qemu-devel] [V5 PATCH 0/4] Send gratuitous packets by guest Anthony Liguori
2012-03-27  3:40   ` Jason Wang
2012-03-27  6:27   ` Michael S. Tsirkin

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=4F63125A.1020005@redhat.com \
    --to=jasowang@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=stefanha@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).