Re: [libvirt] [PATCH 1/3] qemu: record the QEMU default machine in capabilities

2018-08-27 Thread John Ferlan


On 08/16/2018 11:12 AM, Daniel P. Berrangé wrote:
> We don't honour the QEMU default machine type anymore, always using the
> libvirt chosen default instead. The QEMU argv parser, however, will need
> to know the exacty QEMU default, so we must record that info.
> 
> Signed-off-by: Daniel P. Berrangé 
> ---
>  src/qemu/qemu_capabilities.c | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 

This patch alone fails make check. Need to move some stuff from patch 3
into here.

 1. virQEMUCapsNewCopy change
 2. virQEMUCapsFormatCache change
 3. Regenerate qemucapabilitiestest output

With those changes,

Reviewed-by: John Ferlan 

John

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

[libvirt] [PATCH 1/3] qemu: record the QEMU default machine in capabilities

2018-08-16 Thread Daniel P . Berrangé
We don't honour the QEMU default machine type anymore, always using the
libvirt chosen default instead. The QEMU argv parser, however, will need
to know the exacty QEMU default, so we must record that info.

Signed-off-by: Daniel P. Berrangé 
---
 src/qemu/qemu_capabilities.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index e6e199b2c6..a0a1b97f1d 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -515,6 +515,7 @@ struct virQEMUCapsMachineType {
 char *alias;
 unsigned int maxCpus;
 bool hotplugCpus;
+bool qemuDefault;
 };
 
 typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData;
@@ -2324,8 +2325,10 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps,
 preferredIdx = qemuCaps->nmachineTypes - 1;
 }
 
-if (machines[i]->isDefault)
+if (machines[i]->isDefault) {
+mach->qemuDefault = true;
 defIdx = qemuCaps->nmachineTypes - 1;
+}
 }
 
 /*
@@ -3355,7 +3358,7 @@ virQEMUCapsCachePrivFree(void *privData)
  *   ...
  *   
  *   ...
- *   
+ *   
  *   ...
  * 
  */
@@ -3520,6 +3523,11 @@ virQEMUCapsLoadCache(virArch hostArch,
 if (STREQ_NULLABLE(str, "yes"))
 qemuCaps->machineTypes[i].hotplugCpus = true;
 VIR_FREE(str);
+
+str = virXMLPropString(nodes[i], "default");
+if (STREQ_NULLABLE(str, "yes"))
+qemuCaps->machineTypes[i].qemuDefault = true;
+VIR_FREE(str);
 }
 }
 VIR_FREE(nodes);
@@ -3768,6 +3776,8 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps)
   qemuCaps->machineTypes[i].alias);
 if (qemuCaps->machineTypes[i].hotplugCpus)
 virBufferAddLit(, " hotplugCpus='yes'");
+if (qemuCaps->machineTypes[i].qemuDefault)
+virBufferAddLit(, " default='yes'");
 virBufferAsprintf(, " maxCpus='%u'/>\n",
   qemuCaps->machineTypes[i].maxCpus);
 }
-- 
2.17.1

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