mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu_capabilities: Parse "deprecated" in virQEMUCapsLoadMachines() properly
A <machine/> element can have "deprecated" attribute that corresponds to 'deprecated' member of _virQEMUCapsMachineType struct. But the member is of boolean type. Therefore, the string returned by virXMLPropString() must be freed. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
71609477a2
commit
aebb2b6edf
@ -4063,7 +4063,11 @@ virQEMUCapsLoadMachines(virQEMUCapsAccelPtr caps,
|
||||
|
||||
caps->machineTypes[i].defaultCPU = virXMLPropString(nodes[i], "defaultCPU");
|
||||
caps->machineTypes[i].defaultRAMid = virXMLPropString(nodes[i], "defaultRAMid");
|
||||
caps->machineTypes[i].deprecated = virXMLPropString(nodes[i], "deprecated");
|
||||
|
||||
str = virXMLPropString(nodes[i], "deprecated");
|
||||
if (STREQ_NULLABLE(str, "yes"))
|
||||
caps->machineTypes[i].deprecated = true;
|
||||
VIR_FREE(str);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user