From: Kristina Hanicova Date: Tue, 2 Aug 2022 15:50:13 +0000 (+0200) Subject: qemu_capabilities: replace code with function call X-Git-Tag: v8.7.0-rc1~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=288a297df53fa2b6fbf0d4e78a7cc7ce31dad222;p=thirdparty%2Flibvirt.git 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 Signed-off-by: Michal Privoznik Reviewed-by: Jonathon Jongsma --- diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b002fb98ed..c2c55f4800 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -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); }