[libvirt] [PATCH 1/2] qemu: Add capability for pseries machine's max-cpu-compat= parameter

Shivaprasad G Bhat posted 2 patches 7 years, 4 months ago
There is a newer version of this series
[libvirt] [PATCH 1/2] qemu: Add capability for pseries machine's max-cpu-compat= parameter
Posted by Shivaprasad G Bhat 7 years, 4 months ago
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
---
 src/qemu/qemu_capabilities.c                     |    7 +++++++
 src/qemu/qemu_capabilities.h                     |    2 ++
 tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml |    1 +
 3 files changed, 10 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 9673ef8..fdc8b37 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -456,6 +456,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
 
               /* 280 */
               "pl011",
+              "machine.pseries.max-cpu-compat",
     );
 
 
@@ -4836,6 +4837,12 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
     if (qemuCaps->version >= 2010000)
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_NUMA_DIST);
 
+    /* no way to query max-cpu-comapt */
+    if (qemuCaps->version >= 2010000 &&
+        ARCH_IS_PPC64(qemuCaps->arch)) {
+        virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT);
+    }
+
     if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0)
         goto cleanup;
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e73dbaa..f041324 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -442,6 +442,8 @@ typedef enum {
 
     /* 280 */
     QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */
+    QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine
+                                               *  pseries,max-cpu-compat=xxx */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
index ca55e11..37fed23 100644
--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
@@ -183,6 +183,7 @@
   <flag name='disk-share-rw'/>
   <flag name='iscsi.password-secret'/>
   <flag name='isa-serial'/>
+  <flag name='machine.pseries.max-cpu-compat'/>
   <version>2010000</version>
   <kvmVersion>0</kvmVersion>
   <package> (v2.10.0)</package>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/2] qemu: Add capability for pseries machine's max-cpu-compat= parameter
Posted by Andrea Bolognani 7 years, 4 months ago
On Thu, 2018-01-04 at 18:04 +0530, Shivaprasad G Bhat wrote:
> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
> ---
>  src/qemu/qemu_capabilities.c                     |    7 +++++++
>  src/qemu/qemu_capabilities.h                     |    2 ++
>  tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml |    1 +
>  3 files changed, 10 insertions(+)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 9673ef8..fdc8b37 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
[...]
> @@ -4836,6 +4837,12 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
>      if (qemuCaps->version >= 2010000)
>          virQEMUCapsSet(qemuCaps, QEMU_CAPS_NUMA_DIST);
>  
> +    /* no way to query max-cpu-comapt */

s/comapt/compat/g

> diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
> index e73dbaa..f041324 100644
> --- a/src/qemu/qemu_capabilities.h
> +++ b/src/qemu/qemu_capabilities.h
> @@ -442,6 +442,8 @@ typedef enum {
>  
>      /* 280 */
>      QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */
> +    QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine
> +                                               *  pseries,max-cpu-compat=xxx */

You can leave out the 'xxx' part and avoid spreading the comment
over two lines.


With those nits fixed,

  Reviewed-by: Andrea Bolognani <abologna@redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization

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