From nobody Wed Oct 22 04:13:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519836764854657.489915577259; Wed, 28 Feb 2018 08:52:44 -0800 (PST) Received: from localhost ([::1]:45524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er4yB-0003kC-O1 for importer@patchew.org; Wed, 28 Feb 2018 11:52:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er4vX-0001md-6I for qemu-devel@nongnu.org; Wed, 28 Feb 2018 11:50:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er4vU-0007nX-3C for qemu-devel@nongnu.org; Wed, 28 Feb 2018 11:49:59 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39830 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1er4vT-0007n1-UN for qemu-devel@nongnu.org; Wed, 28 Feb 2018 11:49:56 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 86CBC402290A for ; Wed, 28 Feb 2018 16:49:44 +0000 (UTC) Received: from dgilbert-t530.redhat.com (unknown [10.36.118.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id C952F9C04D; Wed, 28 Feb 2018 16:49:37 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Wed, 28 Feb 2018 16:49:37 +0000 Message-Id: <20180228164937.18450-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 28 Feb 2018 16:49:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 28 Feb 2018 16:49:44 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH] migration: Fix block failure cases X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" 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=3D1550022 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 --- 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, boo= l blk, return; } migrate_set_block_enabled(true, &local_err); + s->must_remove_block_options =3D true; if (local_err) { error_propagate(errp, local_err); + block_cleanup_parameters(s); return; } - s->must_remove_block_options =3D true; } =20 if (has_inc && inc) { @@ -1417,11 +1418,10 @@ void qmp_migrate(const char *uri, bool has_blk, boo= l 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; } =20 if (local_err) { --=20 2.14.3