All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com
Cc: peterx@redhat.com
Subject: [Qemu-devel] [PATCH] migration: Fix block failure cases
Date: Wed, 28 Feb 2018 16:49:37 +0000	[thread overview]
Message-ID: <20180228164937.18450-1-dgilbert@redhat.com> (raw)

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

This fixes a couple of cases where the block migration capability
doesn't get cleared when a migration failed.

1) When block migration is compiled out:
  (qemu) migrate -d -b  "exec:cat > /dev/null"
  QEMU compiled without old-style (blk/-b, inc/-i) block migration
  Use drive_mirror+NBD instead.
  (qemu) migrate_set_capability xbzrle off
  QEMU compiled without old-style (blk/-b, inc/-i) block migration
  Use drive_mirror+NBD instead.

  This corresponds to https://bugzilla.redhat.com/show_bug.cgi?id=1550022

2) When a migration with a bad protocol is tried:
  (qemu) migrate -d -b "foo:bah"
  Parameter 'uri' expects a valid migration protocol
  (qemu) info migrate_capabilities
  xbzrle: off
  rdma-pin-all: off
  auto-converge: off
  zero-blocks: off
  compress: off
  events: off
  postcopy-ram: off
  x-colo: off
  release-ram: off
  block: on   <<<<<<-----
  return-path: off
  pause-before-switchover: off
  x-multifd: off

Fixes: 2833c59b947
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/migration.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index b913b98803..da0e4a1f56 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1391,11 +1391,12 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
             return;
         }
         migrate_set_block_enabled(true, &local_err);
+        s->must_remove_block_options = true;
         if (local_err) {
             error_propagate(errp, local_err);
+            block_cleanup_parameters(s);
             return;
         }
-        s->must_remove_block_options = true;
     }
 
     if (has_inc && inc) {
@@ -1417,11 +1418,10 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
     } else if (strstart(uri, "fd:", &p)) {
         fd_start_outgoing_migration(s, p, &local_err);
     } else {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "uri",
+        error_setg(&local_err, QERR_INVALID_PARAMETER_VALUE, "uri",
                    "a valid migration protocol");
         migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,
                           MIGRATION_STATUS_FAILED);
-        return;
     }
 
     if (local_err) {
-- 
2.14.3

             reply	other threads:[~2018-02-28 16:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28 16:49 Dr. David Alan Gilbert (git) [this message]
2018-03-01  7:01 ` [Qemu-devel] [PATCH] migration: Fix block failure cases Peter Xu
2018-03-01 15:32   ` Dr. David Alan Gilbert
2018-03-02  3:43     ` Peter Xu

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=20180228164937.18450-1-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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 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.