From nobody Mon Feb 9 00:07:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1487877999547141.06012278730884; Thu, 23 Feb 2017 11:26:39 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NJNCLw047049; Thu, 23 Feb 2017 14:23:12 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1NJLIEu001332 for ; Thu, 23 Feb 2017 14:21:18 -0500 Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1NJL8ua028635; Thu, 23 Feb 2017 14:21:17 -0500 From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 20:22:00 +0100 Message-Id: <8f29ee660574e1d9d622cc7dd30c7c39b1074335.1487877253.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [RFC PATCH 07/12] 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 ea10fff45..cfe4073de 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1439,6 +1439,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, @@ -1634,6 +1673,7 @@ static qemuMonitorCallbacks monitorCallbacks =3D { .domainMigrationStatus =3D qemuProcessHandleMigrationStatus, .domainMigrationPass =3D qemuProcessHandleMigrationPass, .domainAcpiOstInfo =3D qemuProcessHandleAcpiOstInfo, + .domainBlockThreshold =3D qemuProcessHandleBlockThreshold, }; static void --=20 2.11.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list