Hi Andrea,


This is wrt diffs for old qemus, which I picked from your git.

diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.replies b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.replies
index 065e2b4..a82438e 100644
--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.replies
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.replies
@@ -5176,6 +5176,14 @@
 }
 
 {
+  "id": "libvirt-42",
+  "error": {
+    "class": "DeviceNotFound",
+    "desc": "Device 'spapr-machine' not found"
+  }
+}
+
+{
 
On the contrary, I see query device-list-proprties on spapr-machine results in CapsProbeFailure. I tried on both v2.11.1 and v.2.10.2

2018-03-06 05:41:16.201+0000: 119127: error : qemuMonitorJSONCheckError:392 : internal error: unable to execute QEMU command 'device-list-properties': Parameter 'typename' expects device
2018-03-06 05:41:16.201+0000: 119127: warning : virQEMUCapsLogProbeFailure:5241 : Failed to probe capabilities for /usr/libexec/qemu-kvm: internal error: unable to execute QEMU command 'device-list-properties': Parameter 'typename' expects device

As actual is,

{"execute":"device-list-properties","arguments":{"typename":"spapr-machine"},"id":"libvirt-42"}

{
  "id": "libvirt-42",
  "error": {
    "class": "GenericError",
    "desc": "Parameter 'typename' expects device"
  }
}

Also because of that, I think we should query machine features only if QEMU_CAPS_QOM_LIST_PROPERTIES is there.

Thanks,
Shivaprasad

On Thu, Mar 1, 2018 at 11:33 PM, Andrea Bolognani <abologna@redhat.com> wrote:
Using the new qom-list-properties QMP command allows us to probe
for the corresponding QEMU machine type options.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/qemu/qemu_capabilities.c                       |  16 ++
 src/qemu/qemu_capabilities.h                       |   6 +
 .../qemucapabilitiesdata/caps_1.2.2.x86_64.replies |  20 ++-
 tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_1.3.1.x86_64.replies |  20 ++-
 tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_1.4.2.x86_64.replies |  20 ++-
 tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies |  20 ++-
 tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_1.6.0.x86_64.replies |  20 ++-
 tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_1.7.0.x86_64.replies |  20 ++-
 tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_2.1.1.x86_64.replies |  20 ++-
 tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml   |   2 +-
 .../caps_2.10.0-gicv2.aarch64.replies              |  24 ++-
 .../caps_2.10.0-gicv2.aarch64.xml                  |   2 +-
 .../caps_2.10.0-gicv3.aarch64.replies              |  24 ++-
 .../caps_2.10.0-gicv3.aarch64.xml                  |   2 +-
 .../qemucapabilitiesdata/caps_2.10.0.ppc64.replies |  22 ++-
 tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_2.10.0.s390x.replies |  26 ++--
 tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   2 +-
 .../caps_2.10.0.x86_64.replies                     |  30 ++--
 tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml  |   2 +-
 .../caps_2.12.0-gicv2.aarch64.replies              |  24 ++-
 .../caps_2.12.0-gicv2.aarch64.xml                  |   2 +-
 .../caps_2.12.0-gicv3.aarch64.replies              |  24 ++-
 .../caps_2.12.0-gicv3.aarch64.xml                  |   2 +-
 .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 170 ++++++++++++++++++++-
 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml   |   6 +-
 .../caps_2.12.0.x86_64.replies                     |  30 ++--
 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml  |   2 +-
 .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies |  20 ++-
 tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies |  22 ++-
 tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml   |   2 +-
 .../caps_2.6.0-gicv2.aarch64.replies               |  24 ++-
 .../caps_2.6.0-gicv2.aarch64.xml                   |   2 +-
 .../caps_2.6.0-gicv3.aarch64.replies               |  24 ++-
 .../caps_2.6.0-gicv3.aarch64.xml                   |   2 +-
 .../qemucapabilitiesdata/caps_2.6.0.ppc64.replies  |  22 ++-
 tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml    |   2 +-
 .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies |  22 ++-
 tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_2.7.0.s390x.replies  |  22 ++-
 tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   2 +-
 .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies |  22 ++-
 tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_2.8.0.s390x.replies  |  26 ++--
 tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   2 +-
 .../qemucapabilitiesdata/caps_2.8.0.x86_64.replies |  22 ++-
 tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml   |   2 +-
 .../qemucapabilitiesdata/caps_2.9.0.ppc64.replies  |  22 ++-
 tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml    |   2 +-
 .../qemucapabilitiesdata/caps_2.9.0.s390x.replies  |  26 ++--
 tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   2 +-
 .../qemucapabilitiesdata/caps_2.9.0.x86_64.replies |  30 ++--
 tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml   |   2 +-
 60 files changed, 654 insertions(+), 248 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index fb6b492454..72c0c2a338 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -460,6 +460,12 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "machine.pseries.max-cpu-compat",
               "dump-completed",
               "qom-list-properties",
+              "machine.pseries.cap-htm",
+
+              /* 285 */
+              "machine.pseries.cap-sbbc",
+              "machine.pseries.cap-cfpc",
+              "machine.pseries.cap-ibs",
     );


