From nobody Wed May 14 12:33:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523781729444213.89867607844712; Sun, 15 Apr 2018 01:42:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11E083004850; Sun, 15 Apr 2018 08:42:08 +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 D64AF84E6; Sun, 15 Apr 2018 08:42:07 +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 87E1C180613A; Sun, 15 Apr 2018 08:42:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3CGeAtC006563 for ; Thu, 12 Apr 2018 12:40:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7CF8310B00B2; Thu, 12 Apr 2018 16:40:10 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE9DC1208F89; Thu, 12 Apr 2018 16:40:09 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 18:39:50 +0200 Message-Id: <8dbb5130503fa5a9ff905b9772a326df53e1db25.1523551063.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: zack.cornelius@kove.net, ehabkost@redhat.com Subject: [libvirt] [PATCH v1 5/7] qemu_capabilities: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sun, 15 Apr 2018 08:42:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This capability tracks if memory-backend-file has discard-data attribute or not. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 17 +++++++++++++++++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 18 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2d36aeaa54..8117252789 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -468,6 +468,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "virtio-tablet-ccw", "qcow2-luks", "pcie-pci-bridge", + "memory-backend-file.discard-data", ); =20 =20 @@ -1367,6 +1368,15 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDeviceP= rops[] =3D { QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW }, }; =20 +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFi= le[] =3D { + { "discard-data", QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD }, +}; + +static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] =3D { + { "memory-backend-file", virQEMUCapsObjectPropsMemoryBackendFile, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsMemoryBackendFile), + QEMU_CAPS_OBJECT_MEMORY_FILE }, +}; =20 static void virQEMUCapsProcessStringFlags(virQEMUCapsPtr qemuCaps, @@ -2128,6 +2138,13 @@ virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC)) virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC); =20 + if (virQEMUCapsProbeQMPGenericProps(qemuCaps, + mon, + virQEMUCapsObjectProps, + ARRAY_CARDINALITY(virQEMUCapsObjec= tProps), + qemuMonitorGetObjectProps) < 0) + return -1; + return 0; } =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 3a8ffcd0e7..189ed45de3 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -452,6 +452,7 @@ typedef enum { QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW, /* -device virtio-tablet-ccw */ QEMU_CAPS_QCOW2_LUKS, /* qcow2 format support LUKS encryption */ QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE, /* -device pcie-pci-bridge */ + QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD, /* -object memory-backend-dile,d= iscard-data=3D */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list