From nobody Wed Apr 24 16:59:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1575018046; cv=none; d=zohomail.com; s=zohoarc; b=A+0C/rkW7/PMZCzkXXhTgv7UdW6lJ2JDyLZUfUP2rq2wjzJ3Q5lgtOtJiesIWGo3f0o1lQCyU+V15F7rR1x7TvW/MSs3g1clXzRKINcjhzdT7YayA7sbbtM1vfzJHWaMNE/dTjdVh5BFR5l4603jbougaFdQ7AwyHP/mGgFeYNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575018046; 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=Y6o6GqHwcv8sjP3QGNb98zPoOT9Xm+1L0wUbIKlcd2E=; b=Sn4s3H5/VklcUvfZLY8lX6X/xiYiZByccgVWxonTQuvj+6frOOl/w9JQ50ilzhoYMC7PrW76f9qW8kMe0kSKuTbzqr6xQkep7G05aHjEnxckHRlNx5M/r8IO3wWLG4FgbI5Zl2umE5gJFaaoIHqKQ4ZlJmu23SmnMn/0jsaLQDY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157501804617141.655231563802204; Fri, 29 Nov 2019 01:00:46 -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-193-8jMY6KovP9ufeEKjy3so1A-1; Fri, 29 Nov 2019 04:00:43 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DBCE718B5F6C; Fri, 29 Nov 2019 09:00:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2572600CA; Fri, 29 Nov 2019 09:00:37 +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 44CAF18089CD; Fri, 29 Nov 2019 09:00:37 +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 xAT8xZfO004184 for ; Fri, 29 Nov 2019 03:59:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3B1E55D6D4; Fri, 29 Nov 2019 08:59:35 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id B903D5D6D2 for ; Fri, 29 Nov 2019 08:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575018045; 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=Y6o6GqHwcv8sjP3QGNb98zPoOT9Xm+1L0wUbIKlcd2E=; b=E3jNmA9H/8crWNWSoMEKVU05cfAwbreZ9tFOT9HjmOV+O92xFbwQWwCWLJIFs7PsDfLehY BYeQPzvGONIu6S3DMrkfBovyJeFiCK2U+VqRlpAFvN7xJOvAbg7IyYIUqJ7LtvpwHkhgDi jDnh/T2SGX+AH1EVZ11JiKJ4/PXbZm4= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 29 Nov 2019 09:59:28 +0100 Message-Id: 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 Subject: [libvirt] [PATCH 3/3] qemu: Report which iothread IDs are actually returned with VIR_DOMAIN_STATS_IOTHREAD 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.79 on 10.5.11.11 X-MC-Unique: 8jMY6KovP9ufeEKjy3so1A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The design of the stats fields returned for VIR_DOMAIN_STATS_IOTHREAD domain statistics groups deviates from the established pattern. In this instance it's impossible to infer which values of for iothread.... fields will be reported back because they have no connection to the iothread.count field. Introduce iothread.ids which will report a comma-separated list of s reported in the subsequent array in the order they will be reported. virsh domstats upstream --iothread Domain: 'upstream' iothread.count=3D2 iothread.ids=3D7,5 iothread.7.poll-max-ns=3D32768 iothread.7.poll-grow=3D0 iothread.7.poll-shrink=3D0 iothread.5.poll-max-ns=3D32768 iothread.5.poll-grow=3D0 iothread.5.poll-shrink=3D0 Signed-off-by: Peter Krempa --- src/libvirt-domain.c | 2 ++ src/qemu/qemu_driver.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 87110036ca..e6d5697445 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11620,6 +11620,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn, * will use it's iothread_id value as the . The= re * may be fewer entries than the iothread.count * value if the polling values are not supported. + * "iothread.ids" - a comma separated list of iotdread s reported = in the + * subsequent list reported as a string * "iothread..poll-max-ns" - maximum polling time in ns as an unsi= gned * long long. A 0 (zero) means polling is * disabled. diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b5300241a8..4ccc9d3d4e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -21189,6 +21189,8 @@ qemuDomainGetStatsIOThread(virQEMUDriverPtr driver, qemuMonitorIOThreadInfoPtr *iothreads =3D NULL; int niothreads; int ret =3D -1; + g_auto(virBuffer) iothridbuf =3D VIR_BUFFER_INITIALIZER; + g_autofree char *iothridstr =3D NULL; if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) return 0; @@ -21205,6 +21207,15 @@ qemuDomainGetStatsIOThread(virQEMUDriverPtr driver, if (virTypedParamListAddUInt(params, niothreads, "iothread.count") < 0) goto cleanup; + for (i =3D 0; i < niothreads; i++) + virBufferAsprintf(&iothridbuf, "%u,", iothreads[i]->iothread_id); + + virBufferTrim(&iothridbuf, ",", -1); + iothridstr =3D virBufferContentAndReset(&iothridbuf); + + if (virTypedParamListAddString(params, iothridstr, "iothread.ids") < 0) + goto cleanup; + for (i =3D 0; i < niothreads; i++) { if (iothreads[i]->poll_valid) { if (virTypedParamListAddULLong(params, iothreads[i]->poll_max_= ns, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list