mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu_driver: expand cpu features after baseline
Perform a full CPU model expansion on the result of the baselined model name when the features flag is present. Signed-off-by: Collin Walling <walling@linux.ibm.com> Message-Id: <1568924706-2311-11-git-send-email-walling@linux.ibm.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
09d23faac1
commit
aa797c6625
@ -13783,6 +13783,7 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCaps,
|
|||||||
const char *libDir,
|
const char *libDir,
|
||||||
uid_t runUid,
|
uid_t runUid,
|
||||||
gid_t runGid,
|
gid_t runGid,
|
||||||
|
bool expand_features,
|
||||||
virCPUDefPtr *cpus,
|
virCPUDefPtr *cpus,
|
||||||
int ncpus)
|
int ncpus)
|
||||||
{
|
{
|
||||||
@ -13814,6 +13815,16 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCaps,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (expand_features) {
|
||||||
|
if (qemuMonitorGetCPUModelExpansion(proc->mon,
|
||||||
|
QEMU_MONITOR_CPU_MODEL_EXPANSION_FULL,
|
||||||
|
baseline, true, false, &result) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
if (qemuConnectStealCPUModelFromInfo(baseline, &result) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
VIR_STEAL_PTR(ret, baseline);
|
VIR_STEAL_PTR(ret, baseline);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -13891,9 +13902,11 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else if (ARCH_IS_S390(arch) &&
|
} else if (ARCH_IS_S390(arch) &&
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_BASELINE)) {
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_BASELINE)) {
|
||||||
|
bool expand_features = (flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES);
|
||||||
|
|
||||||
if (!(cpu = qemuConnectCPUModelBaseline(qemuCaps, cfg->libDir,
|
if (!(cpu = qemuConnectCPUModelBaseline(qemuCaps, cfg->libDir,
|
||||||
cfg->user, cfg->group,
|
cfg->user, cfg->group,
|
||||||
cpus, ncpus)))
|
expand_features, cpus, ncpus)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else {
|
} else {
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user