From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDcsn-0008RW-8A for qemu-devel@nongnu.org; Thu, 07 Mar 2013 10:37:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDcsh-0002kp-SL for qemu-devel@nongnu.org; Thu, 07 Mar 2013 10:37:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDcsh-0002kc-Kc for qemu-devel@nongnu.org; Thu, 07 Mar 2013 10:37:19 -0500 Message-ID: <5138B42D.3030800@redhat.com> Date: Thu, 07 Mar 2013 08:37:17 -0700 From: Eric Blake MIME-Version: 1.0 References: <1362644631-23113-1-git-send-email-jasowang@redhat.com> <1362644631-23113-2-git-send-email-jasowang@redhat.com> In-Reply-To: <1362644631-23113-2-git-send-email-jasowang@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2SNCSTXVPTVFTAOPEKWCU" Subject: Re: [Qemu-devel] [PATCH V7 1/5] runstate: introduce prelaunch-migrate state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: aliguori@us.ibm.com, mst@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, pbonzini@redhat.com, Jiri Denemark This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2SNCSTXVPTVFTAOPEKWCU Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/07/2013 01:23 AM, Jason Wang wrote: > Sometimes, we need track the state when guest is just about to start af= ter > migration. There's not a accurate state available which do this accurat= ely > (consider qemu may started with -S in destination). s/may/may be/ and yes, libvirt _always_ starts qemu with -S in the destination. >=20 > So this patch introduces a new state prelaunch-migrate which just track= s 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. >=20 > Signed-off-by: Jason Wang > --- > migration.c | 3 +-- > qapi-schema.json | 5 ++++- > vl.c | 4 +++- > 3 files changed, 8 insertions(+), 4 deletions(-) I'm not sure if this patch will have any negative effects on existing libvirt migration or state reporting; adding Jirka to cc. >=20 > 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 *op= aque) > /* Make sure all file formats flush their mutable metadata */ > bdrv_invalidate_cache_all(); > =20 > + runstate_set(RUN_STATE_PRELAUNCH_MIGRATE); > if (autostart) { > vm_start(); > - } else { > - runstate_set(RUN_STATE_PAUSED); > } > } > =20 > 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 t= riggered > +# > +# @migrate-prelaunch: migration is completed and QEMU were started wit= h -S s/were/was/ > ## > { 'enum': 'RunState', > 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'pause= d', > 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm'= , > - 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' = ] } > + 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',= > + 'prelaunch-migrate'] } > =20 > ## > # @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_transition= s_def[] =3D { > { RUN_STATE_DEBUG, RUN_STATE_RUNNING }, > =20 > { RUN_STATE_INMIGRATE, RUN_STATE_RUNNING }, > - { RUN_STATE_INMIGRATE, RUN_STATE_PAUSED }, > + { RUN_STATE_INMIGRATE, RUN_STATE_PRELAUNCH_MIGRATE }, > =20 > { RUN_STATE_INTERNAL_ERROR, RUN_STATE_PAUSED }, > { RUN_STATE_INTERNAL_ERROR, RUN_STATE_FINISH_MIGRATE }, > @@ -580,6 +580,8 @@ static const RunStateTransition runstate_transition= s_def[] =3D { > { RUN_STATE_WATCHDOG, RUN_STATE_RUNNING }, > { RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE }, > =20 > + { RUN_STATE_PRELAUNCH_MIGRATE, RUN_STATE_RUNNING }, > + > { RUN_STATE_MAX, RUN_STATE_MAX }, > }; > =20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2SNCSTXVPTVFTAOPEKWCU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJROLQtAAoJEKeha0olJ0NqaHcH/jC1U1EJihRYp7cmsgboOaZB D4plsSz5hoFiuTNoqIbzShm74m98p3W/WDGRh2TrQAKXMd6A63snpOrudKcdwDaN tcMXkNxDmw48ObaLLuU9gr6gnwYA2XVmvftzSmUPNMs4pOL82v4hD9Wst6iyAtH2 UOCXbctceyG272de6hKtx+9iAyc4KoJd07L5c/RQGGrKl2pr5cHJQAyzZDbnNKHC HsdNdDvEqSHzZKlT4dXuWyyhYP9ruAM9VdE6cEnjUyrkTYpxruEWzdUk6JMTxT0i xVIMLM+lfomSN3567XQZR0uwLQfVbB8FUS/4nwsrziTfZ2N29Mhf9n/J7Qihl20= =OyfC -----END PGP SIGNATURE----- ------enig2SNCSTXVPTVFTAOPEKWCU--