mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
domain_capabilities: use early return in virDomainCapsFeatureSEVFormat()
Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
69e0e33873
commit
54412f01b2
@ -590,25 +590,24 @@ virDomainCapsFeatureSEVFormat(virBuffer *buf,
|
|||||||
{
|
{
|
||||||
if (!sev) {
|
if (!sev) {
|
||||||
virBufferAddLit(buf, "<sev supported='no'/>\n");
|
virBufferAddLit(buf, "<sev supported='no'/>\n");
|
||||||
} else {
|
return;
|
||||||
virBufferAddLit(buf, "<sev supported='yes'>\n");
|
|
||||||
virBufferAdjustIndent(buf, 2);
|
|
||||||
virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos);
|
|
||||||
virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n",
|
|
||||||
sev->reduced_phys_bits);
|
|
||||||
virBufferAsprintf(buf, "<maxGuests>%d</maxGuests>\n",
|
|
||||||
sev->max_guests);
|
|
||||||
virBufferAsprintf(buf, "<maxESGuests>%d</maxESGuests>\n",
|
|
||||||
sev->max_es_guests);
|
|
||||||
if (sev->cpu0_id != NULL) {
|
|
||||||
virBufferAsprintf(buf, "<cpu0Id>%s</cpu0Id>\n",
|
|
||||||
sev->cpu0_id);
|
|
||||||
}
|
|
||||||
virBufferAdjustIndent(buf, -2);
|
|
||||||
virBufferAddLit(buf, "</sev>\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
virBufferAddLit(buf, "<sev supported='yes'>\n");
|
||||||
|
virBufferAdjustIndent(buf, 2);
|
||||||
|
virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos);
|
||||||
|
virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n",
|
||||||
|
sev->reduced_phys_bits);
|
||||||
|
virBufferAsprintf(buf, "<maxGuests>%d</maxGuests>\n",
|
||||||
|
sev->max_guests);
|
||||||
|
virBufferAsprintf(buf, "<maxESGuests>%d</maxESGuests>\n",
|
||||||
|
sev->max_es_guests);
|
||||||
|
if (sev->cpu0_id != NULL) {
|
||||||
|
virBufferAsprintf(buf, "<cpu0Id>%s</cpu0Id>\n",
|
||||||
|
sev->cpu0_id);
|
||||||
|
}
|
||||||
|
virBufferAdjustIndent(buf, -2);
|
||||||
|
virBufferAddLit(buf, "</sev>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user