mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu_capabilities: replace code with function call
Since functions virQEMUCapsFillDomainFeatureSEVCaps() and virQEMUCapsSEVInfoCopy() essentially do the same thing it does not make sense to have the code duplicated. This patch replaces the relevant code in the first function with the function call to the second one. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
c0d9adf220
commit
288a297df5
@ -6490,23 +6490,7 @@ static void
|
||||
virQEMUCapsFillDomainFeatureSEVCaps(virQEMUCaps *qemuCaps,
|
||||
virDomainCaps *domCaps)
|
||||
{
|
||||
virSEVCapability *cap = qemuCaps->sevCapabilities;
|
||||
|
||||
if (!cap)
|
||||
return;
|
||||
|
||||
domCaps->sev = g_new0(virSEVCapability, 1);
|
||||
|
||||
domCaps->sev->pdh = g_strdup(cap->pdh);
|
||||
domCaps->sev->cert_chain = g_strdup(cap->cert_chain);
|
||||
if (cap->cpu0_id != NULL) {
|
||||
domCaps->sev->cpu0_id = g_strdup(cap->cpu0_id);
|
||||
}
|
||||
|
||||
domCaps->sev->cbitpos = cap->cbitpos;
|
||||
domCaps->sev->reduced_phys_bits = cap->reduced_phys_bits;
|
||||
domCaps->sev->max_guests = cap->max_guests;
|
||||
domCaps->sev->max_es_guests = cap->max_es_guests;
|
||||
virQEMUCapsSEVInfoCopy(&domCaps->sev, qemuCaps->sevCapabilities);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user