From nobody Wed Oct 30 22:11:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nutanix.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1722427505800215.50121995360814; Wed, 31 Jul 2024 05:05:05 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BDFA882C; Wed, 31 Jul 2024 08:05:04 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 28B53B47; Wed, 31 Jul 2024 08:04:47 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 05AD597D; Wed, 31 Jul 2024 08:04:44 -0400 (EDT) Received: from mx0b-002c1b01.pphosted.com (mx0b-002c1b01.pphosted.com [148.163.155.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 75EB1162 for ; Wed, 31 Jul 2024 08:04:43 -0400 (EDT) Received: from pps.filterd (m0127843.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46VALfMK007924; Wed, 31 Jul 2024 04:47:03 -0700 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 40q9chhdkm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:47:03 -0700 (PDT) Received: from DS0PR02MB9101.namprd02.prod.outlook.com (2603:10b6:8:137::22) by BL3PR02MB8297.namprd02.prod.outlook.com (2603:10b6:208:344::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19; Wed, 31 Jul 2024 11:47:01 +0000 Received: from DS0PR02MB9101.namprd02.prod.outlook.com ([fe80::ca92:757d:a9c6:6ca3]) by DS0PR02MB9101.namprd02.prod.outlook.com ([fe80::ca92:757d:a9c6:6ca3%7]) with mapi id 15.20.7807.026; Wed, 31 Jul 2024 11:47:01 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 1059 seconds by postgrey-1.37 at lists.libvirt.org; Wed, 31 Jul 2024 08:04:43 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=proofpoint20171006; bh=BAIit1z6Trhym SG/0FIHujrzh9bcB8JzGmR9E/aAlB8=; b=jTgal8XaVi9ZQD6YwtOosgUVtjhsD 4IK861n7m+ZIzfdBXESImjj4GWYM019o3THy1eFumkhzjpPKCwEZt8chVsGNODSl rrLSm/Q2rrIEqY8ayJiaPbCb1f9Ge8r2kUsOZCUAmPfvMIiIglaqtrXJr1VoIsUh xl1i4GLM62ErEM/Mr26s/NKY7kM1V5K6NismOe/SWCDT/7xdVM6Li/PjtOfsQiVZ xIs/lp4JkGA6hEdmnhncKypPqKtPF40T3oXzrFiim31z0slAyfjy0R71NhexUARE nTWLCOW6qD2oWiV7hyD3Pl2pu1mO08Rzkm8qtXtTknWrQLKEIxhSgUlig== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jfw9ipxYY2wytM1eBjBe2NfEixRridKGdqLm+UMQ8wS3CUVZnewBLEc6yfjJv2iN5+wLky9m+B3E6SxfF4Mkv9oFxAO1sNJW2XhkoUjchERnKUJs2VCO3awk8liCYgIHr3H7p5aAkUgjbl3CIcXKxzgmFycM7qLDisi3o4ZjWQN9nRDvukQaUAfxqffYc+bJHZ3GXnnUDUmlCrrKVlcR7YlE4Qdlfrox01mRF4cjWt48/7YQcnTLvAVifmhplI2hpl7ZtJE5BoV3bYlnYkaHQBDyYy4ACVm896CZXCmqeVf+JwzNQfpY8MGLU9YwJy1g8Zr2Da/5j7AmxrRkmEImdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=BAIit1z6TrhymSG/0FIHujrzh9bcB8JzGmR9E/aAlB8=; b=j6EZ9sHY5EEnMijD6/lWUyQ0HxS40GMtTJfwQHQSDkptkYkERGhbJUxaDHf//rQ4rpg9jGfaVtNCTnMSaYg4cWZ2ILQN7tuAIZKXzkv1hbhzkKjRPoCvNytxLM1Mwch2QPWXbNU80Xbzpp+8gpwr5xaVVlKOXggUav2MZmKMrbla0sDCKTuO1bUB78CYHnycGW2IksrBirHlmV3ja0kgsV3PA7u5pfE90hmcIHFrcbUZgq0R6rz9UJ8N+bYPYfxLkcPWiaoauoqhIrgLqgqtkAXkNpliVARnKcCjzheY6E+kfmt8DtxyKdLNqbHEQNKrvRHUUDwqHDaQNteq/b1DKg== 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=BAIit1z6TrhymSG/0FIHujrzh9bcB8JzGmR9E/aAlB8=; b=jfGU03OfbnxEzGsUcQ5AgmXhPfg/8WP6W3rEmHyew6dpKkM6zfOQoILdluYOU4m3PK+BBExXJifQLOtZE4lqi+FAgIDSe8YvjoFk9xzHzW2E304QCuT9cMyfnCKUBgS7ImFaC/sO5Age0n6AdnegEOVT8R4OSeXILA6MurNjg/RMTJyJ5K59IUoAdAb1N+23WSBhmDOxnBc4/gvdTNGil76FnrH6KwLauQS6rUcC56EPsiDjCLAX8O5QeKJZhWw6JRlK+cZ9v30eB+LJzF9WSrmiWZ0BJoZJQjN9n0uOc7wCck5Kojwj7CHDw9hIl0hNQcxQKgWGjTok+b5x1G4fNQ== From: Sergey Dyasli To: devel@lists.libvirt.org Subject: [RFC PATCH] conf: check for migration job during domain start Date: Wed, 31 Jul 2024 11:46:48 +0000 Message-Id: <20240731114648.163629-1-sergey.dyasli@nutanix.com> X-Mailer: git-send-email 2.22.3 X-ClientProxiedBy: BYAPR05CA0015.namprd05.prod.outlook.com (2603:10b6:a03:c0::28) To DS0PR02MB9101.namprd02.prod.outlook.com (2603:10b6:8:137::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR02MB9101:EE_|BL3PR02MB8297:EE_ X-MS-Office365-Filtering-Correlation-Id: c964ff9e-a0f3-49e0-34ca-08dcb1567d95 x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?H214yCiKW8Jks3kfqo2imiahIgC5VMoRwxgD+w3DmhoZgQ+xXLOCGDSdSFvt?= =?us-ascii?Q?iYKKKui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rhlMmMPRMR6MW?= =?us-ascii?Q?7Wm5E4jQOVi+JTzYwSweKMWTx8aCOp9G3BdOju1HgMpc3nQBkmGhBwpim+Gn?= =?us-ascii?Q?J72jExplNpEQo3xqOO1PJLZZgU2eAxgJ93GcSqSExKy13CIpEE504AjkUbQN?= =?us-ascii?Q?/bM+pM8sA3PdJmv8ccRNYdcrHGxbcNATiaTrRC+lwr0YfwhPDORB5u/YQ+b5?= =?us-ascii?Q?X9XiHv6+ylT67ZrI6GMax8qOaronJeBr29qcb2csQJFCR17dYm5M2RrotIgX?= =?us-ascii?Q?MlWKJkbdilO3d8+TdML+504jHBUDm3N4V2Dn2zqoBKKflWKt8Kwov5HAaagc?= =?us-ascii?Q?gvHE4vN6pq7zVd5Pas4QmxtG1dpqNgI/NvhCcQt4L4bH0VPwMQaB2Hoq773f?= =?us-ascii?Q?upjF5MilLAyjniWW44YbpjDdyrNKVI/kDWInYAnoGHAhFEZPJ687aAG75k03?= =?us-ascii?Q?wTAe0rWcD71TWJKTuZL0b/45igJGE+tHNjkz8hL4odP2f0gLaw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR02MB9101.namprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GG1S5JCGvb9nBQtNkr/5LrKBuEsmZ+SKu7B2EO5Cu614S1PZmz0qoH8h4v6C?= =?us-ascii?Q?sOEkROZEJYRHbayAjVqAYokycaREOF5hqwjLccYXQmlEMg0nnuXr1NwjKo7Y?= =?us-ascii?Q?bREQm9a9Mh755AhAwLjgzOis27k9+IW1RDaSgQsmwWuASx7hLI1BXIDWOIVF?= =?us-ascii?Q?skX1DNSRkxf9HpDnUxoENLoR1xmSwf1W3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P5++Vx8rpZ04qkI63vgHyT5Zaii3FPCIPX9ZiuYjxNx4ZuX6DtGj99v1Hox?= =?us-ascii?Q?a6UJ4MJRGz/lTq14tKvZJDH0LVoflcHoJ6gQiEV13XKZJnApPB+P1leFXfWY?= =?us-ascii?Q?CK0AXIOxdQui8e+GKElP3JV6UWy5sxGwbkU17YEH0dbmEUX6iGx8t3o/gydT?= =?us-ascii?Q?kcNWFaY1/r5prrg8kAPVIgsLvRLepC4ELinnUjGYygR/9rLqmc2kMJCvYqwa?= =?us-ascii?Q?ocO1vfiLZcIXqBQvfskUbiCA/mo5qM6nTDxvGas015uCLQ3DioPb5lWmwh9X?= =?us-ascii?Q?SdE+UskBIsZ5YMqfn82YntsX9IGnyHLH2hKc6QV6n9N9XhRl+cPKhC+igoj7?= =?us-ascii?Q?U+ws8a+kJrNatnFalAuGT6srbBdb4mGKaj/rfeB8dHJtP9b3sHi39xy63hAm?= =?us-ascii?Q?Edy6YkvMcnPeCukhqjYU46rnj+I8ST2W1NP0bX2vCINRZn1QrJrJ9u7vEWzr?= =?us-ascii?Q?2OmGog7QX1xIXh++h91OqvB0iowTECZqy1dNsR4Nf4/XTcHH6PpO+Q5mi2RZ?= =?us-ascii?Q?DA=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: c964ff9e-a0f3-49e0-34ca-08dcb1567d95 X-MS-Exchange-CrossTenant-AuthSource: DS0PR02MB9101.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2024 11:47:01.3294 (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: y/8imlILkFbdy0qw9DjvRbKGW4yEksMa6IF0qe4DlmwWuxfrVbR4XXmNunZyhD/UfEqzP/aA9vRtKSMda3Y0uvDAY5Odu5j5EIV+m/ZlmeY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR02MB8297 X-Proofpoint-GUID: ewsgFE8Ol3UTYxkOwO0rMi__itdJiNFg X-Proofpoint-ORIG-GUID: ewsgFE8Ol3UTYxkOwO0rMi__itdJiNFg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_08,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Reason: safe Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EFEM4PSCOALTIYHBYGJRHVORMRNBM3BA X-Message-ID-Hash: EFEM4PSCOALTIYHBYGJRHVORMRNBM3BA X-MailFrom: sergey.dyasli@nutanix.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Peter Krempa , Sergey Dyasli X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (found 2 invalid signatures) X-ZM-MESSAGEID: 1722427506278116600 Content-Type: text/plain; charset="utf-8" It's possible to hit the following situation during qemu p2p live migration: 1. qemu has live migrated and exited (making virDomainObjIsActive() return false) 2. the live migration job is still in progress, waiting for a confirmation from the remote libvirt daemon. This may last for a while with a presence of networking issues (up to keepalive timeout). Any attempt to start the domain again would fail with "domain is already being started" message which is misleading in this situation as it doesn't reflect what's really happening. Add a check for the migration job and report a different error message if the migration job is still running. Signed-off-by: Sergey Dyasli Reviewed-by: Martin Kletzander --- src/conf/virdomainobjlist.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c index bb5807d00b42..166bbc5cfd57 100644 --- a/src/conf/virdomainobjlist.c +++ b/src/conf/virdomainobjlist.c @@ -301,9 +301,15 @@ virDomainObjListAddLocked(virDomainObjList *doms, goto error; } if (!vm->persistent) { - virReportError(VIR_ERR_OPERATION_INVALID, - _("domain '%1$s' is already being started"), - vm->def->name); + if (vm->job->asyncJob =3D=3D VIR_ASYNC_JOB_MIGRATION_OUT) { + virReportError(VIR_ERR_OPERATION_INVALID, + _("domain '%1$s' is being migrated out"= ), + vm->def->name); + } else { + virReportError(VIR_ERR_OPERATION_INVALID, + _("domain '%1$s' is already being start= ed"), + vm->def->name); + } goto error; } } --=20 2.22.3