qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: aliguori@us.ibm.com, pbonzini@redhat.com, owasserm@redhat.com,
	qemu-devel@nongnu.org
Cc: Jason Wang <jasowang@redhat.com>, mst@redhat.com
Subject: [Qemu-devel] [PATCH V7 1/5] runstate: introduce prelaunch-migrate state
Date: Thu,  7 Mar 2013 16:23:47 +0800	[thread overview]
Message-ID: <1362644631-23113-2-git-send-email-jasowang@redhat.com> (raw)
In-Reply-To: <1362644631-23113-1-git-send-email-jasowang@redhat.com>

Sometimes, we need track the state when guest is just about to start after
migration. There's not a accurate state available which do this accurately
(consider qemu may started with -S in destination).

So this patch introduces a new state prelaunch-migrate which just tracks this
state, it covers the case both w/ and w/o -S in destination. The first user of
this is the support of doing announce by guest.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 migration.c      |    3 +--
 qapi-schema.json |    5 ++++-
 vl.c             |    4 +++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/migration.c b/migration.c
index 11725ae..ecdf2c5 100644
--- a/migration.c
+++ b/migration.c
@@ -107,10 +107,9 @@ static void process_incoming_migration_co(void *opaque)
     /* Make sure all file formats flush their mutable metadata */
     bdrv_invalidate_cache_all();
 
+    runstate_set(RUN_STATE_PRELAUNCH_MIGRATE);
     if (autostart) {
         vm_start();
-    } else {
-        runstate_set(RUN_STATE_PAUSED);
     }
 }
 
diff --git a/qapi-schema.json b/qapi-schema.json
index 28b070f..baa6361 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -174,11 +174,14 @@
 # @suspended: guest is suspended (ACPI S3)
 #
 # @watchdog: the watchdog action is configured to pause and has been triggered
+#
+# @migrate-prelaunch: migration is completed and QEMU were started with -S
 ##
 { 'enum': 'RunState',
   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
-            'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
+            'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
+            'prelaunch-migrate'] }
 
 ##
 # @SnapshotInfo
diff --git a/vl.c b/vl.c
index c03edf1..5dd2e0e 100644
--- a/vl.c
+++ b/vl.c
@@ -534,7 +534,7 @@ static const RunStateTransition runstate_transitions_def[] = {
     { RUN_STATE_DEBUG, RUN_STATE_RUNNING },
 
     { RUN_STATE_INMIGRATE, RUN_STATE_RUNNING },
-    { RUN_STATE_INMIGRATE, RUN_STATE_PAUSED },
+    { RUN_STATE_INMIGRATE, RUN_STATE_PRELAUNCH_MIGRATE },
 
     { RUN_STATE_INTERNAL_ERROR, RUN_STATE_PAUSED },
     { RUN_STATE_INTERNAL_ERROR, RUN_STATE_FINISH_MIGRATE },
@@ -580,6 +580,8 @@ static const RunStateTransition runstate_transitions_def[] = {
     { RUN_STATE_WATCHDOG, RUN_STATE_RUNNING },
     { RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE },
 
+    { RUN_STATE_PRELAUNCH_MIGRATE, RUN_STATE_RUNNING },
+
     { RUN_STATE_MAX, RUN_STATE_MAX },
 };
 
-- 
1.7.1

  reply	other threads:[~2013-03-07  8:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07  8:23 [Qemu-devel] [PATCH V7 0/5] Send the gratuitous by guest Jason Wang
2013-03-07  8:23 ` Jason Wang [this message]
2013-03-07 15:37   ` [Qemu-devel] [PATCH V7 1/5] runstate: introduce prelaunch-migrate state Eric Blake
2013-03-11 14:31     ` Jiri Denemark
2013-03-12  3:09       ` Jason Wang
2013-03-07  8:23 ` [Qemu-devel] [PATCH V7 2/5] net: announce self after vm is started Jason Wang
2013-03-07  8:23 ` [Qemu-devel] [PATCH V7 3/5] net: model specific announcing support Jason Wang
2013-03-07  8:23 ` [Qemu-devel] [PATCH V7 4/5] virtio-net: notify guest to annouce itself Jason Wang
2013-03-07  8:23 ` [Qemu-devel] [PATCH V7 5/5] virtio-net: compat guest announce Jason Wang
2013-03-07 10:04 ` [Qemu-devel] [PATCH V7 0/5] Send the gratuitous by guest Michael S. Tsirkin
2013-03-07 10:13   ` Jason Wang
2013-03-07 10:25     ` Michael S. Tsirkin
2013-03-07 10:33       ` Jason Wang
2013-03-07 10:52         ` Michael S. Tsirkin
2013-03-08  3:41           ` Jason Wang
2013-03-08 11:03           ` Stefan Hajnoczi
2013-03-11  7:45             ` Jason Wang

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=1362644631-23113-2-git-send-email-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=mst@redhat.com \
    --cc=owasserm@redhat.com \
    --cc=pbonzini@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 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).