From nobody Mon Feb 9 10:28:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1563947840; cv=none; d=zoho.com; s=zohoarc; b=f/JlA1ujtD0YOX7g9f0JyxgITprBjlJ1NBYP82NaUQJfYhL2Wl2eypnhgl17BG3BhGfA5rf58XwXHdpnMJDmmhtM3gPUvKfFnL5lu1dlRhmYj4qXbSWdfNuXCudFcmCe8WBDzylYcRwdj0VZQzdOZE1aIm/o9RimV/4CpDabelA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563947840; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=8bC8hw7xZV/bvi7VVshpOvE8eTgTHMfvOra/uVdBRXU=; b=YsjfBteE1nnPLKe/cVkLCJ/hpTUfKRhUNx2ujry0k6wGf0Ct2RHib9/3TpBXV0uuCtOBR9J1mcrR6WAP/osRh/sY61ktx6J9NIP/21eDC+zG8pG+ieYREhzR9p2K2yFmY42jc2NwR1l6rvisTaiVC6t975AWvdQuthav+b2ppxk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563947840923366.4053763952095; Tue, 23 Jul 2019 22:57:20 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id CC390300C72E; Wed, 24 Jul 2019 05:57:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4056F1820E; Wed, 24 Jul 2019 05:57:19 +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 F2E8E19732; Wed, 24 Jul 2019 05:57:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6O5vHd8030222 for ; Wed, 24 Jul 2019 01:57:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id D14C160C69; Wed, 24 Jul 2019 05:57:17 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-93.phx2.redhat.com [10.3.116.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 345A360C05; Wed, 24 Jul 2019 05:57:01 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Wed, 24 Jul 2019 00:56:07 -0500 Message-Id: <20190724055609.30691-18-eblake@redhat.com> In-Reply-To: <20190724055609.30691-1-eblake@redhat.com> References: <20190724055609.30691-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: nsoffer@redhat.com, eshenitz@redhat.com, pkrempa@redhat.com Subject: [libvirt] [PATCH v10 17/19] backup: qemu: Add helper API for looking up node name 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 24 Jul 2019 05:57:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Qemu bitmap operations require knowing the node name associated with the format layer (the qcow2 file); as upcoming patches will be grabbing that information frequently, make a helper function to access it. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_domain.h | 3 +++ src/qemu/qemu_domain.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index eeb07180b7..b76d3cace9 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -804,6 +804,9 @@ int qemuDomainDetermineDiskChain(virQEMUDriverPtr drive= r, bool qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk, virDomainDiskDefPtr orig_disk); +const char *qemuDomainDiskNodeFormatLookup(virDomainObjPtr vm, + const char *disk); + int qemuDomainStorageFileInit(virQEMUDriverPtr driver, virDomainObjPtr vm, virStorageSourcePtr src, diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 44ac7eb73e..d71b7d1984 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10260,6 +10260,21 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr = disk, return true; } + +/* Return the format node name for a given disk of an online guest */ +const char * +qemuDomainDiskNodeFormatLookup(virDomainObjPtr vm, + const char *disk) +{ + size_t i; + + for (i =3D 0; i < vm->def->ndisks; i++) { + if (STREQ(vm->def->disks[i]->dst, disk)) + return vm->def->disks[i]->src->nodeformat; + } + return NULL; +} + bool qemuDomainDiskBlockJobIsActive(virDomainDiskDefPtr disk) { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list