From nobody Mon Feb 9 16:51:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1655924658; cv=none; d=zohomail.com; s=zohoarc; b=iCG1RRIk8uE9HykHGl9UAtu934/ZmxT/vFq48wL6DiwsgW2UNuUdcX38kxB8ieW6R/8yR0MO1cUeyph+H2g0uF5mJkFAxAyRz0vwN1pBryHeZY+7t8ifqX3rtfre0ilp7BJzJ9AwC790Oc5cDbZiSssF0EYxjafNOuHsKf1FHI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655924658; 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; bh=G5KkPhs3W9VvOQn89FxTsY+0TbY1HOXYtgWOM7Ij0ug=; b=mpNuexJ4fdldS2+XKr3Zt5w/NRyjyOCpr3WvcdQjxE47kH9bjREaolE3R62BAe3/R1dihAFFpK9hGFoufomtuibT+zb1cggg6NAotO0AUAckZJW70Uey+6TTxe6FgHR4g6rnJu2Vmf0uZFfJz053ZfTZEyK1WzDC43/L6YB3WGU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655924658093467.1470096375874; Wed, 22 Jun 2022 12:04:18 -0700 (PDT) Received: from localhost ([::1]:49346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o45eC-0002SG-Ec for importer@patchew.org; Wed, 22 Jun 2022 15:04:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o45Gl-0008I5-8h for qemu-devel@nongnu.org; Wed, 22 Jun 2022 14:40:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o45Gj-0002JR-9t for qemu-devel@nongnu.org; Wed, 22 Jun 2022 14:40:02 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-O5_6O4CSOUmBLv0Zf6Tu8A-1; Wed, 22 Jun 2022 14:39:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 260CE3C41667; Wed, 22 Jun 2022 18:39:57 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.33.36.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45ABD9D63; Wed, 22 Jun 2022 18:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655923200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G5KkPhs3W9VvOQn89FxTsY+0TbY1HOXYtgWOM7Ij0ug=; b=H4MXyF8cO+hMslSdHe3CQqlEDzRrvLyIh9yljwodOR9GcvOuzQM1U6rJNbs+mca8jJc7m5 dGxEzNDjZ/BYezcdBI/eWQOhbOTLmXlIm/N433I7CktNBMkjhc9goPCpmHhJWoFkuguX6A XiwLZQlOnhqe/qs6zGxJQK0GqbwMKXc= X-MC-Unique: O5_6O4CSOUmBLv0Zf6Tu8A-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, berrange@redhat.com, huangy81@chinatelecom.cn, quintela@redhat.com, leobras@redhat.com Cc: jdenemar@redhat.com Subject: [PULL 30/33] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function Date: Wed, 22 Jun 2022 19:39:14 +0100 Message-Id: <20220622183917.155308-31-dgilbert@redhat.com> In-Reply-To: <20220622183917.155308-1-dgilbert@redhat.com> References: <20220622183917.155308-1-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1655924659920100001 From: Hyman Huang(=E9=BB=84=E5=8B=87) Introduce kvm_dirty_ring_size util function to help calculate dirty ring ful time. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) Acked-by: Peter Xu Message-Id: Signed-off-by: Dr. David Alan Gilbert dgilbert: Fixed up excess #endif --- accel/kvm/kvm-all.c | 5 +++++ accel/stubs/kvm-stub.c | 5 +++++ include/sysemu/kvm.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 672ed004ab..59b8ea1a05 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2318,6 +2318,11 @@ static void query_stats_cb(StatsResultList **result,= StatsTarget target, strList *names, strList *targets, Error **errp); static void query_stats_schemas_cb(StatsSchemaList **result, Error **errp); =20 +uint32_t kvm_dirty_ring_size(void) +{ + return kvm_state->kvm_dirty_ring_size; +} + static int kvm_init(MachineState *ms) { MachineClass *mc =3D MACHINE_GET_CLASS(ms); diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index 3345882d85..2ac5f9c036 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -148,3 +148,8 @@ bool kvm_dirty_ring_enabled(void) { return false; } + +uint32_t kvm_dirty_ring_size(void) +{ + return 0; +} diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index a783c78868..efd6dee818 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -582,4 +582,6 @@ bool kvm_cpu_check_are_resettable(void); bool kvm_arch_cpu_check_are_resettable(void); =20 bool kvm_dirty_ring_enabled(void); + +uint32_t kvm_dirty_ring_size(void); #endif --=20 2.36.1