From patchwork Tue May 23 12:46:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tejus GK X-Patchwork-Id: 13252215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A091C7EE29 for ; Tue, 23 May 2023 12:48:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RQU-0004kV-UN; Tue, 23 May 2023 08:47:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RQF-0004gQ-6M for qemu-devel@nongnu.org; Tue, 23 May 2023 08:47:33 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RQB-0004bT-1p for qemu-devel@nongnu.org; Tue, 23 May 2023 08:47:26 -0400 Received: from pps.filterd (m0127842.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34N8Asth032137; Tue, 23 May 2023 05:46:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=proofpoint20171006; bh=uidLayVHGkqUp/Z9uXDjuOaz/NWr/n1hNkl1famAGHc=; b=bAAnfcR1dP5wZelEEWyyFBblAaczpxd46Xjg+FEvOUrK9mBnmr+VmwqQ/b3tDzipwu4p npU/2fNakfWm/KZxjENXng0EzYKQan6Fr+SCc7gNrfBpicHL2MaJWwYhZKdiabW8K07n PzJCofl1+2X6qv9FCO7UD/imoEdoGiB9LOvkGUOrmcbIvaf04nhm3OoVQDqYCOmj87N6 kWNbj7ZCL4sWpcenWsbX083TJbwD2kZn1p0Gx0F3mgL8KqzclqNXP0kprNsV/VM7En/y ieLH4k5FzZ57ySjoWLeMUJCPE+noGUBRDbT0xFB9sJu9rjiXZ6yiMIAT00mx6eFD5hcD CQ== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qpwhce0bv-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 May 2023 05:46:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q1vWiJ392I49yM1LzWnXOBlWPnhZlXrVgznmE5sX+OmjdEG2iAYGhDh8/Z5kzO1toUC2DFTkB2XdbJf8I3Hy3AitRD9xRdpnXcBMKXet3cCeGm+Zb3bLB850ZoNUfOcsrwhZZlANtbSw9K7ljwc8cXbUZwuHYO/r2dUk0aDgUO7xb9nfxEf5zj8anwmdmxMtYR6JD0+OPbe/Lki1/UUad0SHTKtZwQyZq0b5FhdFO744zW5HmzuNn8trr5b3hL56i2dbBYBjq7dZW16BvUKFDfIC2pFftXmQlHDB5xkgG9dhsVRQ4ZkYBu8EpNbnJL597LmxghF84+KyHvV9OQzLiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uidLayVHGkqUp/Z9uXDjuOaz/NWr/n1hNkl1famAGHc=; b=gQ4zCWeruBXpOv2AsSuM1niNixVBqXuWs+CTX6dLclWOOtujbnvof8SG+d73qrFXymJ5N+/XsPAGF3+JPXYklYPze7kpwmwnyXbUmkUBREbfiVxObkEuAMvlk9a4MBDKmL0qxkEgyXkBIP/2b04bAvpa6LB86lqi/OlLEBmaS0SVluVaOijOQTyOn3M0ODFaQZRHWL0fmItS1CDmrSyx2l6AbSVo3LJUuziQM1vOmDmW/OqTWhp+uAgFJm/ZCIZUqaBsE+YHoF+/pgSbcGyi5b6yck8rWlaYy+TPoxde3mDnClyxORZc+7UTF0vUSBdCdBspAY1UhDgNNBX3ZgEffg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uidLayVHGkqUp/Z9uXDjuOaz/NWr/n1hNkl1famAGHc=; b=y2OoOWfdRjSOWZENvFaNv50no708hwkZbL9Nu0u7GGiR0lTGuo4MQnyrhQtpJY4yth99J1qw0OmYfVB2n0JW50hYjp2azkFLicGZf1PtJjSRfGOhoFtyIZJ3b3pNobuZkTGorwF/PunPAMNYM03VefPvAHKKu6wQ8nyKunmP9ZEUeVp1knGG0K+EEj8pYXd7MQVjPpdlL9rVeeT6UbKr5a5CL09GFx4EAPC0QVUFdNh3HaWovS3fySXL9ugYBG/unuBJ2RmCwxp7ICEBEl9sk6czjlFlcirrlC8sVpua+i5kt1ZLEk9yDtlS3Or1rwSNXphI9vElAlGjM7GxcohlJA== Received: from BYAPR02MB4806.namprd02.prod.outlook.com (2603:10b6:a03:42::30) by CH3PR02MB9516.namprd02.prod.outlook.com (2603:10b6:610:12a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 12:46:54 +0000 Received: from BYAPR02MB4806.namprd02.prod.outlook.com ([fe80::cad7:83e8:9ee:87d1]) by BYAPR02MB4806.namprd02.prod.outlook.com ([fe80::cad7:83e8:9ee:87d1%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 12:46:54 +0000 From: Tejus GK To: qemu-devel@nongnu.org Cc: quintela@redhat.com, peterx@redhat.com, leobras@redhat.com, berrange@redhat.com, ahv-india-host@nutanix.com, Tejus GK Subject: [PATCH v4 1/2] migration: Update error description whenever migration fails Date: Tue, 23 May 2023 12:46:37 +0000 Message-Id: <20230523124638.16270-2-tejus.gk@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230523124638.16270-1-tejus.gk@nutanix.com> References: <20230523124638.16270-1-tejus.gk@nutanix.com> X-ClientProxiedBy: SJ0PR13CA0225.namprd13.prod.outlook.com (2603:10b6:a03:2c1::20) To BYAPR02MB4806.namprd02.prod.outlook.com (2603:10b6:a03:42::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4806:EE_|CH3PR02MB9516:EE_ X-MS-Office365-Filtering-Correlation-Id: fac7d472-5be7-41d5-478e-08db5b8bc8e0 x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tIIcBN8Hjy47UmKo6TGXKMI4swnzJn+vvGs3eI/O3oNBJ34F0KIu5OU1e4Zaz+3IrJd5j9hS1Qk6FSinnHRfjIUlWDoQZ0qUb6O8qCwXJbEMmnNRokvh1HqdDrPX5jRiWNVXpfH8G1iuiHf3Qd5/OWmwJ/ZMQfcHXZymMgLya+rDcphx4Co3YSSK4My5RfSE6aNJIEAQRKr79+ak8F7zw3x3PhxtzAxL0KQVtGmDrw6ch4Y4N2MGxlwHOYNdgqkYj3gsqD0IvlIHOKbkT+NZRMK0dQvULrNfbq4MhJzHCk1ni9McG59Q1KIl4d9RjqRA0SZVFq4xsppNOOBa395zeM/KWJmAwtzXl72LRCUHRefR8uxghW3LbsBDzdWXLIETV+ucQjSKW1A1FS7kO0rQ/5fiUlOaaz5VhXT1XuoBpQuOO/o2jCIfg5JZWmup1rpOeNfRp6bIDsYEmQftdZheYSVmbOdbu7+piJENWrzOJo+Z0Mbyv06WV3GyZBEzdQhF7X1yf0HREwwuGXA+/ym+xB42H7AdapXtw3p1sXdW/bP9H3pdgXNhwwlHd6qSmiE16cZiXB+LarhnkFORSelk9RZxgaSWTxTH5pXZIoAAl4Y9HmXG7YeeIeH3HOH2DeB0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4806.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(396003)(346002)(39860400002)(136003)(366004)(451199021)(52116002)(8676002)(8936002)(5660300002)(86362001)(6506007)(26005)(1076003)(6512007)(83380400001)(2616005)(2906002)(36756003)(186003)(107886003)(15650500001)(66476007)(66556008)(4326008)(6916009)(66946007)(316002)(478600001)(38350700002)(38100700002)(6486002)(41300700001)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?iipW2Zk5PTe3alYvLKdtzp8ad3ZO?= =?utf-8?q?Or6pZEtg+pf7anDkQ6+L/kdbdFPg08zBf0K3CpTFP3BXMU31TKpc8aXbu5hzss0k3?= =?utf-8?q?1AbHLT9aMphDqwiR6Saq+OaxPrgRwPRPuOB2nrku49GF+pmm/swb4f/N+u8Ngy2wh?= =?utf-8?q?Kk8pPGt4fzDAtKSAUkHyiKI5gji7UYUi9IRG0Znd0tN2Aui0k82zkZUa8SeDfyMc0?= =?utf-8?q?3EpXq16656khQB9CZRKP+ny/If7SATqAxhTf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3ib1uHlKR8buR26qPtX0i1ex+7o?= =?utf-8?q?KLzSURW4aMXeaRem7bMMD5/GVempRXruDuQ3CQzA7tIPvuKJ2yYcd2xKS8HEaOIxR?= =?utf-8?q?NRbCys1erbEbcgPoj7N78RTVuBH1lWJKOyj1/rPwtU60BRBtw676OtBlJp1Mn38ch?= =?utf-8?q?hA6WLEXT0PutzgeYOPG5OALTz6tUWutRO3iWkjZHHSk2GmXhVjgJZ4yXp+Ma6xZvW?= =?utf-8?q?Gk0dG6l9Yivr+ndcl2LozUyd6JwpbJPX6UzO46oe5C4neTHNAKEoumZNfinRj9QOQ?= =?utf-8?q?xQ1ja+20LSfnMfqgMVLGITlc+vRJ8Ob41uG1S91z/bRBvtkcd7XzTj9Qg2cc0gb2T?= =?utf-8?q?jNvS4eixCOoxwz+zoKa1YOSNu+e628KoB0LtvpGoFoopLnO8rZYoqb3ETOI09mb9Y?= =?utf-8?q?bhm5AO6Vf8QY?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: fac7d472-5be7-41d5-478e-08db5b8bc8e0 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4806.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 12:46:53.3308 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g755RU6WxttdNhY5YqIhGeklvQ9ut6ZUw85OuJF5ASDnpizC5PRYCCS/MLxJUDnaOAJXiZBshv3GSoBfZ1nbsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR02MB9516 X-Proofpoint-ORIG-GUID: haVZtxdNvJ1xxJ6rUJnINYUxyP1a8YBv X-Proofpoint-GUID: haVZtxdNvJ1xxJ6rUJnINYUxyP1a8YBv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_08,2023-05-23_02,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.155.12; envelope-from=tejus.gk@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org There are places in migration.c where the migration is marked failed with MIGRATION_STATUS_FAILED, but the failure reason is never updated. Hence libvirt doesn't know why the migration failed when it queries for it. Reviewed-by: Daniel P. Berrangé Signed-off-by: Tejus GK --- migration/migration.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5de7f734b9..161d4e9a71 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1666,7 +1666,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, if (!(has_resume && resume)) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); } - 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); @@ -2053,7 +2053,7 @@ migration_wait_main_channel(MigrationState *ms) * Switch from normal iteration to postcopy * Returns non-0 on error */ -static int postcopy_start(MigrationState *ms) +static int postcopy_start(MigrationState *ms, Error **errp) { int ret; QIOChannelBuffer *bioc; @@ -2163,7 +2163,7 @@ static int postcopy_start(MigrationState *ms) */ ret = qemu_file_get_error(ms->to_dst_file); if (ret) { - error_report("postcopy_start: Migration stream errored (pre package)"); + error_setg(errp, "postcopy_start: Migration stream errored (pre package)"); goto fail_closefb; } @@ -2200,7 +2200,7 @@ static int postcopy_start(MigrationState *ms) ret = qemu_file_get_error(ms->to_dst_file); if (ret) { - error_report("postcopy_start: Migration stream errored"); + error_setg(errp, "postcopy_start: Migration stream errored"); migrate_set_state(&ms->state, MIGRATION_STATUS_POSTCOPY_ACTIVE, MIGRATION_STATUS_FAILED); } @@ -2714,6 +2714,7 @@ typedef enum { static MigIterateState migration_iteration_run(MigrationState *s) { uint64_t must_precopy, can_postcopy; + Error *local_err = NULL; bool in_postcopy = s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE; qemu_savevm_state_pending_estimate(&must_precopy, &can_postcopy); @@ -2736,8 +2737,9 @@ static MigIterateState migration_iteration_run(MigrationState *s) /* Still a significant amount to transfer */ if (!in_postcopy && must_precopy <= s->threshold_size && qatomic_read(&s->start_postcopy)) { - if (postcopy_start(s)) { - error_report("%s: postcopy failed to start", __func__); + if (postcopy_start(s, &local_err)) { + migrate_set_error(s, local_err); + error_report_err(local_err); } return MIG_ITERATE_SKIP; } @@ -3223,8 +3225,10 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) */ if (migrate_postcopy_ram() || migrate_return_path()) { if (open_return_path_on_source(s, !resume)) { - error_report("Unable to open return-path for postcopy"); + error_setg(&local_err, "Unable to open return-path for postcopy"); migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED); + migrate_set_error(s, local_err); + error_report_err(local_err); migrate_fd_cleanup(s); return; } @@ -3248,6 +3252,7 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) } if (multifd_save_setup(&local_err) != 0) { + migrate_set_error(s, local_err); error_report_err(local_err); migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); From patchwork Tue May 23 12:46:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tejus GK X-Patchwork-Id: 13252216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CAC9C7EE23 for ; Tue, 23 May 2023 12:48:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RQV-0004kl-Mt; Tue, 23 May 2023 08:47:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RQB-0004fl-AV for qemu-devel@nongnu.org; Tue, 23 May 2023 08:47:29 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RQ3-0004bO-MF for qemu-devel@nongnu.org; Tue, 23 May 2023 08:47:20 -0400 Received: from pps.filterd (m0127842.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34N8Astg032137; Tue, 23 May 2023 05:46:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=proofpoint20171006; bh=vJOG/bH4aIXQQiO5usbI34Y3EmVFnDNLW2cGJEnly+I=; b=e4Vnru6YRWhNPY9/Skak0kKLyOWKmU5D2A58H5+ZQK53IGjDqC62pHX4AqgVNdVTYHPd EF5l90WwmoJCv3iVDP1ltOUi7sqBk38msJU/wDKKTFAUfe8BU+axG4RpUkBs1SDQlJIm kavZb208J89nmNNE/H7SuJmof2BjxW/rP0beuRK3gOYv7tB+ou43sKZTblazuLREJ3DR vDf7eZO1XFS3guhN6Y7tQ1WuTD/FqTiWXBu3HG2mMg5SBGHj5IlEe7zI69CN5Hlzqp5P +uHa0CvpUZkz3LRy3vmaRsf55Dmv5PG6q+VyiaFnZ4c10x1zYJv6Z4rQxXpNiaUpxLH4 8w== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qpwhce0bv-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 May 2023 05:46:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XNWE+s5KR0xuh3o1gx6B/5pm7SJLCRxDNVS9J9E+vMAZ30IQAELQOa9cx96p3FmDMejSkuTXHiSDHMok/n7YOPSp6oJnihwQE1GX7Kk5b92hxn100YnR4pz2a6yUfd/3lWrx1BZdRxcVj/cOhCk8aZ03DPPjzaGGiKBdG7yx8MJCBQPVxSz0V8bxBlL+EmEkKUzBiPgvkLVqJSqAUYvDKirq7/ZC8ag1hJtGCAgQw6Umu5aDjm0szrfSRR551C+mJzrLNktMixCmL9cZTkT/tBQ6v3yJnsAnuuKeezQ/uxWsDkoeTGp8wsWirlVsDExBWofxRzL/wVPGkZF7wzs7iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vJOG/bH4aIXQQiO5usbI34Y3EmVFnDNLW2cGJEnly+I=; b=WofgMqwf1aXhnou3JqnsgopZPsU7NFyLpRvPgQt9ihPO/1rGX/r6pFnPiBgbUT+013xKe0AEzCvT1LInb7dOcbuZY+aD/EQqOrvoTygT/g5CcmWgPo+X4xlW6dggaxipgLFhZcP0DaohX2XDmcShpmT587s8WWfs4xGNWTNi8jY6twQQnl7vSkVN4FRpNUXK8AztVD1D1+Qc1CdIMmpslzzyqopO2nZ5+9juBu5apXBn/ixz64V8kR9O9J/whruXKUH+0t4NjJeKHa1+eKkbG8LdXBKJJEaLmMfxwkE7HA2FVPxNUabIr48/Det8zETupiPDVKntYnX2pvOOAHbHxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vJOG/bH4aIXQQiO5usbI34Y3EmVFnDNLW2cGJEnly+I=; b=p2+XY8nOWHK3gYFQ0LCFcZQhi9NeFHReZe+db5rJG33udoF4Js2yPqsvoJpRt2eEWJ12PryoClmzGU8ZAgGUjZ7yvRfasyWKp8oZEx5vVEeGDsy8jivP+sYfq4vNUZ4FhNc+8/zR0sRIf2ksrOc4gxmsoOw6pxct8iqRvBUkmCQD+nq5uKUqovSUIBBKeP1UINnIDcVcll7c77uGod7lDyLftLKc6dwVgCDv0+/czKgYujycusl3BeIbUNhg9o9Zp8zTL2HfAA2fHSIR5D+O2RjtZp5gXSqchBgMw+lQ+Mj4nREBFRM0D2402+aJOxspz/itMka6sEmgG+r7p58q8Q== Received: from BYAPR02MB4806.namprd02.prod.outlook.com (2603:10b6:a03:42::30) by CH3PR02MB9516.namprd02.prod.outlook.com (2603:10b6:610:12a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 12:46:54 +0000 Received: from BYAPR02MB4806.namprd02.prod.outlook.com ([fe80::cad7:83e8:9ee:87d1]) by BYAPR02MB4806.namprd02.prod.outlook.com ([fe80::cad7:83e8:9ee:87d1%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 12:46:54 +0000 From: Tejus GK To: qemu-devel@nongnu.org Cc: quintela@redhat.com, peterx@redhat.com, leobras@redhat.com, berrange@redhat.com, ahv-india-host@nutanix.com, Tejus GK Subject: [PATCH v4 2/2] migration: Refactor repeated call of yank_unregister_instance Date: Tue, 23 May 2023 12:46:38 +0000 Message-Id: <20230523124638.16270-3-tejus.gk@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230523124638.16270-1-tejus.gk@nutanix.com> References: <20230523124638.16270-1-tejus.gk@nutanix.com> X-ClientProxiedBy: SJ0PR13CA0225.namprd13.prod.outlook.com (2603:10b6:a03:2c1::20) To BYAPR02MB4806.namprd02.prod.outlook.com (2603:10b6:a03:42::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4806:EE_|CH3PR02MB9516:EE_ X-MS-Office365-Filtering-Correlation-Id: e5992089-2711-4e0c-6a87-08db5b8bc925 x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T/N+dpR6elBhtnvoi1MZvnJTjthykIoB8koAP5ZXBSYk1/ANr+e0xyT1tIk4AR+G23araxiXpJmp5nwibrH39nGj/FiIySBdmnJU1TZwfatKNck6w1+uOvr09Qig54n/O+QHLowBPyRKUoR61Ize7EZMB8u6jyHzvJfFQEj7yCjRpmcGHIVkRRcANEycFOfLs20yzWBWYYAXZD/A3fYpElq0V62r7idL5NphjzmOlmpVuOZhRbxj3ZQhzSwiFNMLPipdoUGeWikcC72euuAf1cC4/xo+eJsL20A/PQHK09Occk0RaT4mpozRZdUmfCkYX7ClLPCNf8s/un6es1H7b3E4xr/2LclnkLHOOzZERTxEcYO7hZBBB1rrJgl6TKfJIJo2oJFfF44g5KRZZ45VjwBb8kAzz+33rIXGG+aj6aOzEXe4nUvgewrH8ftvpMVWcfdAPaSO60ufK6r4+QsVYhFpqYgYvs+0O2O9YmLH4/Re6zl9ENVDOwk3qP4GAg1vQY0v/x7i07Szvxt2w1TyPm89zWIyE00O+F//BQJ1TxLq3me1rJGqBjTH2/NqzxPVgro+SXPoqPex8Zo44XPwj0BpZDYrSJoFo2KjXi2lq6Va8xEurCGIrXHhclxUuaCs X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4806.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(396003)(346002)(39860400002)(136003)(366004)(451199021)(52116002)(8676002)(8936002)(5660300002)(86362001)(6506007)(26005)(1076003)(6512007)(83380400001)(2616005)(2906002)(36756003)(186003)(107886003)(66476007)(66556008)(4326008)(6916009)(66946007)(316002)(478600001)(38350700002)(38100700002)(6486002)(41300700001)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?EnO49O9vi/CCbew+3ckI2eyuDXSK?= =?utf-8?q?13klfGSse3J0GkU2z8gBrRozpx0DOxlu9apLbXBbbodShLiPKoVO2XxWfOVAxPFGE?= =?utf-8?q?bczGFUNxc1CHMrBGYv1Ddk3K3qgE8MrLk0tQevhS+hj2cSZacoNUfz0eCDFw7SL2b?= =?utf-8?q?60mrv3LIMz7FDqfGIDh17enUI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vCsOBOTS+T7noynYW8uXLJI4ghgbf35aOVMjvmjQtcv?= =?utf-8?q?vkCf2Ms+v6C2VeQcTai+Pdp7G10nKAEUc2ZAhiTxhkFSYLUMyG1bvW4e/QmF2TjkQ?= =?utf-8?q?43A+NHIYE7bdGIwyCNVl4DLg/YHEBNXkOMffChzU3IbynrvwvSxfMThdzRGppPvlS?= =?utf-8?q?PS7EC5+9HuD0aAT4TcubW41QbVCI/RGf8Bx9SAcyeU0Z+05fntbdCbdBuuzrxm5yS?= =?utf-8?q?oHCh9BPJtdo6pXg6GfttAo9c7icOw8+zFVHfNkt4CPQqimrxKWD4qtk4fIpZ6eD8d?= =?utf-8?q?Qr6QKix/6fUsoHabG/Zt/o9GpdZTsLdJ1Ve14ewefAh9P2rEGbNvhWyItaHTQCQQM?= =?utf-8?q?gvwYpfYAsL1U1cvt7CU3N1NWkMZ/mSaS5wehlmA0mvInSVBgNW8syUZ9/W6WKHVNQ?= =?utf-8?q?TzWWoZhdra3GUy7V4zzy1mbVEGlhnEJ/qbzlmX2483AQBU/0G3wA36o+kL2g7IQDj?= =?utf-8?q?gLJYWPm55DnJ?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5992089-2711-4e0c-6a87-08db5b8bc925 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4806.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 12:46:53.7865 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: STVRr/4JE47EtLJUjCpWRe96dLPFIZ9rwScp/KWj7uiRKi8I6vBdPPcfMuUm+PI3jMqamHAotpXbPJr/lvq0MQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR02MB9516 X-Proofpoint-ORIG-GUID: oDSaPWDN9gM9F_fPH9tFjpjl7LQOYDeq X-Proofpoint-GUID: oDSaPWDN9gM9F_fPH9tFjpjl7LQOYDeq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_08,2023-05-23_02,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.155.12; envelope-from=tejus.gk@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In the function qmp_migrate(), yank_unregister_instance() gets called twice which isn't required. Hence, refactoring it so that it gets called during the local_error cleanup. Reviewed-by: Daniel P. Berrangé Reviewed-by: Juan Quintela Signed-off-by: Tejus GK --- migration/migration.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 161d4e9a71..b2555ff45d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1663,15 +1663,11 @@ 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 { - if (!(has_resume && resume)) { - yank_unregister_instance(MIGRATION_YANK_INSTANCE); - } error_setg(&local_err, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol"); migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); block_cleanup_parameters(); - return; } if (local_err) {