From nobody Wed May 15 06:24:15 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=openvz.org 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 1648128391773384.6067675326841; Thu, 24 Mar 2022 06:26:31 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-352-0m7B5sRVOPaAnjak_3n0rQ-1; Thu, 24 Mar 2022 09:26:27 -0400 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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id A90D83811A39; Thu, 24 Mar 2022 13:26:24 +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 90AB19E62; Thu, 24 Mar 2022 13:26:24 +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 EDCC11940360; Thu, 24 Mar 2022 13:26:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B1700194034B for ; Thu, 24 Mar 2022 13:26:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 888D9C27E97; Thu, 24 Mar 2022 13:26:21 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 84DE6C27E8E for ; Thu, 24 Mar 2022 13:26:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C4441C06911 for ; Thu, 24 Mar 2022 13:26:21 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-364-ynsDAfBmMim88GiO4K8cHA-1; Thu, 24 Mar 2022 09:26:19 -0400 Received: by mail-lf1-f50.google.com with SMTP id a26so8002351lfg.10 for ; Thu, 24 Mar 2022 06:26:19 -0700 (PDT) Received: from vzbook.. (broadband-90-154-71-96.ip.moscow.rt.ru. [90.154.71.96]) by smtp.gmail.com with ESMTPSA id k10-20020a2eb74a000000b0024965dbf2d8sm348410ljo.82.2022.03.24.06.26.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 06:26:17 -0700 (PDT) X-MC-Unique: 0m7B5sRVOPaAnjak_3n0rQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: ynsDAfBmMim88GiO4K8cHA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IUEdZEPLq2rrA4EGHQ5etbpRHVkCakc8GoHCEUFZit8=; b=WkwMJFILsXJmRvfBMSpTqnoQpxJUVMFJv/qtPodnVNvU2xj1W72glSy4TLV5QeJY8E ZSQnNj05IeaE/AowEF0wyV2K7wbM/CQfpbGrWchtnb8HTNMLgOcJz86cDUaCgv/jWFDn VAnwqU6z+Jt7JOIdJ9t11SwrtA6hq91tIaUJgVROigx45bL1Lp87roTW3vlIq73bc46t CsMA3ukRsCIpNs37dikRd7Ba7CmSfPEwyEdGsYmS5YpHc1MdxzAvpOeyCci+mKLnqqHs j6F3ddyPFsHGoPrBIKDcND0wpmiSTPa2w75BbiZnt+q5gyC39YrbVxU5Tv62Xi7CWKmm x/LQ== X-Gm-Message-State: AOAM533WnxaBL76ViqbYozrNGAf2xCuGSdObmcpA1m69xcie4+OBsD3k 8Cbr0K0oe+9w8iFi0nGoetE70ZOU9xfomg== X-Google-Smtp-Source: ABdhPJzb1NxTvLzIqzV2oT1GjLZsUIVXvCqTR1mz0rhiTxydAAMRcNYRFQHdMfRBt1tQwXlrLYluDg== X-Received: by 2002:a05:6512:3d12:b0:448:39f3:768e with SMTP id d18-20020a0565123d1200b0044839f3768emr3818428lfv.80.1648128377638; Thu, 24 Mar 2022 06:26:17 -0700 (PDT) From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH v2 1/3] qemu: don't pause vm when creating internal snapshot Date: Thu, 24 Mar 2022 16:26:02 +0300 Message-Id: <20220324132604.131149-2-nikolay.shirokovskiy@openvz.org> In-Reply-To: <20220324132604.131149-1-nikolay.shirokovskiy@openvz.org> References: <20220324132604.131149-1-nikolay.shirokovskiy@openvz.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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.79 on 10.11.54.5 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-ZM-MESSAGEID: 1648128393463100002 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Maxim Nestratov The pause was introduced in [1] in ancient times when probably distro's QEMU does not have RESUME event. Yet the event was in the upstream QEMU at the time version according to [2]. So the event is supported since QEMU version 0.13 which is much older then oldest currently supported 2.11.0 version and we can remove manual pause/resume. Except for the halt case. [1] commit 346236fea97602e9e6529c5d41a32ed26b126082 Author: Jiri Denemark Date: Thu Feb 24 16:46:44 2011 +0100 qemu: Stop guest CPUs before creating a snapshot commit 6ed2c484f261fd8bd217f855b9e5e5f981e63f0a Author: Luiz Capitulino Date: Tue Apr 27 20:35:59 2010 -0300 QMP: Introduce RESUME event Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_snapshot.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index a7901779fc..cd94ddae24 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -293,16 +293,13 @@ qemuSnapshotCreateActiveInternal(virQEMUDriver *drive= r, virObjectEvent *event =3D NULL; bool resume =3D false; virDomainSnapshotDef *snapdef =3D virDomainSnapshotObjGetDef(snap); + bool halt =3D !!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT); int ret =3D -1; =20 if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0)) goto cleanup; =20 - if (virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_RUNNING) { - /* savevm monitor command pauses the domain emitting an event which - * confuses libvirt since it's not notified when qemu resumes the - * domain. Thus we stop and start CPUs ourselves. - */ + if (halt) { if (qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_SAVE, QEMU_ASYNC_JOB_SNAPSHOT) < 0) goto cleanup; @@ -329,7 +326,7 @@ qemuSnapshotCreateActiveInternal(virQEMUDriver *driver, if (!(snapdef->cookie =3D (virObject *) qemuDomainSaveCookieNew(vm))) goto cleanup; =20 - if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) { + if (halt) { event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_S= TOPPED, VIR_DOMAIN_EVENT_STOPPED_FROM_SNA= PSHOT); qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, --=20 2.35.1 From nobody Wed May 15 06:24:15 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=openvz.org 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 164812838916783.26225814816189; Thu, 24 Mar 2022 06:26:29 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-179-GBz15U82MrSv1qA_i1ltOA-1; Thu, 24 Mar 2022 09:26:26 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25B0C28EC115; Thu, 24 Mar 2022 13:26:24 +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 181EB40CFD05; Thu, 24 Mar 2022 13:26:23 +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 B3E38194034E; Thu, 24 Mar 2022 13:26:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 090F3194034B for ; Thu, 24 Mar 2022 13:26:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F104F4010A37; Thu, 24 Mar 2022 13:26:21 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC165400E122 for ; Thu, 24 Mar 2022 13:26:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D4C3C83395E for ; Thu, 24 Mar 2022 13:26:21 +0000 (UTC) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-312-AOeEFDl_OQubsHz4eJKjOg-1; Thu, 24 Mar 2022 09:26:20 -0400 Received: by mail-lf1-f48.google.com with SMTP id a26so8002388lfg.10 for ; Thu, 24 Mar 2022 06:26:19 -0700 (PDT) Received: from vzbook.. (broadband-90-154-71-96.ip.moscow.rt.ru. [90.154.71.96]) by smtp.gmail.com with ESMTPSA id k10-20020a2eb74a000000b0024965dbf2d8sm348410ljo.82.2022.03.24.06.26.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 06:26:18 -0700 (PDT) X-MC-Unique: GBz15U82MrSv1qA_i1ltOA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: AOeEFDl_OQubsHz4eJKjOg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QYOZQ4J5dHRAW8L/QibAv5Hlv687z0iaEGZy+2CSfjE=; b=mHMH8zT7g8oaRRI2s9Q+WMWpE0UaY6VhuaoKup1ZUC6Mkzz2ARhPu+izdt/LeyFR48 +i2UHhb/qG4zKFBmHrsWtEu1g5yPJR1EakV4fSSnD34gjlMvaSbyPOTkFejvQS1ZUcr1 u15tpXp8+vUlaNJDIeSYhA/EQIqlcZTd34ibjJfyvO3bWVgGHBIHiD5pe9/FPwWgydAY Ho6yll323JocC5KQnTMMvSUO2lDka4eW2/1ojCjcbeod2rNNT/aj3YSxK5tXchk9M0PP ntjRxGPjZXqAmFBNh3Lmnabm09UOcJNbuR5zNtt44EqnF2ijE72jG0ThqNoJp6eigJDm YpAA== X-Gm-Message-State: AOAM532X6VOu+77Xjr2GrVM7Hl5NiIGKlR+91hybrw1q5CQ30KL0LW0b asR0TJqw4slYSsSXG280qUXP2cuu7hxxcw== X-Google-Smtp-Source: ABdhPJzF6VHuUjS4QHc6hwkDmDZI7+iCXJGLgottEQ9OOnRWvAfG1rTodeJ05z6f4d/y/C5rWvVCSg== X-Received: by 2002:ac2:4c99:0:b0:44a:11f4:8efb with SMTP id d25-20020ac24c99000000b0044a11f48efbmr3688035lfl.149.1648128378312; Thu, 24 Mar 2022 06:26:18 -0700 (PDT) From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH v2 2/3] qemu: remove excessive check in qemuSnapshotCreateActiveInternal Date: Thu, 24 Mar 2022 16:26:03 +0300 Message-Id: <20220324132604.131149-3-nikolay.shirokovskiy@openvz.org> In-Reply-To: <20220324132604.131149-1-nikolay.shirokovskiy@openvz.org> References: <20220324132604.131149-1-nikolay.shirokovskiy@openvz.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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.84 on 10.11.54.1 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1648128393457100001 After [1] it is not possible to get inactive state for domain while communicating with QEMU (see also [2]). Also even if it were possible the qemuProcessStopCPUs would return error and the check would not be reached. [1] commit 81f50cb92d16643bcd749e3ab5b404b8b7cec643 Author: Jiri Denemark Date: Thu Feb 11 11:20:28 2016 +0100 qemu: Avoid calling qemuProcessStop without a job [2] commit f1ea5bd506b6e00aa8bf55940b147d3c0fe7f124 Author: J=C3=A1n Tomko Date: Wed Nov 24 13:41:09 2021 +0100 qemu: turn qemuDomainObjExitMonitor into void Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_snapshot.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index cd94ddae24..540fda4854 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -305,11 +305,6 @@ qemuSnapshotCreateActiveInternal(virQEMUDriver *driver, goto cleanup; =20 resume =3D true; - if (!virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); - goto cleanup; - } } =20 if (qemuDomainObjEnterMonitorAsync(driver, vm, --=20 2.35.1 From nobody Wed May 15 06:24:15 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=openvz.org 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 164812839723459.41751552814367; Thu, 24 Mar 2022 06:26: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-641-rHKLaMakNkKIIGA_vSUsmw-1; Thu, 24 Mar 2022 09:26: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 8A1C1803D65; Thu, 24 Mar 2022 13:26: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 7256D54EC72; Thu, 24 Mar 2022 13:26: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 2B1FA194034E; Thu, 24 Mar 2022 13:26: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 520FF194034E for ; Thu, 24 Mar 2022 13:26:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 35B989E64; Thu, 24 Mar 2022 13:26:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 313789E63 for ; Thu, 24 Mar 2022 13:26:22 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4B9A3C1EA4A for ; Thu, 24 Mar 2022 13:26:22 +0000 (UTC) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-154-umgmHaynOpmeHaPU-A-otA-1; Thu, 24 Mar 2022 09:26:20 -0400 Received: by mail-lf1-f44.google.com with SMTP id m3so8000981lfj.11 for ; Thu, 24 Mar 2022 06:26:20 -0700 (PDT) Received: from vzbook.. (broadband-90-154-71-96.ip.moscow.rt.ru. [90.154.71.96]) by smtp.gmail.com with ESMTPSA id k10-20020a2eb74a000000b0024965dbf2d8sm348410ljo.82.2022.03.24.06.26.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 06:26:18 -0700 (PDT) X-MC-Unique: rHKLaMakNkKIIGA_vSUsmw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: umgmHaynOpmeHaPU-A-otA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F9YkbXGk6wioQff2lLWsmR9yLKoDS9Nhjg/m0aWSS7w=; b=2hev0DxDQH1JpsK1I4goLfyGNJEwJT8ZIMv1A+9B93hJ2x4kP8L2bzOSymR2D5yK/k kdagRWgxDYIKvctsEexBrc2QIjbnhf/kzPtHOtsslY6ZqaZvlhwZLM9lOKubs4TzkX1o VHUFitdPqTAQu65p7IYQb+xejCBaVRQ8w9gHP7UDmWRUWRKg1Dqm0fesEnsf71pYR+Ti 4UB14psJiiJRI1+uQ8PtU0Anwuxxo/mpLx4rbrZvUl0JmB6JjZ0SFsmuIRDC2nK5wqoq +8rejzsfKSBvlLif7pt8s7DmcvDYgY/oj7j0LgMZ1fbUPytiqchxYLnkjjRXH4lRFZY+ /UPQ== X-Gm-Message-State: AOAM531pfUg1UOTH8LVcBuBjMQyYQb9IW2HnBwccCJGemPOfziNxWOa7 OW2dKh9IwLLmfwdCw6i8MOYfTLBaSFypyw== X-Google-Smtp-Source: ABdhPJz/AnkKn2iZm7qvZiyM4PzMLsWDxip4tRrdITU0r6oAxco/z2dXqFbhb4Bko3vL90pbsGhA6w== X-Received: by 2002:ac2:4ec3:0:b0:443:6504:ee19 with SMTP id p3-20020ac24ec3000000b004436504ee19mr3787838lfr.260.1648128379128; Thu, 24 Mar 2022 06:26:19 -0700 (PDT) From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH v2 3/3] qemu: remove unnecessary gotos in qemuSnapshotCreateActiveInternal Date: Thu, 24 Mar 2022 16:26:04 +0300 Message-Id: <20220324132604.131149-4-nikolay.shirokovskiy@openvz.org> In-Reply-To: <20220324132604.131149-1-nikolay.shirokovskiy@openvz.org> References: <20220324132604.131149-1-nikolay.shirokovskiy@openvz.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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-ZM-MESSAGEID: 1648128399274100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_snapshot.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 540fda4854..c23fb40849 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -297,21 +297,19 @@ qemuSnapshotCreateActiveInternal(virQEMUDriver *drive= r, int ret =3D -1; =20 if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0)) - goto cleanup; + return -1; =20 if (halt) { if (qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_SAVE, QEMU_ASYNC_JOB_SNAPSHOT) < 0) - goto cleanup; + return -1; =20 resume =3D true; } =20 if (qemuDomainObjEnterMonitorAsync(driver, vm, - QEMU_ASYNC_JOB_SNAPSHOT) < 0) { - resume =3D false; - goto cleanup; - } + QEMU_ASYNC_JOB_SNAPSHOT) < 0) + return -1; =20 ret =3D qemuMonitorCreateSnapshot(priv->mon, snap->def->name); qemuDomainObjExitMonitor(driver, vm); --=20 2.35.1