From nobody Sun Feb 8 21:42:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1602545811; cv=none; d=zohomail.com; s=zohoarc; b=kmjrIweTNNOWt6ZO/Mi5zjoSzdW7IanMfgKetispGDMMLUNrQ/TW9HkmnaLYL0RI1BRWEkTuQvWsrSDo6XePEzeQ2180Y0U4Kl2IIn+nCFVehRuZ0866j6l0UCnIINlpR+D6M8Q6ZaCY4S8VJkd+tEyhvWOM33ckGREsMO42C3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602545811; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=cSBYSZIJGkD/u+GEjLwAjT6zrwUPagZiXyILewBV3cc=; b=BRznuC0XLldHBeYStAO+2B/hh6uFNS4KP4HLLGWqRLnNxMfCQdXEJ+x6rArHPdllQWCJ6ZxNN6zXCHkJsjKM83EN9Qs+XUzenVs1u7fCstvfbluxd4yje4hyJZpZWkYwQo52oRpc3YWExWeb69yZzpHOJgXg0dPqW53a91XV3R0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1602545811729943.4104633662791; Mon, 12 Oct 2020 16:36:51 -0700 (PDT) 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-164-z2_Wr5V_O8SkiniGPGh3Zw-1; Mon, 12 Oct 2020 19:36:48 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39341835B48; Mon, 12 Oct 2020 23:36:43 +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 1688010013C0; Mon, 12 Oct 2020 23:36:43 +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 CDE7C58112; Mon, 12 Oct 2020 23:36:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09CNaOK4008403 for ; Mon, 12 Oct 2020 19:36:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4771D5D98A; Mon, 12 Oct 2020 23:36:24 +0000 (UTC) Received: from npache.remote.csb (ovpn-116-246.rdu2.redhat.com [10.10.116.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id A57095D9CD; Mon, 12 Oct 2020 23:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602545810; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cSBYSZIJGkD/u+GEjLwAjT6zrwUPagZiXyILewBV3cc=; b=dlEM01g/0fVl2vrQSbCj4fORtTODgYsnPQI96hA4FStpytbGKKnHOEmk7TqP7FcFg62EAA rnSL4x6USneiuzOjDEO6d3yI2AO2DjfkJgP/wWv0jbvgh7oIoeLUr2vXNckYADxX5w39ei afKuiA86aXgRKg+Ybm9+JEY4JyxHOTE= X-MC-Unique: z2_Wr5V_O8SkiniGPGh3Zw-1 From: Nico Pache To: libvir-list@redhat.com, david@redhat.com, nitesh@redhat.com Subject: [PATCH v2 3/4] QEMU: introduce Virtio free page reporting feature Date: Mon, 12 Oct 2020 19:35:38 -0400 Message-Id: <04c2c513b2322a7d3418ba6c597775677b619a17.1602545532.git.npache@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: npache@redhat.com, ehabkost@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.22 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 X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch enables the free-page-reporting in qemu. Signed-off-by: Nico Pache --- src/qemu/qemu_command.c | 5 +++++ src/qemu/qemu_validate.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9519861e92..6466efc756 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3830,6 +3830,11 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd, virTristateSwitchTypeToString(def->memballoon->a= utodeflate)); } =20 + if (def->memballoon->free_page_reporting !=3D VIR_TRISTATE_SWITCH_ABSE= NT) { + virBufferAsprintf(&buf, ",free-page-reporting=3D%s", + virTristateSwitchTypeToString(def->memballoon->free_page= _reporting)); + } + qemuBuildVirtioOptionsStr(&buf, def->memballoon->virtio); =20 if (qemuCommandAddExtDevice(cmd, &def->memballoon->info) < 0) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index a212605579..cfeb1e67c4 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3926,6 +3926,13 @@ qemuValidateDomainDeviceDefMemballoon(const virDomai= nMemballoonDef *memballoon, return -1; } =20 + if (memballoon->free_page_reporting !=3D VIR_TRISTATE_SWITCH_ABSENT && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_BALLOON_FREE_PAGE_REPO= RTING)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("free-page-reporting is not supported by this QE= MU binary")); + return -1; + } + if (qemuValidateDomainVirtioOptions(memballoon->virtio, qemuCaps) < 0) return -1; =20 --=20 2.18.4