From nobody Tue Mar 24 01:09:05 2026 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=1772835439; cv=none; d=zohomail.com; s=zohoarc; b=Rq8YbRj/gooCfiCtuEISzKsMh9aJFgWKqwtjNcXzUiHk1Hu7pmpSKRKORb0H8k2wBcDM7H3DeET/+28It/v4xgttSLqjvsns2q+oU8bZW3uEpibPbZ+B5mNVVsbnJSWOrYK0eyWtDsMqtRO5fwLYicWbILCXJTjI1G5QMbnXass= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772835439; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=eUb8OBRdF0sEFAu9cki+HJ5cVMJuWDKWiuNyYRAYRhM=; b=L5Pkth8PqSVOgg9HlPu0DXl0EN9xqP0rbzVN7WN0xkHoO0QCy1/3lnSKLZbVpQ5Cy2romCGVpGIc9GGGhmtenZCsVczsZ7kdJnp1wQResOcPB0irrivTk6IiI3DLH31OBeZZiVY4PtMo07ev5OTXMdj1xQAzzwRjbhJXBoQohnk= 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 1772835439553299.4417735859802; Fri, 6 Mar 2026 14:17:19 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id EF2153FA60; Fri, 6 Mar 2026 17:17:18 -0500 (EST) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 3CF3341A03; Fri, 6 Mar 2026 17:13:14 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id B597D418DE; Fri, 6 Mar 2026 17:12:59 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 41FB93F8A5 for ; Fri, 6 Mar 2026 17:12:59 -0500 (EST) Received: from mx-prod-mc-05.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-117-_78jj58DNjWON_HaJU3ALA-1; Fri, 06 Mar 2026 17:12:57 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E2DDF1956089 for ; Fri, 6 Mar 2026 22:12:56 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.81.168]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7F40D1958DC5 for ; Fri, 6 Mar 2026 22:12:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772835178; h=from:from: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; bh=eUb8OBRdF0sEFAu9cki+HJ5cVMJuWDKWiuNyYRAYRhM=; b=aAf9cOMimSYEZd84uWYOjtP7b9oai5uL8fIBVT3ICzU3i2hYkQrVqVSIu1BMG4k/o9yZvL xgyRpJumdotREkL7pAQBFAKBd7QYG4y5F4o5/PpBMqkdwrJeRl7oBnFwGZmx3kNZCz8qfY hs4UK4nIliyVnX33djcf+CVcwh22y2Q= X-MC-Unique: _78jj58DNjWON_HaJU3ALA-1 X-Mimecast-MFC-AGG-ID: _78jj58DNjWON_HaJU3ALA_1772835177 To: devel@lists.libvirt.org Subject: [PATCH 5/5] hyperv: Implement virDomainSnapshotGetParent() Date: Fri, 6 Mar 2026 16:12:51 -0600 Message-ID: <20260306221251.929040-6-jjongsma@redhat.com> In-Reply-To: <20260306221251.929040-1-jjongsma@redhat.com> References: <20260306221251.929040-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: TzbFfpFLcg29iYO3jC9YkZAAbJyWpuHBDWWDMbcHlRw_1772835177 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: H7YIJT7F5JOOJID7SLXMPTARP74NOCCI X-Message-ID-Hash: H7YIJT7F5JOOJID7SLXMPTARP74NOCCI X-MailFrom: jjongsma@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jonathon Jongsma via Devel Reply-To: Jonathon Jongsma X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1772835442374154100 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Jonathon Jongsma --- src/hyperv/hyperv_driver.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index dd1248ced1..d3e17d7a16 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -4321,6 +4321,31 @@ hypervDomainSnapshotGetXMLDesc(virDomainSnapshotPtr = snapshot, } =20 =20 +static virDomainSnapshotPtr +hypervDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, + unsigned int flags) +{ + g_autoptr(Msvm_VirtualSystemSettingData) vssd =3D NULL; + g_autofree char* parent_id =3D NULL; + + virCheckFlags(0, NULL); + + vssd =3D hypervDomainLookupSnapshotSD(snapshot->domain, snapshot->name= ); + if (!vssd) + return NULL; + + parent_id =3D hypervParseInstanceIdFromParentPath(vssd->data->Parent); + if (!parent_id) { + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("snapshot '%1$s' does not have a parent"), + snapshot->name); + return NULL; + } + + return virGetDomainSnapshot(snapshot->domain, parent_id); +} + + static virHypervisorDriver hypervHypervisorDriver =3D { .name =3D "Hyper-V", .connectOpen =3D hypervConnectOpen, /* 0.9.5 */ @@ -4393,6 +4418,7 @@ static virHypervisorDriver hypervHypervisorDriver =3D= { .domainSnapshotGetXMLDesc =3D hypervDomainSnapshotGetXMLDesc, /* 12.2.= 0 */ .domainHasCurrentSnapshot =3D hypervDomainHasCurrentSnapshot, /* 12.2.= 0 */ .domainSnapshotCurrent =3D hypervDomainSnapshotCurrent, /* 12.2.0 */ + .domainSnapshotGetParent =3D hypervDomainSnapshotGetParent, /* 12.2.0 = */ }; =20 =20 --=20 2.53.0