From nobody Wed Feb 11 10:17:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 148959600843730.502785629539403; Wed, 15 Mar 2017 09:40:08 -0700 (PDT) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2FGauxI005280; Wed, 15 Mar 2017 12:36:56 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2FGarFc024949 for ; Wed, 15 Mar 2017 12:36:53 -0400 Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2FGafIN000870; Wed, 15 Mar 2017 12:36:52 -0400 From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 15 Mar 2017 17:37:21 +0100 Message-Id: <70ef8d606ad21be81b8c0e02e99713840c04e09f.1489595335.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 09/23] qemu: process: Wire up firing of the VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Bind it to qemus BLOCK_WRITE_THRESHOLD event. Look up the disk by nodename and construct the string to return. --- src/qemu/qemu_process.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b9c1847bb..d40deea10 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1441,6 +1441,45 @@ qemuProcessHandleAcpiOstInfo(qemuMonitorPtr mon ATTR= IBUTE_UNUSED, static int +qemuProcessHandleBlockThreshold(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + virDomainObjPtr vm, + const char *nodename, + unsigned long long threshold, + unsigned long long excess, + void *opaque) +{ + virQEMUDriverPtr driver =3D opaque; + virObjectEventPtr event =3D NULL; + virDomainDiskDefPtr disk; + virStorageSourcePtr src; + unsigned int idx; + char *dev =3D NULL; + const char *path =3D NULL; + + virObjectLock(vm); + + 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, = &idx))) { + if (virStorageSourceIsLocalStorage(src)) + path =3D src->path; + + if ((dev =3D qemuDomainDiskBackingStoreGetName(disk, src, idx))) { + event =3D virDomainEventBlockThresholdNewFromObj(vm, dev, path, + threshold, exce= ss); + } + } + + virObjectUnlock(vm); + qemuDomainEventQueue(driver, event); + + return 0; +} + + +static int qemuProcessHandleNicRxFilterChanged(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainObjPtr vm, const char *devAlias, @@ -1636,6 +1675,7 @@ static qemuMonitorCallbacks monitorCallbacks =3D { .domainMigrationStatus =3D qemuProcessHandleMigrationStatus, .domainMigrationPass =3D qemuProcessHandleMigrationPass, .domainAcpiOstInfo =3D qemuProcessHandleAcpiOstInfo, + .domainBlockThreshold =3D qemuProcessHandleBlockThreshold, }; static void --=20 2.12.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list