Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- Notes: Version 3: - s/type/virtType/ in virQEMUCapsLoadHostCPUModelInfo Version 2: - no change src/qemu/qemu_capabilities.c | 19 ++++++++++++++----- src/qemu/qemu_capspriv.h | 10 ++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ce191ee99..55c17a20e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3209,7 +3209,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, * 1 when the caller should fall back to using virCapsPtr->host.cpu, * -1 on error. */ -static int +int virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, virDomainVirtType type, virCPUDefPtr cpu) @@ -3273,6 +3273,18 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, } +void +virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps, + virDomainVirtType type, + qemuMonitorCPUModelInfoPtr modelInfo) +{ + if (type == VIR_DOMAIN_VIRT_KVM) + qemuCaps->kvmCPUModelInfo = modelInfo; + else + qemuCaps->tcgCPUModelInfo = modelInfo; +} + + static int virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt, @@ -3372,10 +3384,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsPtr qemuCaps, } } - if (virtType == VIR_DOMAIN_VIRT_KVM) - qemuCaps->kvmCPUModelInfo = hostCPU; - else - qemuCaps->tcgCPUModelInfo = hostCPU; + virQEMUCapsSetCPUModelInfo(qemuCaps, virtType, hostCPU); hostCPU = NULL; ret = 0; diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index 75499d462..d4f13a2d2 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -73,4 +73,14 @@ void virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, virCapsPtr caps, virDomainVirtType type); + +int +virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, + virDomainVirtType type, + virCPUDefPtr cpu); + +void +virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps, + virDomainVirtType type, + qemuMonitorCPUModelInfoPtr modelInfo); #endif -- 2.11.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list