From nobody Tue Feb 10 11:55:40 2026 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 1647875835110928.5486198993299; Mon, 21 Mar 2022 08:17:15 -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-643-BP7nnshxNIyAEkDhhlc2FQ-1; Mon, 21 Mar 2022 11:17:12 -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 3D0662A5957A; Mon, 21 Mar 2022 15:17:10 +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 94BC5C23DD4; Mon, 21 Mar 2022 15:17:09 +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 5513E19451F1; Mon, 21 Mar 2022 15:17:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3DCDE19451F1 for ; Mon, 21 Mar 2022 15:17:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5D312442CD9; Mon, 21 Mar 2022 15:17:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59117442CCD for ; Mon, 21 Mar 2022 15:17:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 3FBC8185A7A4 for ; Mon, 21 Mar 2022 15:17:07 +0000 (UTC) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-401-SXPNXa-aPRS9UzfQfGfwmg-1; Mon, 21 Mar 2022 11:17:05 -0400 Received: by mail-lj1-f179.google.com with SMTP id bn33so20306034ljb.6 for ; Mon, 21 Mar 2022 08:17:05 -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 h10-20020a056512220a00b0044a308dad8csm200812lfu.149.2022.03.21.08.17.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 08:17:03 -0700 (PDT) X-MC-Unique: BP7nnshxNIyAEkDhhlc2FQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: SXPNXa-aPRS9UzfQfGfwmg-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=VSnQl9TGtyN5NfKb7dJP7ATnf/e5vTW2tnRlA3GFihE=; b=OHsld8k4xf+WIhtudtNNBw0iBRZ3/NbqEpU1T6xnYDsb9oR2T4GAA7KSScJJaMcqkw McA+HL50BpvMUprfz8bf3nZiZ0pbTj+MK7Uw/SigOlcPcKEQ+Ik/31xLohGC8hxQm/Iq eBzgTJOSBZO/JsRyqjwPUGOTBJRRTTPUivn6FBENKgl5KR6rP/ihM8NhKS5j7iSIjAIL uh8USrtaXyK/Z8AWcOfYkPcLPMUUyhjoD7ek/uzDfD0ZZsoUW9j4TvcMeFBKTpjSNI0M nyxuS9hgUjvwjLXbkxrmlcQVej6AoxfuQojey6hI1R9JFw3kaj/cOvh9hlFcwlOjTO9b ccDg== X-Gm-Message-State: AOAM5316TaC9jT52a99U57MmlCMCmR5YrkVoQDAqlnAFuwhBDBf7CXPY wLa6+wJLp8msI+KXDjUuEKIU1cDSC4uytQ== X-Google-Smtp-Source: ABdhPJy3Erx9BpMASsbWqN0USM7Uqdd9K240sWsDUvkIK0QhY4wDun8e7PwLM8zNfUXVwq8soouHSg== X-Received: by 2002:a2e:5c02:0:b0:249:824c:a70c with SMTP id q2-20020a2e5c02000000b00249824ca70cmr5089165ljb.259.1647875823576; Mon, 21 Mar 2022 08:17:03 -0700 (PDT) From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH 3/3] qemu: remove unnecessary goto in qemuSnapshotCreateActiveInternal Date: Mon, 21 Mar 2022 18:16:51 +0300 Message-Id: <20220321151651.330253-4-nikolay.shirokovskiy@openvz.org> In-Reply-To: <20220321151651.330253-1-nikolay.shirokovskiy@openvz.org> References: <20220321151651.330253-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.9 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-ZM-MESSAGEID: 1647875835562100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_snapshot.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 8c050cbd75..18b802e6d5 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -290,43 +290,42 @@ qemuSnapshotCreateActiveInternal(virQEMUDriver *drive= r, unsigned int flags) { qemuDomainObjPrivate *priv =3D vm->privateData; - virObjectEvent *event =3D NULL; virDomainSnapshotDef *snapdef =3D virDomainSnapshotObjGetDef(snap); bool halt =3D !!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT); - int ret =3D -1; + int rc; =20 if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0)) - goto cleanup; + return -1; =20 if (halt && qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_SAVE, QEMU_ASYNC_JOB_SNAPSHOT) < 0) - goto cleanup; + return -1; =20 if (qemuDomainObjEnterMonitorAsync(driver, vm, QEMU_ASYNC_JOB_SNAPSHOT) < 0) - goto cleanup; + return -1; =20 - ret =3D qemuMonitorCreateSnapshot(priv->mon, snap->def->name); + rc =3D qemuMonitorCreateSnapshot(priv->mon, snap->def->name); qemuDomainObjExitMonitor(driver, vm); - if (ret < 0) - goto cleanup; + if (rc < 0) + return -1; =20 if (!(snapdef->cookie =3D (virObject *) qemuDomainSaveCookieNew(vm))) - goto cleanup; + return -1; =20 if (halt) { + virObjectEvent *event; + event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_S= TOPPED, VIR_DOMAIN_EVENT_STOPPED_FROM_SNA= PSHOT); + virObjectEventStateQueue(driver->domainEventState, event); qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, QEMU_ASYNC_JOB_SNAPSHOT, 0); virDomainAuditStop(vm, "from-snapshot"); } =20 - cleanup: - virObjectEventStateQueue(driver->domainEventState, event); - - return ret; + return 0; } =20 =20 --=20 2.35.1