From nobody Mon Apr 29 11:13:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658753134; cv=none; d=zohomail.com; s=zohoarc; b=joL99vLyv2n/CQgdxCv/hcM/kATIF1lRR1LqhN0wlmi/GvZTtSlVKiGo06dST1+ctfwKUl0UWKNLsj1cR+sBKyjuiS6rh5bydGMs9nwFl24Q6bCEo2P/21kmgAkUwDcU2EjBZhT6HqTS1BRg/v94yw8GZ8M1SyW+nwOrOTGE9yE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658753134; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bO0oXd0sWWw9xnZ9qeZ53YSKpmtiOv9gif8Sg5HFfgo=; b=ic5U7IAe7xwMkBkQb0bqqDdhmRAudsJfEMj+SfDaemXXQPT1cJMNZZqxQi5nGVfZkiwA2Ks48M+9JtSjxLFCMqI3NjSGqaq6hFc0L6CM20VJ0vUlLDB55rizFQeJdjDb3/KVEC72cAlNfUujubgbLEysWJTXJQlUDX27vayMz0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658753134558815.783323733302; Mon, 25 Jul 2022 05:45:34 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-txO-uf4gNomz5PChipAfug-1; Mon, 25 Jul 2022 08:45:30 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2FCEF938E87; Mon, 25 Jul 2022 12:45:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 940F32166B2A; Mon, 25 Jul 2022 12:45:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4B6351945D83; Mon, 25 Jul 2022 12:45:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 339F91945D81 for ; Mon, 25 Jul 2022 12:45:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 17CA5909FE; Mon, 25 Jul 2022 12:45:26 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 806BB18EB5 for ; Mon, 25 Jul 2022 12:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658753133; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bO0oXd0sWWw9xnZ9qeZ53YSKpmtiOv9gif8Sg5HFfgo=; b=VJZRARqUCsk1Bd5MGhvSWc01G/ILag2ChJKj98iuyu3RDaLMw1kr0cKyVQjF0WoYZmSBPB zED9GbqHYFoumce2j72TH5W2vMurbkuVn2M+49uPcx7XSXzqC7YEr7UZQCpkEMSx8WDPqm XE9cSOnLm73PWe7SMRLr8dsicoc6GjA= X-MC-Unique: txO-uf4gNomz5PChipAfug-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/5] qemuMigrationDstFinishFresh: Avoid multi-line ternary operator in function call Date: Mon, 25 Jul 2022 14:45:18 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658753135445100002 Content-Type: text/plain; charset="utf-8" Rewrite the code using a temporary variable. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 20dc91f1ce..800f66349d 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -6601,9 +6601,14 @@ qemuMigrationDstFinishFresh(virQEMUDriver *driver, *inPostCopy =3D true; if (!(flags & VIR_MIGRATE_PAUSED)) { - if (qemuProcessStartCPUs(driver, vm, - *inPostCopy ? VIR_DOMAIN_RUNNING_POSTCOPY - : VIR_DOMAIN_RUNNING_MIGRATED, + virDomainRunningReason runningReason; + + if (inPostCopy) + runningReason =3D VIR_DOMAIN_RUNNING_POSTCOPY; + else + runningReason =3D VIR_DOMAIN_RUNNING_MIGRATED; + + if (qemuProcessStartCPUs(driver, vm, runningReason, VIR_ASYNC_JOB_MIGRATION_IN) < 0) { if (virGetLastErrorCode() =3D=3D VIR_ERR_OK) virReportError(VIR_ERR_INTERNAL_ERROR, --=20 2.36.1 From nobody Mon Apr 29 11:13:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658753137; cv=none; d=zohomail.com; s=zohoarc; b=aJ/pgTPmYSfB81xRKsnr9Tzg5sPXKwQFhxCHnDW8mQgyP1utU0I9XF5PToTtMkAJDnMTzxftvL+a98KWirK7CCjzJ7RwAYp4Vl2Ch+CSfAePuv5ht4vk/u59emr6ugMjv2w91qiUEGP0CBgae5MKolDrDRUwoaPZm0oXxPvC3Hs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658753137; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UqAvLyQu2l58VdaZWdQSKI9xIQ6141kcQp4ng0Gf/rk=; b=SDp0Rk/kM8EUbFFk3E/TfeXuK5s6neq4Xr2bIiyr0AjcpLBAHfHPnQYdYnNRJjfYjihoPfO2Tm7rcUL9clY0q5S2ucYgS8bwnrnzDFcm/TDV+Q7NuJEqqpk2or5iURfUNU0BES0qb6wB781oEvw940BzSFPQA9hRxI/2iGaVbjo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658753137859437.1091594032389; Mon, 25 Jul 2022 05:45:37 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-384-Ibw537beMbmZfZcfzimG1w-1; Mon, 25 Jul 2022 08:45:32 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 491C4824079; Mon, 25 Jul 2022 12:45:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EB7F492CA6; Mon, 25 Jul 2022 12:45:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C60DD1945D88; Mon, 25 Jul 2022 12:45:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1A7491945D81 for ; Mon, 25 Jul 2022 12:45:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0AF41909FE; Mon, 25 Jul 2022 12:45:27 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 755D618EAA for ; Mon, 25 Jul 2022 12:45:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658753136; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UqAvLyQu2l58VdaZWdQSKI9xIQ6141kcQp4ng0Gf/rk=; b=MWdk/hxzOvUvBDoOi2aAsbbjR9O446C/dcPxYD0vZnG8K+od1Pgd9HYLakx//Agi+POoPu rqizsD2+gUJVExxGigX+FTmc58sbYdkUzaeKNF5mNE+/kwGPaPBCp2nZVpyZX29MFs4SQH 9XZj+jpTVAgH8HJhlVPleYfw3Lwvy80= X-MC-Unique: Ibw537beMbmZfZcfzimG1w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/5] qemuMigrationDstPersist: Avoid multi-line ternary operator in function call Date: Mon, 25 Jul 2022 14:45:19 +0200 Message-Id: <0f7bcdeed7bcbec45f499d65c99004994997ea03.1658753062.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658753139490100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 800f66349d..a14b774a22 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -6393,6 +6393,7 @@ qemuMigrationDstPersist(virQEMUDriver *driver, g_autoptr(virDomainDef) oldDef =3D NULL; unsigned int oldPersist =3D vm->persistent; virObjectEvent *event; + virDomainEventDefinedDetailType eventDetail =3D VIR_DOMAIN_EVENT_DEFIN= ED_UPDATED; vm->persistent =3D 1; oldDef =3D vm->newDef; @@ -6402,18 +6403,19 @@ qemuMigrationDstPersist(virQEMUDriver *driver, priv->qemuCaps))) goto error; - if (!oldPersist && qemuDomainNamePathsCleanup(cfg, vmdef->name, false)= < 0) - goto error; + if (!oldPersist) { + eventDetail =3D VIR_DOMAIN_EVENT_DEFINED_ADDED; + + if (qemuDomainNamePathsCleanup(cfg, vmdef->name, false) < 0) + goto error; + } if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0 && !ignoreSaveError) goto error; - event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_DEFINED, - oldPersist ? - VIR_DOMAIN_EVENT_DEFINED_UPD= ATED : - VIR_DOMAIN_EVENT_DEFINED_ADD= ED); + event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFIN= ED, + eventDetail); virObjectEventStateQueue(driver->domainEventState, event); return 0; --=20 2.36.1 From nobody Mon Apr 29 11:13:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658753140; cv=none; d=zohomail.com; s=zohoarc; b=dIIOGIM1x3qMOAfiM+DG6npdzWaUlaYlMHWsCMRkjU6tQwJPrBo8IxSk4Oltuh5gBQaSDyelc/aGs1nJUmcJj26Prk2hddYeE5zfy+c4hCWI4wKj1KFI8pgwqYzL2167asJ+XKDKJP64IbAo/qIi0IeqPPcUC1HStswqtkY5OJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658753140; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xg+oX+NU+kCsWezSYvhqGZb9RDpkh96iChWhi1R1vyM=; b=Tc2cYSD+Vo3+yCtlkn1lR2dtd4dhnpjP5A+L9E+TFDzaufB+auqY3y1rlcs3jzfe6/F5WJFFDbnYuJxBf+EUrGaQib9Syyw8xI9v5DnONW9x37xEvS6e7JmEMfJVVshojnyulFegj/RcO+5DSn3Mh98MNAyGfXPFtCVodAdLSnQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658753140934372.1728298820169; Mon, 25 Jul 2022 05:45:40 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-7UJBfKLfPOWbycqjrIOrrw-1; Mon, 25 Jul 2022 08:45:33 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2DA1B1019C8E; Mon, 25 Jul 2022 12:45:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 183C02166B26; Mon, 25 Jul 2022 12:45:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E1E201945D87; Mon, 25 Jul 2022 12:45:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0DAB61945D9D for ; Mon, 25 Jul 2022 12:45:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 006CC18EB5; Mon, 25 Jul 2022 12:45:28 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B69490A04 for ; Mon, 25 Jul 2022 12:45:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658753139; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Xg+oX+NU+kCsWezSYvhqGZb9RDpkh96iChWhi1R1vyM=; b=jFn5PjgJVb94BjEUyvEhRms144d03VCkgZBxqxOEpx0hCsm+Agfa0iFImGtpI7JsnR1ZhC hZNEuPg5gt7zpF+TeLBEAdtKVrvyeDunJoFQDee3VboRjiiZ4fq8rLOZBp9S2xc1uOa4Z/ bi80CCMcC2QxQy0idUYWznh3AjtEsVc= X-MC-Unique: 7UJBfKLfPOWbycqjrIOrrw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/5] qemu: migration: Overwrite 'dname' only when NULL Date: Mon, 25 Jul 2022 14:45:20 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658753141404100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a14b774a22..0d696e1d46 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5422,7 +5422,8 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driv= er, * status code from the sender to the destination host, * so it can do any cleanup if the migration failed. */ - dname =3D dname ? dname : vm->def->name; + if (!dname) + dname =3D vm->def->name; VIR_DEBUG("Finish2 %p ret=3D%d", dconn, ret); qemuDomainObjEnterRemote(vm); ddomain =3D dconn->driver->domainMigrateFinish2 @@ -5707,7 +5708,8 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driv= er, goto cleanup; } } else { - dname =3D dname ? dname : vm->def->name; + if (!dname) + dname =3D vm->def->name; qemuDomainObjEnterRemote(vm); ddomain =3D dconn->driver->domainMigrateFinish3 (dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutle= n, --=20 2.36.1 From nobody Mon Apr 29 11:13:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658753139; cv=none; d=zohomail.com; s=zohoarc; b=QFgLiMix3yF9rfIVk8+yn+EbN6LjHeV03jEjq18jvpEEwUQeKoAlSU0oxqVd87jS6G8pjXQs14wEKmZHKUt1JFfnfUmwoqZSP+JrSM7I8QLWt6YBFHiedoCOYrZ4FTNSKyl8StGpQtZVm2cvid5XHbFz/lts0+8vhVonbAdDmGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658753139; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vckNybohS7uBceDaZrsSCsA29WOqClJvQ3W/sTVvwkg=; b=PIEbroxDLc61h+yK++c2L1nJiRzCb+sxTQn6CseQ5AHFucDdLy2rKN5zOUg04/5V0KMfvEhrzSHGqr10258YvQ+H90FskpRwcKbctl10EzowDYy9UzmItbe8aAv2u8zLur//JP2OAPcsUAIV7NqG0E3dJLo79a0nYJ+4zCJUE3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658753139909619.5738126277505; Mon, 25 Jul 2022 05:45:39 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-516-DcdCFZVmMe6zrYaIV2okbQ-1; Mon, 25 Jul 2022 08:45:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9684A180A307; Mon, 25 Jul 2022 12:45:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82A13C2812B; Mon, 25 Jul 2022 12:45:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 516A51945D89; Mon, 25 Jul 2022 12:45:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2AD401945D9D for ; Mon, 25 Jul 2022 12:45:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0168D18EAA; Mon, 25 Jul 2022 12:45:29 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F77794561 for ; Mon, 25 Jul 2022 12:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658753138; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vckNybohS7uBceDaZrsSCsA29WOqClJvQ3W/sTVvwkg=; b=jTDAofTALiYo4Al6UC11j038rtVTIfWYNsBOG6ed6maQT2QYvEfvZ+i2bIBs/FMh9PzYrv pHx0XFmgA0doykLx4+nxT06HrIyxrlSwNRR6Z2kwG1RzGXDQV0j14gliT6ucAkYISBdsO7 Ayu8MgpFAc2nYBNuq0Zc8W4xcce3MKc= X-MC-Unique: DcdCFZVmMe6zrYaIV2okbQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/5] qemuMigrationSrcIOFunc: Avoid unnecessary string construction Date: Mon, 25 Jul 2022 14:45:21 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658753141404100004 Content-Type: text/plain; charset="utf-8" Use full strings for better greppability. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 0d696e1d46..f2ccbe11b9 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4267,11 +4267,11 @@ static void qemuMigrationSrcIOFunc(void *arg) goto abrt; } - VIR_DEBUG("Migration tunnel was asked to %s", - stop ? "abort" : "finish"); if (stop) { + VIR_DEBUG("Migration tunnel was asked to stop"); goto abrt; } else { + VIR_DEBUG("Migration tunnel was asked to finish"); timeout =3D 0; } } --=20 2.36.1 From nobody Mon Apr 29 11:13:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658753168; cv=none; d=zohomail.com; s=zohoarc; b=FxN3RDco7DyK6SluXNC3GgI5CzditcBKvouRslauD/hFSb296XTSMx+pHp6A5o5HzHNobCjb+vP9h6vL7JT7W86DjWtnZLmvQiBqKhD+RM2rM4S8umT1i28uO5O/SbG1V4xdIUen2iJc27U6NxrCRpKa5JiPkbYfsoHoepoaTg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658753168; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=B7Yi4KhG/3veBBmH60GIZgoujVWZ+34Ux6XeX/7VVMs=; b=lFFI0dOKpFADVIP3kOFr7LgNLIA7odBP8FtV9sgGutuLMuC+lFBHJ4fYDS3jROSCW1tKSDaYG+PNHforcv7gkn4CigoU3ihU8mgIEp4swV+5lgNUaR75Ns4I3WWuYgMpE3Fdi0Tmq1VNyC5MNRYee89SAWsHSdRw7YiSMuc8PA4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658753168249704.2679671878834; Mon, 25 Jul 2022 05:46:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-63-ruYhtVgQPCOLoAehqul6oQ-1; Mon, 25 Jul 2022 08:45:34 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E59F71035341; Mon, 25 Jul 2022 12:45:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D01951121314; Mon, 25 Jul 2022 12:45:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9D4821945D83; Mon, 25 Jul 2022 12:45:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0B68E1945D90 for ; Mon, 25 Jul 2022 12:45:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EF2DF18EB5; Mon, 25 Jul 2022 12:45:29 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 690C518EAA for ; Mon, 25 Jul 2022 12:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658753167; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=B7Yi4KhG/3veBBmH60GIZgoujVWZ+34Ux6XeX/7VVMs=; b=fwpsLx8YwN8lnDOQ+yS11YddvZdo0jS4kb8RdhabK12YJxOgI0o4qHNH/vK9QwO6WGMOuW 7dAwAt10lJlG+hT3Zeq3GQuK5iZcRxXKgVXLMJDQ/CsXe6csPX7GN18MjPD9aVN8G5olZ4 gnPF4qETad5TcQvIiZg6Y0WhIQdwImw= X-MC-Unique: ruYhtVgQPCOLoAehqul6oQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/5] qemu: monitor: Split up enum strings definitions Date: Mon, 25 Jul 2022 14:45:22 +0200 Message-Id: <1b7dd555829ff787224f34f1a5096a0c6b8beb01.1658753062.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658753169474100001 Content-Type: text/plain; charset="utf-8" The VIR_ENUM_IMPL macros directly above them list one string per line. Use the same also for qemuMonitorMigrationStatus and qemuMonitorVMStatus. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 9687746703..6ebdeb46f3 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -144,20 +144,37 @@ VIR_ENUM_IMPL(qemuMonitorCPUProperty, VIR_ENUM_IMPL(qemuMonitorMigrationStatus, QEMU_MONITOR_MIGRATION_STATUS_LAST, - "inactive", "setup", - "active", "pre-switchover", - "device", "postcopy-active", - "postcopy-paused", "postcopy-recover", - "completed", "failed", - "cancelling", "cancelled", + "inactive", + "setup", + "active", + "pre-switchover", + "device", + "postcopy-active", + "postcopy-paused", + "postcopy-recover", + "completed", + "failed", + "cancelling", + "cancelled", "wait-unplug", ); VIR_ENUM_IMPL(qemuMonitorVMStatus, QEMU_MONITOR_VM_STATUS_LAST, - "debug", "inmigrate", "internal-error", "io-error", "paused", - "postmigrate", "prelaunch", "finish-migrate", "restore-vm", - "running", "save-vm", "shutdown", "watchdog", "guest-panicke= d", + "debug", + "inmigrate", + "internal-error", + "io-error", + "paused", + "postmigrate", + "prelaunch", + "finish-migrate", + "restore-vm", + "running", + "save-vm", + "shutdown", + "watchdog", + "guest-panicked", ); typedef enum { --=20 2.36.1