From patchwork Wed Jun 21 13:09:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tejus GK X-Patchwork-Id: 13287274 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 5AC18EB64D7 for ; Wed, 21 Jun 2023 13:10:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBxb5-0006vz-Jd; Wed, 21 Jun 2023 09:10:09 -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 1qBxav-0006vM-0P for qemu-devel@nongnu.org; Wed, 21 Jun 2023 09:09:57 -0400 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBxas-0000Ie-Qp for qemu-devel@nongnu.org; Wed, 21 Jun 2023 09:09:56 -0400 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35LBvZp5016036; Wed, 21 Jun 2023 06:09:52 -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=paCUBhbUMNWDZYh1zZiN71w1Giy3EYP5vM0Afk+0nOo=; b=Nduk0DezFsQIzkS0eEn4FSepNSJm9HPmKFswDhIe/jrFGj/f+I/sKIcfyDsqO05NHgzP pGBt0vHU9nZMyly8CRNeufcE7yHGWv22oxjpYLpHi18stIRvQDggQuWO569RTtle62/R /uEk8iSTY3ky5tXKCgKTJW4sDj5Bo+r6nToSnaXHVdPcaiy1LXwYE66jPgOkodcA41zP NB7ykN7ympYKn4eapUk/F9AJ7+1cydwgaX4iu1w83G1N0GtoJsQhZRrFs8lFTpMLVMb4 HLwjPL8TMcYJSjrOFwgTlW7sj+TEKv7zCO69mvFL1By01E/8OH7lr4DzD8gm2zX8pRjI FA== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3r995rfcdq-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Jun 2023 06:09:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dQNa88cKwUdSguUgkhWHXjX7yf6fCPncLxuJSQLaXiVp04DavHBk8k/dBpI5L9ILkmwxZf5ZXZMK+drzK4b6kaLQy2nqabDzdRr+tRBzA2vPmAuIhof3yIcJuApKyCMPZ/r4MMBg9pRXX5cJOk38xLWRFzRkTR/6tilLHaJa0oiDJTsHE/J4iQNQfeILJZx7EtEL6QxOpq0t4cPOkjTZnBnotDTzNyX5xaNhWS+cF0vgAjTQA7dw5F9X/7Np2Jj6ccGOgSgeW4ch1pBJ6qXudYCOb9d+inl1bI3S61fHEZRt+JaO/jh+F5jIf1zvc7JYWnp3xNR4IqoG1u+J4uv2JQ== 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=paCUBhbUMNWDZYh1zZiN71w1Giy3EYP5vM0Afk+0nOo=; b=h/O/PJ265EyYeCoKl6Ulaq7nGGrD35Yrn2+5xoqHZ/bl0qSacY9X1gX7OQuksE2BwwYQiZtxPz8dP/1PcXCGnb8C/gASjF8g9DyfE8o6dqcu1X1QBpytY9fgZW9hTa5ume4bQDaVewkKhIOEVAc55oXn3IwReFml5tqZpSXF/eF3Rn/4gumRQq7XV8BRoenU37uFBFGR4FT74fhQDbHeuTfTcvQFx7TNLrahU8D8puagKOZUwMp5aNemeqIrCLYFVyEI0vx1S1f2LYuZ/fge07vfO1p2MvcHkp+T3janTiDAR7K0id8ZKM+g/4vZzdGiXGLJ7ujTkfEh+wFYR3oqBg== 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=paCUBhbUMNWDZYh1zZiN71w1Giy3EYP5vM0Afk+0nOo=; b=t15/AAATRuGoWVgCDT9cwotO95I/sRv9H6YGln8jnlRF1HMDg48E7ZzBfCBBz1c19AnVDq7jjREphnC156Zp+5LZLnANaPmvTN+U1+lgIYcRqe9MYL4EBEGMr0OvacEE10UgIAd2dDSbmpQ7JtHN86tPupI06DnlZdzOJeSw016GQX3NaOUnxJZ4e3ZBErZq6xAg8+x1uyjA0L7WSprCWlQHN/3Wgh8vDOyiLFboj1lHuHWV56ySwYZ2e6obyTehSU9gWvhimtA+q3xMbYLZKV9pUGBLX+KeFpxGJ6OsgG1rRo9m5Cl/B1bhaLSqgAcQ7s1fD/xW3D1Pc7ZUACZOew== Received: from BYAPR02MB4806.namprd02.prod.outlook.com (2603:10b6:a03:42::30) by IA1PR02MB8897.namprd02.prod.outlook.com (2603:10b6:208:38b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 13:09:49 +0000 Received: from BYAPR02MB4806.namprd02.prod.outlook.com ([fe80::4f5f:3660:5304:57f7]) by BYAPR02MB4806.namprd02.prod.outlook.com ([fe80::4f5f:3660:5304:57f7%7]) with mapi id 15.20.6500.036; Wed, 21 Jun 2023 13:09:49 +0000 From: Tejus GK To: qemu-devel@nongnu.org Cc: quintela@redhat.com, peterx@redhat.com, leobras@redhat.com, berrange@redhat.com, aravind.retnakaran@nutanix.com, shivam.kumar1@nutanix.com, Tejus GK Subject: [PATCH v5 1/2] migration: Update error description whenever migration fails Date: Wed, 21 Jun 2023 13:09:39 +0000 Message-Id: <20230621130940.178659-2-tejus.gk@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230621130940.178659-1-tejus.gk@nutanix.com> References: <20230621130940.178659-1-tejus.gk@nutanix.com> X-ClientProxiedBy: PH8PR15CA0013.namprd15.prod.outlook.com (2603:10b6:510:2d2::16) To BYAPR02MB4806.namprd02.prod.outlook.com (2603:10b6:a03:42::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4806:EE_|IA1PR02MB8897:EE_ X-MS-Office365-Filtering-Correlation-Id: c4a385b7-017d-448a-22c5-08db7258cace 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: YzIBWLa2sPs1fSl6xr5o5Omy3DrStkDa5lEvfOrmxfPUOlMhoyguEPXezrjqmj+j8KFdgitx74W8GlDqKULyH2M2A2BfuKIDmqVE0BOTmFs+IjTPLlkFuEM8MY2a/j+tCivVi7bUHUNMeUcsX/BSAdps88XYeqskI6q9TQAlMT9AwiwQNS80ykBGKR3Xga9eIyL9Swht4WfJAlj9Gd8cUbR14olWpvxdWt+rVXEGHF5WAbS0AKBTJuCfLstgS+CLFA337k0fCYd43T1/99xaXYmPDKx6Cj2MTh+IgchcDjPrI0fbNyu95jZJ9eaU2JUGrhgQG0MMJA7M4BXVgnVTMKhIQrQ4oPuzwqyiXuv5H1nlAbk6nybJmd62Ee6kkShxKBgbsnj0ysAw6D6+NboTS333NcQv/5O/s90i5oRZ4jey8DAt4vBMM0SdxKWQ0odFwDjgRSgdUSdDCFprCwn4W2yLBLRPOFecyMLND/uD+GarCJ5u78dcAWVFGcU6Mucs+TQEWziVwmXMTHTynY4BisC3jnpfS7paebu3Vqv5pbm/kIU+1EMne2moNbIdSXJ9KPct4wkUD/1o73D9DhEGzCQcfXClvKcxY3xV2TGNfew4o9JRTzzB4J8ft1sKA+Qa 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)(136003)(39860400002)(366004)(376002)(396003)(346002)(451199021)(86362001)(36756003)(38100700002)(38350700002)(83380400001)(478600001)(6486002)(52116002)(6666004)(316002)(66476007)(4326008)(66946007)(66556008)(2616005)(1076003)(6506007)(8676002)(8936002)(107886003)(41300700001)(6512007)(26005)(6916009)(186003)(2906002)(5660300002)(15650500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Xy9dhd/0CbSmcG2KCZvC9r0z9vO8?= =?utf-8?q?cGyp082/QyMhEh5rZV2W4nUmBwX+3ITDl4z+U+JV4NhwB3C9lDWOcKBv8tVf9dHuW?= =?utf-8?q?oZTpL0Zyv/NJpeMFE4xzsRqQGTbQScvThSNqz/i8As5t+C0S8Ne3Fhb+Fx4j35Gmb?= =?utf-8?q?1G/eRto0/X2bAFf3FsgSmUx+cZgaFV+wRBS7zIW38TlqxDxQEt8aJ+RQ9kAkHcfeS?= =?utf-8?q?nDD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?yPvNOoZ351aP5oti753WfDh6yHbHaKlzr7vyIb8r/9wR4+5d9ZxNfDsP/X5ftzol0?= =?utf-8?q?xVmt+kkHwpft9WsntTZKzIUGQWXNRjOj+ANGN9CQwjIdVuC4NaWAfv00VC9BNvt1R?= =?utf-8?q?kpGd23NuXcZXMDz2ESbBGHu/IqLVaP58TUzB3hqD1Dd07lyDKOrl6Qz2ZNp6fwPqK?= =?utf-8?q?Syh+ZvcCTD25sagQi/eyO9qV9b42O8SMBEzRndPpwS0rveqxXow7C4dFHsCXOBhvl?= =?utf-8?q?1uAp643m0UVeI7PEwDgCAGRBY+lw0sDP54K4TCEnrDFp/eadJFUF29OkrzjabFyhN?= =?utf-8?q?oioEZTHSJlC94H42a832nttagh4FWhBfKQRs+4ivW++MSrLSE5tE4x1BVPjiP/Rb8?= =?utf-8?q?eBzLTN9O/M3Tdc5VvdJIZSEfsnIia9LzPIz32EDgkYKJrQRDmMiFG10OoZoc7OtHo?= =?utf-8?q?iaRit1Zlp6l+?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4a385b7-017d-448a-22c5-08db7258cace X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4806.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 13:09:48.9466 (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: jHQWH8sN8mY4lfRPAOUfM0JumDTn/HXSHnCLUI6uEfTF+V5ebt7QR9MScfv/es/Z2TLjFor4k5p/U8Ra6fM1xA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR02MB8897 X-Proofpoint-GUID: LoBXr7WQFwhtO0bCb9Y7hKVAwpra--nz X-Proofpoint-ORIG-GUID: LoBXr7WQFwhtO0bCb9Y7hKVAwpra--nz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-21_07,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=tejus.gk@nutanix.com; helo=mx0a-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 dc05c6f6ea..64fab2273e 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); } @@ -2707,6 +2707,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); @@ -2729,8 +2730,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; } @@ -3221,8 +3223,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; } @@ -3246,6 +3250,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 Wed Jun 21 13:09:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tejus GK X-Patchwork-Id: 13287275 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 5E5F7EB64D8 for ; Wed, 21 Jun 2023 13:10:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBxb7-0006wL-Cs; Wed, 21 Jun 2023 09:10:09 -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 1qBxaw-0006vb-5n for qemu-devel@nongnu.org; Wed, 21 Jun 2023 09:09:59 -0400 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBxat-0000Io-8Y for qemu-devel@nongnu.org; Wed, 21 Jun 2023 09:09:57 -0400 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35LBvZp6016036; Wed, 21 Jun 2023 06:09:52 -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=0a7suu59iKV7rX7K2o3+g6zCLlzwUrLZca2ffDapaZA=; b=uMLwqXb6mz3aYiUVJpOOQ52Zw7kglKek2ZpGm8kvtCx1vbYImW4NiIVzSAIKLhZ7x7Kz 4w5yx5libBjnWBwDBBwDTWnJoYe9gYzgd3VPO73CX2a4DXd9J64YLLCp49Rq7uG6j+do +W0xdOeGc8PUY8YSo6wN5qlQ1Azrc4IyVDWKijQH9Qxy9wtMrPoM9FYbijOgTHf3ch+U ZmherX5h+5nW27GHXNOC237lqAIjm6SxsFumIMISuMvLJhZw7AJCzS45oOR4bJYxBmNn n2YeSEKppW9xqqDiOVyuse+TKTT/tdE2Peydx+juFzzAa3OyI8KWgjJcHNN4HW+0NOWE lw== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3r995rfcdq-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Jun 2023 06:09:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mm+2FvWQxz7u/qwN/7lcp6TC4qdb/dwZwWz0Sp4aGpFFL5/G3aPqYmDOZKsdtXs604P44ZQQZMfy8KNSuKsGpU4snp1288qi5789U10TA0qhPuh1D8aDZ18WcK75NzQgYGYON6aYIQ0tpvEqNpHHHDdnNEy0I8UBbq9Nqor+vbPUAR3iLBUqtSRKWDVAXJ/bv1FV6i1bfLaEpTu0SmvmCAcGmPXKeALKP6frs1LLK6LL4kivVCTNOa4yR1wh7ERIgkCii0IRu0tOGSaKs8z1v/YkYmmE/EhHSCuuIXHYrmZL1Lu52zL3pATZCpAZaU4SisyuPGv0C5FfL8YTGnHGpw== 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=0a7suu59iKV7rX7K2o3+g6zCLlzwUrLZca2ffDapaZA=; b=kgF0jDfpT1t8RMh4i2KH2ZApl6TAykeHeULh1jzv79U66pcm1kT3ivZdgTh1FuphScUdKqT5in4Cz9J/0g54dNZLrYYjI7qUzaEGRve39/pykwFKx2+EwVOC8owMjdkLPVoMYT2XfPHthI+BqbSFBvJSPEGUha3mkX9lHVhB2ybSTI9PVEaIOgZdRYkXbAY6OMHZ33HD49fcMoA22fXj84it1LSuTmcxHdoN6Fbsgv8HLShKVdXhoLnd8lFElXNj2UmHE6V5t7IwEulGA2ZzrLDkMHiYI01gSRasM4tHLu9cQLdyxiavmtwsWjq/0UWQCDmU2XI8OtFTBZm0wpwy4g== 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=0a7suu59iKV7rX7K2o3+g6zCLlzwUrLZca2ffDapaZA=; b=byKMMtMRIGywyOkN4PHzG4uakXMPQFTLs1DByXMs/B0sT9W9+kTgG8Url2VnxGO6hy/7CBKbD08RaTBCNKQXQhXk0rRqXpo4NgclO/k4HPobwKpC75DPnXW27hoSBEwlwM3gJN8fgez7ep6+4dZvf/cucql+OdJi01PcdxzISzIB0TElv2oDB2hP3Alphmz9pPC375FYqT4SwCheTxMXcSxUI6DtDp/ddHV+WSRilDsD22aJhOR2fATmR7NAXew+YDmbPwhGlj+iMinwF3lZJEd1xhCyy7KYMemniIOzL6MH4uQpUWxsKmzBYOAOkacj3PZ+JB/HmQ8L2Y6FA/FIHw== Received: from BYAPR02MB4806.namprd02.prod.outlook.com (2603:10b6:a03:42::30) by IA1PR02MB8897.namprd02.prod.outlook.com (2603:10b6:208:38b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 13:09:50 +0000 Received: from BYAPR02MB4806.namprd02.prod.outlook.com ([fe80::4f5f:3660:5304:57f7]) by BYAPR02MB4806.namprd02.prod.outlook.com ([fe80::4f5f:3660:5304:57f7%7]) with mapi id 15.20.6500.036; Wed, 21 Jun 2023 13:09:50 +0000 From: Tejus GK To: qemu-devel@nongnu.org Cc: quintela@redhat.com, peterx@redhat.com, leobras@redhat.com, berrange@redhat.com, aravind.retnakaran@nutanix.com, shivam.kumar1@nutanix.com, Tejus GK Subject: [PATCH v5 2/2] migration: Refactor repeated call of yank_unregister_instance Date: Wed, 21 Jun 2023 13:09:40 +0000 Message-Id: <20230621130940.178659-3-tejus.gk@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230621130940.178659-1-tejus.gk@nutanix.com> References: <20230621130940.178659-1-tejus.gk@nutanix.com> X-ClientProxiedBy: PH8PR15CA0013.namprd15.prod.outlook.com (2603:10b6:510:2d2::16) To BYAPR02MB4806.namprd02.prod.outlook.com (2603:10b6:a03:42::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4806:EE_|IA1PR02MB8897:EE_ X-MS-Office365-Filtering-Correlation-Id: bfb1dd82-b215-4eec-5837-08db7258cb26 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: gqzNXUL2MtkBTOhCj4kdbz7tcZcMHb7G40kn7but3VKJPcsO2bZarFkjYtdJyCOSXjPi+doXksnhdXltd1Npb0nErBCFN4eyyv6C2eZj1UF+l4DDwgoDrdokamXPnmQeXyE3kUTDrJU/8/AVE34lDiWK/gox1N07OcdBIdRpfMH038rZ2BYYLXTCiCINxkMvPg8PVGZOx3W3H1avNt1s4gbE6zAy9JsHZW0q2XciD8R1uG0vXC+Nj0B0LGEhwNyl/In2xHazehJwZfsIZWrMqwF9ZOUiLOPleTrGxquw1BXrjYEaYIMvRqrrMkVK9TfCh56PX88cL/HnQKuXRqwsqBXhVt6YMDR89t7RwlhaZnaZmo9rGtwg2DDIYkrm3CVvAPGRLzxPbT73FJtidi7FLj/9+L3GWUl2PMwrCKjv1KD9Dv6ULUguYD+iXQgd7b1JbAlwVkGQRV4txpN6CRaA1cjAA2OlubcakN8pvssSwbEF5ihm2ZfqaveB8rG80JYyLRtzCg/73ND63PVF66iOFVlhAPaOwqKD9E9+Z5RrHx/0mbp8u9sSkAIpx42klPC7e9D04ZjncorrboyA2aWZmJCTZdCYsyPQ6IS+Ki0rH1Dt7XtfNiDH3Bqe9kIBhiIF 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)(136003)(39860400002)(366004)(376002)(396003)(346002)(451199021)(86362001)(36756003)(38100700002)(38350700002)(83380400001)(478600001)(6486002)(52116002)(6666004)(316002)(66476007)(4326008)(66946007)(66556008)(2616005)(1076003)(6506007)(8676002)(8936002)(107886003)(41300700001)(6512007)(26005)(6916009)(186003)(2906002)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?fcC3fQFoaArPRG7YGttCHzbC/r6/?= =?utf-8?q?Z/Y8qrpnRzXHIV2MZq9Ai/U9l8Fiu0A2akfbA4legJYLxJVy33lLw0lDj4RKtxwd8?= =?utf-8?q?jBvIRP1qVVFYwaEur6eitTRqVqd1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VblE9v+dL6K7s6bOdZ36n/Nzn8nk8QTJq?= =?utf-8?q?OcRzr0XbkanNAOlV1Ax0DhUjnKZMmlEb7sR76+4fSYfzNtVhQx2LrxkclNnsKRsVq?= =?utf-8?q?H6VxWWd7ct4Zub1cROwzgxqN1vkv8nhiDb6mBAnL7a+nbnFI1eiuzvzKfLUdWFz3y?= =?utf-8?q?y8asSS/8+fZcKYUamR7r38y3KSjubCg6xNd3GE1I6Q8+3DDytcMszoeBl09/iwPOJ?= =?utf-8?q?n5PZiVMi5tcyoA2mL3xipUJ6YOtmpdRxDKKgxNlgGO3qsy1RneGfqaD7czF8R2wvq?= =?utf-8?q?oF5jjmo7swPOjq9amajGnIM6nnPFa7zgMwAhVJ4QTqdnh1W39o9oe+kSTyN1BssxH?= =?utf-8?q?OmuQTbRhQedTUpZNVGgq6QptwTW+fm0DMVno8xyzoSq02DOLQ0HB7/phZUhTTUpIO?= =?utf-8?q?74pOwE/7RT6r3BluyHce4aSA+uMv6Z7KYg3b8mTs3cOukmLORLlPi6iUC/IAf4W4W?= =?utf-8?q?hvRpYvD2vmuGImW01RgRn+beusesNuZ9haJRloavUQcA8d0/sxnPbE8UqAJN8gQxz?= =?utf-8?q?KCJ+3fQEiy9r?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfb1dd82-b215-4eec-5837-08db7258cb26 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4806.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 13:09:49.6107 (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: NMRt2donil5hm7874E0fZF7nBuK8+PSw19KCFqAptu0xebx9OMla27L3G4TLeF/IhWKS8Y+MSxeyfOnFLuD2Nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR02MB8897 X-Proofpoint-GUID: S4XRv_o3BtufbvHek1uY4qN7__Out0nb X-Proofpoint-ORIG-GUID: S4XRv_o3BtufbvHek1uY4qN7__Out0nb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-21_07,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=tejus.gk@nutanix.com; helo=mx0a-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 64fab2273e..a9186d78ca 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) {