From nobody Tue Feb 10 07:41:04 2026 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=1621601346; cv=none; d=zohomail.com; s=zohoarc; b=TirOcvtYA5qmkPaDwBIrzE3I89mvR0XYlrI5RlPYWxk+T0ZFyYRLzb0CG8p/o9w869jj3J1sEa772s612SOQhOdGFx3BvcRsLkAaFNz+6UT+y3RxdKDtoY7XBhW4ZOPue5XQ6tYzUKB6bMIogs8dszVnx4rsLPotFYtbvCs/9Lc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621601346; 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=j5Et+hxYbXsc63LGYT4gs/J53PGPwbE0vRXW1cKsG1I=; b=UrwYHBWEKKzzPXSv+9VSmU6G74FkAumzwJiFyE8wCUVMxtrHSC3Urg2LB4P4LQl2uH6mieRgh9quFrgRsw1uFx4Pa8n+fcGAn6UQsns4Y57+Dy/99TLjlyi/RmF9ol3yffhv8IrXKFll0C38otu8WE378LO0v2JKzND5Dv5e1js= 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) header.from= 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 1621601346751907.4266325516099; Fri, 21 May 2021 05:49:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-460-PJc0K-xoNQWHgAmv5Yoirg-1; Fri, 21 May 2021 08:48:01 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F13125B394; Fri, 21 May 2021 12:47:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE06A5C67A; Fri, 21 May 2021 12:47:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9DB01180102A; Fri, 21 May 2021 12:47:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14LCljBH030946 for ; Fri, 21 May 2021 08:47:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id B1B6A69FCE; Fri, 21 May 2021 12:47:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 140275945B for ; Fri, 21 May 2021 12:47:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621601345; 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=j5Et+hxYbXsc63LGYT4gs/J53PGPwbE0vRXW1cKsG1I=; b=TBCuM/c1s7QrR3AjRG9yogX1KLK1G99yaQIv6pCatVvVbjKa59ejHLLNUzNnAPVI0MyWnV YjuRMkWDmlz/IEL9zx9vlc/7AzKOI6KibpL6w8XvxgtEp0vxLuyXcIWWUEK/HKZLdC2pan 5NsTfNMHFiDXSIlBbyxlvJQLis8Sh60= X-MC-Unique: PJc0K-xoNQWHgAmv5Yoirg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/35] qemuSnapshotDiskContext: Store virQEMUDriverConfig in the struct Date: Fri, 21 May 2021 14:47:04 +0200 Message-Id: <7b5d502e01787d1498ed462a39ff4e7cb8c45c66.1621601160.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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) Content-Type: text/plain; charset="utf-8" The config is used both with the preparation and execution functions, so we can store it in the context to simplify other helpers. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_snapshot.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index b93b9b9fb0..def2733958 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -896,6 +896,8 @@ struct _qemuSnapshotDiskContext { virJSONValue *actions; + virQEMUDriverConfig *cfg; + /* needed for automatic cleanup of 'dd' */ virDomainObj *vm; qemuDomainAsyncJob asyncJob; @@ -909,11 +911,14 @@ qemuSnapshotDiskContextNew(size_t ndisks, virDomainObj *vm, qemuDomainAsyncJob asyncJob) { + qemuDomainObjPrivate *priv =3D vm->privateData; + virQEMUDriver *driver =3D priv->driver; qemuSnapshotDiskContext *ret =3D g_new0(qemuSnapshotDiskContext, 1); ret->dd =3D g_new0(qemuSnapshotDiskData, ndisks); ret->actions =3D virJSONValueNewArray(); ret->vm =3D vm; + ret->cfg =3D virQEMUDriverGetConfig(driver); ret->asyncJob =3D asyncJob; return ret; @@ -930,6 +935,8 @@ qemuSnapshotDiskContextCleanup(qemuSnapshotDiskContext = *snapctxt) qemuSnapshotDiskCleanup(snapctxt->dd, snapctxt->ndd, snapctxt->vm, sna= pctxt->asyncJob); + virObjectUnref(snapctxt->cfg); + g_free(snapctxt); } --=20 2.31.1