From nobody Sat Feb 7 07:30:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1607358898; cv=none; d=zohomail.com; s=zohoarc; b=EZtuIzKSMaTIlkAQ12baAJvb4VfNXq+Tdm1xLVuSFbDr7D+8rlLJh+P6kD7ACW6nkYvAGoyAoDYz7DerzNdzizWwey/aN9Ciz3UvjRO879Mjawnno2fgerSdtGjOtqdL6mFGPa4gCKOxGslGGezJ7Z7aiH7ly952VqSi+kN/08M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607358898; 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=AvTEjAdaJZfvW7fsultgwf/UnJGiWoTHy0MonXoeyas=; b=PwNBVn+26xc0ZSeTntPhwXZ68xnFSV4n9nQmlizH4/lknEdiOqa01MEgH8hxrIJlfN/LP7Y71ZF8U3lAKCwv8oGtza4U3PxzRsAuMKu6Md+00yeCt4tJMlT6DgAyqjQ0VTr3Nxv9gLh7rGri05xQGdGGPFPBWJ2v8P8UyzdzdcA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607358898319393.2525483269811; Mon, 7 Dec 2020 08:34:58 -0800 (PST) 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-179-st5pkLY_PrSXq965QFcTjQ-1; Mon, 07 Dec 2020 11:34:54 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08ECD8144FA; Mon, 7 Dec 2020 16:34:48 +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 D40EB2BCDA; Mon, 7 Dec 2020 16:34:47 +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 95A4650033; Mon, 7 Dec 2020 16:34:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B7GYTNO029136 for ; Mon, 7 Dec 2020 11:34:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3B2AD5D6AD; Mon, 7 Dec 2020 16:34:29 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EC565D6AB for ; Mon, 7 Dec 2020 16:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607358896; 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=AvTEjAdaJZfvW7fsultgwf/UnJGiWoTHy0MonXoeyas=; b=WLB+8AO2nvLIsEYb154/G4fHkhDe1R2+tik13U8BAgDpslV5CSP76tEM1VzNIhw/iO6H7C 2PRdjQjoafxgqTDDvP39xEvBWo0IodxvlHYpESGa25imJgwWYnSNJK6NRYjDuD3FNm5lNT QwK5/zPlyOpQqSiUKeABfDHBCTHUTfc= X-MC-Unique: st5pkLY_PrSXq965QFcTjQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/8] qemuDomainDiskLookupByNodename: Lookup also backup 'store' nodenames Date: Mon, 7 Dec 2020 17:34:15 +0100 Message-Id: <4d7f95213124cb9b4f00ade4618bb461073ed199.1607358804.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.84 on 10.5.11.23 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" Nodename may be asociated to a disk backup job, add support to looking up in that chain too. This is specifically useful for the BLOCK_WRITE_THRESHOLD event which can be registered for any nodename. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 12 ++++++++++++ src/qemu/qemu_domain.h | 1 + src/qemu/qemu_process.c | 7 +++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 44abe0ce93..7232b6131f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9896,6 +9896,7 @@ qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev, /** * qemuDomainDiskLookupByNodename: * @def: domain definition to look for the disk + * @backupdef: definition of the backup job of the domain (optional) * @nodename: block backend node name to find * @src: filled with the specific backing store element if provided * @@ -9905,6 +9906,7 @@ qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev, */ virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def, + virDomainBackupDefPtr backupdef, const char *nodename, virStorageSourcePtr *src) { @@ -9925,6 +9927,16 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def, return domdisk; } + if (backupdef) { + for (i =3D 0; i < backupdef->ndisks; i++) { + virDomainBackupDiskDefPtr backupdisk =3D backupdef->disks + i; + + if (backupdisk->store && + (*src =3D virStorageSourceFindByNodeName(backupdisk->store= , nodename))) + return virDomainDiskByTarget(def, backupdisk->name); + } + } + return NULL; } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 9e870ff1e2..32f3586882 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -912,6 +912,7 @@ int qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev, int *perms); virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def, + virDomainBackupDefPtr b= ackupdef, const char *nodename, virStorageSourcePtr *sr= c); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9d83825190..db77d8f1de 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -879,7 +879,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon G_GNUC_UNUS= ED, if (diskAlias) disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL= ); else if (nodename) - disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, NULL); + disk =3D qemuDomainDiskLookupByNodename(vm->def, NULL, nodename, N= ULL); else disk =3D NULL; @@ -1483,6 +1483,7 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon G_= GNUC_UNUSED, unsigned long long excess, void *opaque) { + qemuDomainObjPrivatePtr priv; virQEMUDriverPtr driver =3D opaque; virObjectEventPtr eventSource =3D NULL; virObjectEventPtr eventDevice =3D NULL; @@ -1492,11 +1493,13 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon = G_GNUC_UNUSED, virObjectLock(vm); + priv =3D vm->privateData; + VIR_DEBUG("BLOCK_WRITE_THRESHOLD event for block node '%s' in domain %= p %s:" "threshold '%llu' exceeded by '%llu'", nodename, vm, vm->def->name, threshold, excess); - if ((disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, &src))= ) { + if ((disk =3D qemuDomainDiskLookupByNodename(vm->def, priv->backup, no= dename, &src))) { if (virStorageSourceIsLocalStorage(src)) path =3D src->path; --=20 2.28.0