From: Eric Blake <eblake@redhat.com>
To: Md Haris Iqbal <haris.phnx@gmail.com>, qemu-devel@nongnu.org
Cc: dgilbert@redhat.com
Subject: Re: [Qemu-devel] [Qemu-devel [RFC] [WIP] v2] Keeping the Source side alive incase of network failure (Migration recovery from network failure)
Date: Wed, 8 Jun 2016 14:41:16 -0600 [thread overview]
Message-ID: <575882EC.1090906@redhat.com> (raw)
In-Reply-To: <1465409584-16308-1-git-send-email-haris.phnx@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5226 bytes --]
On 06/08/2016 12:13 PM, Md Haris Iqbal wrote:
The subject line is long, and has a typo (s/incase/in case/). Also, the
mailing list automatically prepends [Qemu-devel], so you shouldn't
repeat it manually. Better might have been a short subject line then a
longer commit body:
migration: keep source alive on network failure
Details about what was failing, and why this code improves it
Missing a Signed-off-by: attribution; without that, we can't take it.
> ---
You marked this patch as v2, but in the same minute sent another email
with subject line v1, and didn't say what changed to need a v2. Here
after the --- divider is a good place for that.
> include/migration/migration.h | 1 +
> migration/migration.c | 76 ++++++++++++++++++++++++++++++++++++++++---
> qapi-schema.json | 11 +++++--
> vl.c | 4 +++
> 4 files changed, 85 insertions(+), 7 deletions(-)
>
> @@ -1726,11 +1755,32 @@ static void *migration_thread(void *opaque)
> }
> }
>
> - if (qemu_file_get_error(s->to_dst_file)) {
> - migrate_set_state(&s->state, current_active_state,
> - MIGRATION_STATUS_FAILED);
> - trace_migration_thread_file_err();
> - break;
> + if ((ret = qemu_file_get_error(s->to_dst_file))) {
> + fprintf(stderr, "1 : Error %s %d\n", strerror(-ret), -ret);
fprintf() is rather awkward for errors; can we use qemu's Error mechanism?
> +
> + /* This check is based on how the error is set during the network
> + * recv(). When recv() returns 0 (i.e. no data to read), the error
> + * is set to -EIO. For all other network errors, it is set
> + * according to the return value received.
> + */
> + if (ret != -EIO && s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE) {
> + /* Network Failure during postcopy */
> +
> + current_active_state = MIGRATION_STATUS_POSTCOPY_RECOVERY;
> + runstate_set(RUN_STATE_POSTMIGRATE_RECOVERY);
> + fprintf(stderr, "1.1 : Error %s %d\n", strerror(-ret), -ret);
Does the end user really need to see "1.1 :"
> +++ b/qapi-schema.json
> @@ -154,12 +154,14 @@
> # @watchdog: the watchdog action is configured to pause and has been triggered
> #
> # @guest-panicked: guest has been panicked as a result of guest OS panic
> +#
> +# @postmigrate-recovery: guest is paused for recovery after a network failure
Not your fault that the overall enum is missing an overall line:
# Since: 1.4
nor that guest-panicked is missing a "(since 1.5)" hint, but at least
your addition should have a "(since 2.7)" hint.
> ##
> { 'enum': 'RunState',
> 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
> 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
> 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
> - 'guest-panicked' ] }
> + 'guest-panicked', 'postmigrate-recovery' ] }
Adding new enums can cause existing clients like libvirt to do weird
things if they aren't expecting the new state. Are we sure we want to do
it? Is it a state that cannot be entered by default, but only in
response to a client request that proves the client is new enough to
expect the new state?
>
> ##
> # @StatusInfo:
> @@ -434,12 +436,15 @@
> #
> # @failed: some error occurred during migration process.
> #
> +# @postcopy-recovery: in recovery mode, after a network failure.
> +#
Missing a "(since 2.7)" hint.
> # Since: 2.3
> #
> ##
> { 'enum': 'MigrationStatus',
> 'data': [ 'none', 'setup', 'cancelling', 'cancelled',
> - 'active', 'postcopy-active', 'completed', 'failed' ] }
> + 'active', 'postcopy-active', 'completed', 'failed',
> + 'postcopy-recovery' ] }
>
> ##
> # @MigrationInfo
> @@ -2058,6 +2063,8 @@
> #
> # @uri: the Uniform Resource Identifier of the destination VM
> #
> +# @recover: #optional recover from a broken migration
> +#
I don't see any 'recover' parameter added to the 'migrate' command to
match this added documentation.
> # @blk: #optional do block migration (full disk copy)
> #
> # @inc: #optional incremental disk copy migration
> diff --git a/vl.c b/vl.c
> index 5fd22cb..c237140 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -618,6 +618,10 @@ static const RunStateTransition runstate_transitions_def[] = {
> { RUN_STATE_FINISH_MIGRATE, RUN_STATE_RUNNING },
> { RUN_STATE_FINISH_MIGRATE, RUN_STATE_POSTMIGRATE },
> { RUN_STATE_FINISH_MIGRATE, RUN_STATE_PRELAUNCH },
> + { RUN_STATE_FINISH_MIGRATE, RUN_STATE_POSTMIGRATE_RECOVERY },
> +
> + { RUN_STATE_POSTMIGRATE_RECOVERY, RUN_STATE_FINISH_MIGRATE },
> + { RUN_STATE_POSTMIGRATE_RECOVERY, RUN_STATE_SHUTDOWN },
>
> { RUN_STATE_RESTORE_VM, RUN_STATE_RUNNING },
> { RUN_STATE_RESTORE_VM, RUN_STATE_PRELAUNCH },
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-06-08 20:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-08 18:13 [Qemu-devel] [Qemu-devel [RFC] [WIP] v2] Keeping the Source side alive incase of network failure (Migration recovery from network failure) Md Haris Iqbal
2016-06-08 20:41 ` Eric Blake [this message]
2016-06-13 6:38 ` haris iqbal
2016-06-13 15:38 ` Eric Blake
2016-06-15 13:03 ` Dr. David Alan Gilbert
2016-06-15 13:10 ` Eric Blake
2016-06-15 13:02 ` Dr. David Alan Gilbert
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=575882EC.1090906@redhat.com \
--to=eblake@redhat.com \
--cc=dgilbert@redhat.com \
--cc=haris.phnx@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.