Re: [PATCH v3 4/5] qemu_capabilities: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 19, 2018 at 04:00:26PM +0200, Michal Privoznik wrote:
This capability tracks if memory-backend-file has discard-data
attribute or not.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
src/qemu/qemu_capabilities.c                       |   17 +
src/qemu/qemu_capabilities.h                       |    1 +
.../qemucapabilitiesdata/caps_2.1.1.x86_64.replies |  178 +-
tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml   |    2 +-
.../caps_2.10.0.aarch64.replies                    |  348 +-
tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml |    2 +-
.../qemucapabilitiesdata/caps_2.10.0.ppc64.replies | 4366 +++++++++----------
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml   |    2 +-
.../qemucapabilitiesdata/caps_2.10.0.s390x.replies | 1086 ++---
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |    2 +-
.../caps_2.10.0.x86_64.replies                     |  736 ++--
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml  |    2 +-
.../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 1088 ++---
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |    2 +-
.../caps_2.12.0.aarch64.replies                    |  370 +-
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml |    2 +-
.../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 4408 ++++++++++----------
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml   |    2 +-
.../qemucapabilitiesdata/caps_2.12.0.s390x.replies |   32 +-
.../caps_2.12.0.x86_64.replies                     |  804 ++--
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml  |    3 +-
.../qemucapabilitiesdata/caps_2.4.0.x86_64.replies |  196 +-
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml   |    2 +-
.../qemucapabilitiesdata/caps_2.5.0.x86_64.replies |  198 +-
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml   |    2 +-
.../caps_2.6.0.aarch64.replies                     |  214 +-
tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml  |    2 +-
.../qemucapabilitiesdata/caps_2.6.0.ppc64.replies  | 2618 ++++++------
tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml    |    2 +-
.../qemucapabilitiesdata/caps_2.6.0.x86_64.replies |  198 +-
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml   |    2 +-
.../qemucapabilitiesdata/caps_2.7.0.s390x.replies  |   32 +-
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |    2 +-
.../qemucapabilitiesdata/caps_2.7.0.x86_64.replies |  204 +-
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml   |    2 +-
.../qemucapabilitiesdata/caps_2.8.0.s390x.replies  |  670 +--
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |    2 +-
.../qemucapabilitiesdata/caps_2.8.0.x86_64.replies |   32 +-
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml   |    2 +-
.../qemucapabilitiesdata/caps_2.9.0.ppc64.replies  | 4366 +++++++++----------
tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml    |    2 +-
.../qemucapabilitiesdata/caps_2.9.0.s390x.replies  |  798 ++--
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |    2 +-
.../qemucapabilitiesdata/caps_2.9.0.x86_64.replies |  728 ++--
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml   |    2 +-
45 files changed, 11986 insertions(+), 11745 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 833c75514c..2488a80244 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -473,6 +473,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
              /* 290 */
              "query-cpus-fast",
              "disk-write-cache",
+              "memory-backend-file.discard-data",
    );


@@ -1366,6 +1367,15 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = {
      QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
};

+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] = {
+    { "discard-data", QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD },
+};
+
+static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
+    { "memory-backend-file", virQEMUCapsObjectPropsMemoryBackendFile,
+      ARRAY_CARDINALITY(virQEMUCapsObjectPropsMemoryBackendFile),
+      QEMU_CAPS_OBJECT_MEMORY_FILE },
+};

static void
virQEMUCapsProcessStringFlags(virQEMUCapsPtr qemuCaps,
@@ -2123,6 +2133,13 @@ virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps,
                                        qemuMonitorGetDeviceProps) < 0)
        return -1;

+    if (virQEMUCapsProbeQMPGenericProps(qemuCaps,
+                                        mon,
+                                        virQEMUCapsObjectProps,
+                                        ARRAY_CARDINALITY(virQEMUCapsObjectProps),
+                                        qemuMonitorGetObjectProps) < 0)
+        return -1;
+

We probe for virQEMUCapsProbeQMPCommands, so we should be able to run it
only when the command is supported

Jano
    return 0;
}

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux