From nobody Tue Sep 9 03:17:51 2025 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; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1747323132; cv=none; d=zohomail.com; s=zohoarc; b=P2zqP7LtYkvVG62pNrQLHn6OnjAVRWk4p3ZhqIG6+UJVEm6ZRL+uBaI3wOjbWxS7H0TYdfVgsaHq9M7jA3IMkoVLcwVV1y8kdpk2EDGXemu0VmQ3ww0xcz5yLCzhKrlginEdeQOz0/5e7KqkghCEX6AYzmg1qxStSY4oDJinDcc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747323132; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=EKGpu6g2ecJVd5sF92AYvQKdeemgP+bwcCmb1gAFh3M=; b=VSVO7iJnBtMfOLeO/a4BBZR9sVuDDd4x2GhRI3sq92Vz2kFQwvJw9s3zn6ggWDyEB/MAe3bUJ3tsahNVUd5NsY4glCPZ3vO5iIX2Nl+HqMhkqkcxK0p/w8Xk4DVtYy91W0/jqLzIJOLJSkSObxETc2q2yvY1A2StFQwGtUUuwq0= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17473231323491.804703331631913; Thu, 15 May 2025 08:32:12 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6BA30135C; Thu, 15 May 2025 11:32:11 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 968B812BF; Thu, 15 May 2025 11:29:44 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id C8F9E13A6; Thu, 15 May 2025 11:29:38 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 EEFE213D6 for ; Thu, 15 May 2025 11:29:23 -0400 (EDT) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-yw9m5MsPOP2kzck5EW1qAA-1; Thu, 15 May 2025 11:29:22 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3FCAD1954B1D for ; Thu, 15 May 2025 15:29:21 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.37]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3BBDF18003FC; Thu, 15 May 2025 15:29:19 +0000 (UTC) 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, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747322963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MS1DU9QO7T/yZJLy3+Ww9txT1XLNz+Yy7VZvdv5aW6A=; b=ZZQNgHJrp1Wh2k3r8hW63lscoG1sCYPEBbIouC+yd8gGDkyPQsl7z8aM0JpeFSCvyrvWat 3luxZ7BRkuKe2onLNMA4UrmpvrZXoD1HS/I7CW6QdR0WYKSEDByhB6taeFuBnZ01I1BiJX X2hEEOhmVBfo4b2pmclKXc8h6NZniZU= X-MC-Unique: yw9m5MsPOP2kzck5EW1qAA-1 X-Mimecast-MFC-AGG-ID: yw9m5MsPOP2kzck5EW1qAA_1747322961 To: devel@lists.libvirt.org Subject: [PATCH 06/17] qemuProcessLaunch: Rename 'snapshot' to 'internalSnapshotRevert' Date: Thu, 15 May 2025 17:28:51 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: asW7TClU1sH7Z9fZfiihkPfmnTc0DGozzanilnF2n6g_1747322961 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FMY2AS7BNERNKUXRDA4XFXS3WKGN4ORA X-Message-ID-Hash: FMY2AS7BNERNKUXRDA4XFXS3WKGN4ORA X-MailFrom: pkrempa@redhat.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 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: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1747323134644116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Make it obvious that the variable is used for internal snapshot reversion by renaming it. This is necessary mainly as the function parameters are not documented, but makes it obvious also if they were. We can also report the name of the sanpshot rather than a pointer that says absolutely nothing to the reader. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 15 ++++++++------- src/qemu/qemu_process.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 46a33036b7..d86138aef4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7963,7 +7963,7 @@ qemuProcessLaunch(virConnectPtr conn, virDomainObj *vm, virDomainAsyncJob asyncJob, qemuProcessIncomingDef *incoming, - virDomainMomentObj *snapshot, + virDomainMomentObj *internalSnapshotRevert, virNetDevVPortProfileOp vmop, unsigned int flags) { @@ -7983,12 +7983,13 @@ qemuProcessLaunch(virConnectPtr conn, VIR_DEBUG("conn=3D%p driver=3D%p vm=3D%p name=3D%s id=3D%d asyncJob=3D= %d " "incoming.uri=3D%s " "incoming.fd=3D%d incoming.path=3D%s " - "snapshot=3D%p vmop=3D%d flags=3D0x%x", + "internalSnapshotRevert=3D'%s' vmop=3D%d flags=3D0x%x", conn, driver, vm, vm->def->name, vm->def->id, asyncJob, NULLSTR(incoming ? incoming->uri : NULL), incoming ? incoming->fd : -1, NULLSTR(incoming ? incoming->path : NULL), - snapshot, vmop, flags); + NULLSTR(internalSnapshotRevert ? internalSnapshotRevert->def= ->name : NULL), + vmop, flags); /* Okay, these are just internal flags, * but doesn't hurt to check */ @@ -8252,9 +8253,9 @@ qemuProcessLaunch(virConnectPtr conn, qemuDomainVcpuPersistOrder(vm->def); - if (snapshot) { + if (internalSnapshotRevert) { VIR_DEBUG("reverting internal snapshot via QMP"); - if (qemuSnapshotInternalRevert(vm, snapshot, asyncJob) < 0) + if (qemuSnapshotInternalRevert(vm, internalSnapshotRevert, asyncJo= b) < 0) goto cleanup; } @@ -8306,14 +8307,14 @@ qemuProcessLaunch(virConnectPtr conn, /* Since CPUs were not started yet, the balloon could not return the m= emory * to the host and thus cur_balloon needs to be updated so that GetXML= desc * and friends return the correct size in case they can't grab the job= */ - if (!incoming && !snapshot && + if (!incoming && !internalSnapshotRevert && qemuProcessRefreshBalloonState(vm, asyncJob) < 0) goto cleanup; if (flags & VIR_QEMU_PROCESS_START_AUTODESTROY) virCloseCallbacksDomainAdd(vm, conn, qemuProcessAutoDestroy); - if (!incoming && !snapshot) { + if (!incoming && !internalSnapshotRevert) { VIR_DEBUG("Setting up transient disk"); if (qemuProcessSetupDisksTransient(vm, asyncJob) < 0) goto cleanup; diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 1729b39d73..021dbbd960 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -153,7 +153,7 @@ int qemuProcessLaunch(virConnectPtr conn, virDomainObj *vm, virDomainAsyncJob asyncJob, qemuProcessIncomingDef *incoming, - virDomainMomentObj *snapshot, + virDomainMomentObj *internalSnapshotRevert, virNetDevVPortProfileOp vmop, unsigned int flags); --=20 2.49.0