@@ -1819,6 +1825,13 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = {
     { "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB },
 };

+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSPAPRMachine[] = {
+    { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM },
+    { "cap-sbbc", QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC },
+    { "cap-cfpc", QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC },
+    { "cap-ibs", QEMU_CAPS_MACHINE_PSERIES_CAP_IBS },
+};
+
 /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */
 static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
     { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL},
@@ -1934,6 +1947,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
     { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge,
       ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge),
       QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
+    { "spapr-machine", virQEMUCapsObjectPropsSPAPRMachine,
+      ARRAY_CARDINALITY(virQEMUCapsObjectPropsSPAPRMachine),
+      -1 },
 };

 struct virQEMUCapsPropTypeObjects {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index ce07dfd6b1..cad18f4134 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -445,6 +445,12 @@ typedef enum {
     QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-compat= */
     QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */
     QEMU_CAPS_QOM_LIST_PROPERTIES, /* qom-list-properties QMP command */
+    QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, /* -machine pseries,cap-htm= */
+
+    /* 285 */
+    QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, /* -machine pseries,cap-sbbc= */
+    QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC , /* -machine pseries,cap-cfpc= */
+    QEMU_CAPS_MACHINE_PSERIES_CAP_IBS , /* -machine pseries,cap-ibs= */

     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies
index 62c31774c0..62faf58520 100644
--- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies
+++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.replies
@@ -1708,6 +1708,14 @@
   "id": "libvirt-39"
 }

+{
+  "id": "libvirt-40",
+  "error": {
+    "class": "DeviceNotFound",
+    "desc": "Device 'spapr-machine' not found"
+  }
+}
+
 {
   "return": [
     {
@@ -1746,7 +1754,7 @@
       "name": "none"
     }
   ],
-  "id": "libvirt-40"
+  "id": "libvirt-41"
 }

 {
[...]
diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml
index 3001d487c6..d7109dd0bf 100644
--- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml
@@ -112,7 +112,7 @@
   <flag name='isa-serial'/>
   <version>1002002</version>
   <kvmVersion>0</kvmVersion>
-  <microcodeVersion>26900</microcodeVersion>
+  <microcodeVersion>27022</microcodeVersion>
   <package></package>
   <arch>x86_64</arch>
   <cpu type='kvm' name='qemu64'/>
[...]
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies
index fa13229776..f15ed0f557 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies
@@ -5620,6 +5620,162 @@
   "id": "libvirt-41"
 }

+{
+  "return": [
+    {
+      "name": "graphics",
+      "description": "Set on/off to enable/disable graphics emulation",
+      "type": "bool"
+    },
+    {
+      "name": "phandle-start",
+      "description": "The first phandle ID we may generate dynamically",
+      "type": "int"
+    },
+    {
+      "name": "dump-guest-core",
+      "description": "Include guest memory in  a core dump",
+      "type": "bool"
+    },
+    {
+      "name": "kernel-irqchip",
+      "description": "Configure KVM in-kernel irqchip",
+      "type": "on|off|split"
+    },
+    {
+      "name": "accel",
+      "description": "Accelerator list",
+      "type": "string"
+    },
+    {
+      "name": "append",
+      "description": "Linux kernel command line",
+      "type": "string"
+    },
+    {
+      "name": "dumpdtb",
+      "description": "Dump current dtb to a file and quit",
+      "type": "string"
+    },
+    {
+      "name": "igd-passthru",
+      "description": "Set on/off to enable/disable igd passthrou",
+      "type": "bool"
+    },
+    {
+      "name": "dt-compatible",
+      "description": "Overrides the \"compatible\" property of the dt root node",
+      "type": "string"
+    },
+    {
+      "name": "kernel",
+      "description": "Linux kernel image file",
+      "type": "string"
+    },
+    {
+      "name": "usb",
+      "description": "Set on/off to enable/disable usb",
+      "type": "bool"
+    },
+    {
+      "name": "suppress-vmdesc",
+      "description": "Set on to disable self-describing migration",
+      "type": "bool"
+    },
+    {
+      "name": "dtb",
+      "description": "Linux kernel device tree file",
+      "type": "string"
+    },
+    {
+      "name": "firmware",
+      "description": "Firmware image",
+      "type": "string"
+    },
+    {
+      "name": "mem-merge",
+      "description": "Enable/disable memory merge support",
+      "type": "bool"
+    },
+    {
+      "name": "initrd",
+      "description": "Linux initial ramdisk file",
+      "type": "string"
+    },
+    {
+      "name": "enforce-config-section",
+      "description": "Set on to enforce configuration section migration",
+      "type": "bool"
+    },
+    {
+      "name": "kvm-shadow-mem",
+      "description": "KVM shadow MMU size",
+      "type": "int"
+    },
+    {
+      "name": "cap-ibs",
+      "description": "Indirect Branch Serialisation (broken, fixed)",
+      "type": "string"
+    },
+    {
+      "name": "cap-cfpc",
+      "description": "Cache Flush on Privilege Change (broken, workaround, fixed)",
+      "type": "string"
+    },
+    {
+      "name": "cap-sbbc",
+      "description": "Speculation Barrier Bounds Checking (broken, workaround, fixed)",
+      "type": "string"
+    },
+    {
+      "name": "cap-dfp",
+      "description": "Allow Decimal Floating Point (DFP)",
+      "type": "bool"
+    },
+    {
+      "name": "cap-htm",
+      "description": "Allow Hardware Transactional Memory (HTM)",
+      "type": "bool"
+    },
+    {
+      "name": "cap-vsx",
+      "description": "Allow Vector Scalar Extensions (VSX)",
+      "type": "bool"
+    },
+    {
+      "name": "cap-ibs",
+      "description": "Indirect Branch Serialisation (broken, fixed)",
+      "type": "string"
+    },
+    {
+      "name": "cap-cfpc",
+      "description": "Cache Flush on Privilege Change (broken, workaround, fixed)",
+      "type": "string"
+    },
+    {
+      "name": "cap-sbbc",
+      "description": "Speculation Barrier Bounds Checking (broken, workaround, fixed)",
+      "type": "string"
+    },
+    {
+      "name": "cap-dfp",
+      "description": "Allow Decimal Floating Point (DFP)",
+      "type": "bool"
+    },
+    {
+      "name": "cap-htm",
+      "description": "Allow Hardware Transactional Memory (HTM)",
+      "type": "bool"
+    },
+    {
+      "name": "cap-vsx",
+      "description": "Allow Vector Scalar Extensions (VSX)",
+      "type": "bool"
+    }
+  ],
+  "id": "libvirt-42"
+}
+
 {
   "return": [
     {
@@ -5745,7 +5901,7 @@
       "cpu-max": 1
     }
   ],
-  "id": "libvirt-42"
+  "id": "libvirt-43"
 }

 {
[...]
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
index bcaa73c48f..36a426dce3 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
@@ -186,9 +186,13 @@
   <flag name='machine.pseries.max-cpu-compat'/>
   <flag name='dump-completed'/>
   <flag name='qom-list-properties'/>
+  <flag name='machine.pseries.cap-htm'/>
+  <flag name='machine.pseries.cap-sbbc'/>
+  <flag name='machine.pseries.cap-cfpc'/>
+  <flag name='machine.pseries.cap-ibs'/>
   <version>2011050</version>
   <kvmVersion>0</kvmVersion>
-  <microcodeVersion>395796</microcodeVersion>
+  <microcodeVersion>399614</microcodeVersion>
   <package> (v2.11.0-1777-g2765615)</package>
   <arch>ppc64</arch>
   <cpu type='kvm' name='default'/>
[...]
--
2.14.3

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